feat: memoized receipt root on BlockOutput#155
Merged
Conversation
4aa7288 to
b8e18a8
Compare
prestwich
added a commit
to init4tech/signet-sdk
that referenced
this pull request
Apr 2, 2026
Add OnceLock-based memoization for transactions_root using the seal/unseal pattern. Wire receipts_root from trevm's new BlockOutput::receipt_root() accessor. Both roots are now set explicitly in construct_header instead of relying on Default. BREAKING: requires trevm >=0.34.2 (init4tech/trevm#155) ENG-2120 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks
Evalir
approved these changes
Apr 2, 2026
Member
Evalir
left a comment
There was a problem hiding this comment.
lgtm. the single pass seal() is super elegant
prestwich
added a commit
to init4tech/signet-sdk
that referenced
this pull request
Apr 3, 2026
Add OnceLock-based memoization for transactions_root using the seal/unseal pattern. Wire receipts_root from trevm's new BlockOutput::receipt_root() accessor. Both roots are now set explicitly in construct_header instead of relying on Default. BREAKING: requires trevm >=0.34.2 (init4tech/trevm#155) ENG-2120 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
receipt_root()andseal()methods toBlockOutputseal()computes both bloom and receipt root in a single pass viaordered_trie_root_with_encoder, deriving the block bloom as a side effect of trie encodinginto_parts()now returnsOption<Bloom>andOption<B256>for memoized valuesinto_sealed_parts()seals first and returns guaranteed(Vec<T>, Vec<Address>, Bloom, B256)receipt_root()requiresT: TxReceipt + Encodable2718;logs_bloom()retains the weakerTxReceipt<Log = Log>boundCLAUDE.mdwith project commands, style guidelines, and versioning policyinto_parts()return type changed; bumps version to0.34.2Closes #12
ENG-2119
Test plan
cargo clippy -p trevm --all-features --all-targetspassescargo clippy -p trevm --no-default-features --all-targetspassescargo t -p trevm— 39 unit + 10 doc tests passinto_parts()are updated for new return type🤖 Generated with Claude Code