AVM: Add box_splice and box_resize opcodes#5750
Merged
jannotti merged 3 commits intoalgorand:masterfrom Dec 4, 2023
Merged
Conversation
8395c2c to
1f5c248
Compare
joe-p
reviewed
Sep 21, 2023
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5750 +/- ##
==========================================
+ Coverage 55.86% 55.91% +0.05%
==========================================
Files 477 477
Lines 67259 67333 +74
==========================================
+ Hits 37576 37652 +76
+ Misses 27133 27127 -6
- Partials 2550 2554 +4 ☔ View full report in Codecov by Sentry. |
|
Big fan of this! Working with a 16KB box for the Exa shuffle was a bit of a pain, having to iterate 4KB chunks and do careful arithmetic. Doable, but tedious and kind of unnecessary. |
jasonpaulos
previously approved these changes
Nov 20, 2023
Contributor
jasonpaulos
left a comment
There was a problem hiding this comment.
Changes and tests look good to me, just one small docs question
These opcodes simplify working with large boxes. There are simple combinations of existing codes to do the equivalent on boxes smaller than 4k. But they require moving box content into AVM values that cannot exceed 4k. So, for big boxes it is useful to have these operations. (box_splice may also be a nice convenience, even for small boxes)
jasonpaulos
approved these changes
Dec 4, 2023
algorandskiy
approved these changes
Dec 4, 2023
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.
These opcodes simplify working with large boxes. There are simple combinations of existing codes to do the equivalent on boxes smaller than 4k. But they require moving box content into AVM values that cannot exceed 4k. So, for big boxes it is useful to have these operations.
Both opcodes seem convenient, but not quite necessary, for smaller boxes.