feat[venom]: wire up dyn allocations#5127
Conversation
Gas Changes
Summary
|
📊 Bytecode Size Changes (venom)
Full bytecode sizes
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #5127 +/- ##
==========================================
- Coverage 92.83% 92.78% -0.05%
==========================================
Files 191 191
Lines 29374 29973 +599
Branches 5150 5240 +90
==========================================
+ Hits 27268 27810 +542
- Misses 1412 1460 +48
- Partials 694 703 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dca2b1107d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbb57d0fc2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…f-bytes-string-locals
…f-bytes-string-locals
…f-bytes-string-locals
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d08b9fe7d8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74358c418a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Notes on the implementation: https://gist.github.com/harkal/d4fad8226b19b8b76227f54285d77340 |
What I did
Add support for unbounded sequence types —
Bytes[INF],String[INF], andDynArray[T, INF]— in the Venom pipeline. These haveno compile-time maximum length; their size is computed and allocated at runtime.
How I did it
Frontend-only, on top of the existing Venom runtime-allocation backend
(
dalloca/dret); the only backend change is adret` builder emitter.pointer (the payload lives in relocatable scratch) — required because Venom
codegen has no branch-aware variable-environment merge. Reads double-deref;
reassignment and
DynArrayappend reallocate an exact-size buffer.checked_add/checked_mul); untrustedABI input (INF calldata/returndata/
abi_decode) is bounds-checked against thereadable region before allocating; trusted constructor (CODE) args keep the
existing lenient decode.
contracts are unaffected.
(ptr, runtime-size)viadretwith FMP adoption;tuples mixing word and INF members use a Venom-only dynamic tuple frame.
members, ABI-dynamic
DynArrayelements, non-experimental codegen) arerejected at the frontend with typed errors.
Two intentional riders, called out explicitly: (1) mutating a temporary now
raises
ImmutableViolationinstead of an internal assert (a general frontenddiagnostic fix); (2) the venom metadata
IDGenerator/frame_infofix forstable, collision-free
function_ids across the deploy and runtime passes.How to verify it
Plus the full suite under
--experimental-codegen. Non-INF gas is neutral exceptcreate*(runtime-sized create buffer is a small win).Commit message
Description for the changelog
Support unbounded sequence types
Bytes[INF],String[INF], andDynArray[T, INF]under--experimental-codegen.Cute Animal Picture