execution/state: optimize transient storage zero-write fast path#20568
Open
Sahil-4555 wants to merge 2 commits intoerigontech:mainfrom
Open
execution/state: optimize transient storage zero-write fast path#20568Sahil-4555 wants to merge 2 commits intoerigontech:mainfrom
Sahil-4555 wants to merge 2 commits intoerigontech:mainfrom
Conversation
bd19cde to
c206748
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes EIP-1153 transient storage writes by avoiding per-address Storage map creation when a zero-value write is issued for an address that has no transient entries yet.
Changes:
- Add a fast path in
transientStorage.Setto return early on zero-value writes when the address bucket does not exist. - Preserve existing behavior for non-zero writes and for zero writes when an address bucket already exists.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This change optimizes the transient storage write path by avoiding per-address storage bucket creation for zero-value writes when no transient entries exist yet. Existing buckets continue to be used normally, so the change stays limited to removing unnecessary setup work from the hot path. The approach is intentionally small and local: skip map initialization when a zero-value write does not need it, while keeping the regular write path unchanged for addresses that already have transient storage state.
Result
Benchmark code