fix(anvil): canonicalize blob tx roots#15699
Merged
grandizzy merged 4 commits intoJul 13, 2026
Merged
Conversation
Block construction encoded EIP-4844 sidecars into transaction trie leaves. Encode the inner signed transaction for block roots and omit sidecars from mined RPC views while retaining the pooled form internally for blob APIs and replay.
mablr
reviewed
Jul 12, 2026
| TxEnvelope::Eip2930(s) => AnyTxEnvelope::Ethereum(TxEnvelope::Eip2930(rehash(s, hash))), | ||
| TxEnvelope::Eip4844(s) => AnyTxEnvelope::Ethereum(TxEnvelope::Eip4844(rehash(s, hash))), | ||
| TxEnvelope::Eip4844(s) => { | ||
| let s = if block.is_some() { s.map(TxEip4844Variant::drop_sidecar) } else { s }; |
Member
There was a problem hiding this comment.
This only canonicalizes mined JSON transactions. Raw transactions/raw blocks still expose pooled sidecars, and block size is still measured from that pooled encoding.
…ding-1783918934 fix(anvil): canonicalize raw blob block encoding
Remove the duplicate TxEip4844Variant test import that causes the workspace Clippy job to fail with redundant-imports denied.
grandizzy
approved these changes
Jul 13, 2026
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.
Closes #15132. This is a smaller alternative to #15133.
Anvil used the pooled EIP-4844 encoding both when building transaction trie leaves and when materializing mined RPC transactions. This keeps the pooled transaction in internal storage, where existing blob lookup and replay code already depend on its sidecar, but introduces canonical block-body encoding for trie calculation and drops the sidecar only from mined RPC views. The resulting transaction root and block hash are canonical, mined raw and full transaction responses no longer expose the sidecar, and the
anvil_getBlobs*behavior remains intact.This avoids a separate sidecar store and changes to execution, snapshots, reorgs, state serialization, and trace replay. Focused coverage checks both EIP-4844 and EIP-7594 roots, then exercises the mined RPC representation and blob retrieval end to end.
Developed with AI assistance under my direction and review.