feat: auto-chunk oversized FileUpdate contents via ExecuteAll - #1787
Closed
Dosik13 wants to merge 3 commits into
Closed
feat: auto-chunk oversized FileUpdate contents via ExecuteAll#1787Dosik13 wants to merge 3 commits into
Dosik13 wants to merge 3 commits into
Conversation
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Add opt-in auto-chunking to
FileUpdateTransaction, mirroringFileAppendTransaction, so files larger than a single transaction can be updated without hand-writing theFileUpdate+FileAppendtwo-step.SetContentspreviously sent one transaction, so contents over the ~6 KiB single-transaction limit were rejected withTRANSACTION_OVERSIZE.FileUpdateTransaction.ExecuteAll, which overwrites the file with the first chunk and appends the remainder, so contents over the single-transaction limit can be updated in one call; it returns theFileUpdateresponse followed by one response per append chunkSetMaxChunks/GetMaxChunksandSetMaxChunkSize/GetMaxChunkSize(defaults 20 / 2048, matchingFileAppendTransaction)Schedule()so chunked contents (more than one chunk) returnErrMaxChunksExceeded, mirroringFileAppendTransaction.ScheduleerrFileUpdateChunkingRequiresFileID/errFileUpdateChunkingRequiresUnfrozensentinels for the chunking preconditionsExecutesingle-transaction semantics unchanged (still returnsTRANSACTION_OVERSIZEfor oversized contents)file_update_transaction_unit_test.go/_e2e_test.gowith chunking tests (chunk-count math, boundary, guards, scheduling; >6 KiB round-trip verified viaFileContentsQueryandFileInfoQuery, plus a single-chunk case), and add anexamples/file_update_chunkedexampleRelated issue(s):
Fixes #
Notes for reviewer:
Checklist