feat: Rex4 per-frame state growth limits#169
Merged
Conversation
…structure Migrate all four resource limit trackers to use the generic FrameLimitTracker<I> infrastructure. Per-frame budget enforcement (98/100 forwarding) is enabled for state growth only in Rex4; compute gas, data size, and KV updates remain TX-level-only. - Add FrameLimitTracker<I> and FrameLimitEntry<I> generic frame-aware tracking - Reimplement ComputeGasLimit2, DataSizeLimit2, KVUpdateLimit2, StateGrowthLimit2 on top of FrameLimitTracker, replacing old tracker types - Add frame-local exceed absorption in AdditionalLimit::before_frame_return_result - Add Rex4 spec, update RESOURCE_ACCOUNTING.md, and add tests
…itionalLimit to limit.rs
- Rename DataSizeLimit2, KVUpdateLimit2, ComputeGasLimit2, StateGrowthLimit2 to DataSizeTracker, KVUpdateTracker, ComputeGasTracker, StateGrowthTracker - Extract shared DataSizeFrameInfo from data_size.rs into frame_limit.rs as CallFrameInfo for use by both DataSizeTracker and KVUpdateTracker - Fix truncated doc comment on FrameLimitTracker::pop_frame - Fix arithmetic error in specs/Rex4.md example
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.
Summary
remaining * 98/100of the parent's remaining state growth budgetMegaLimitExceeded(uint8 kind, uint64 limit)revert data, allowing the parent to continueAdditionalLimitby extractingLimitCheckand introducingFrameLimitTrackerto manage per-frame budget allocation, enforcement, and merge-on-returnTest plan
cargo test -p mega-evm— all existing and new tests passcargo fmt --all --check— formatting verifiedtests/rex4/frame_state_growth.rswith 30+ tests covering:MegaLimitExceededABI decoding)