rpc/jsonrpc: include the full BLOCKHASH ancestor chain in executionWitness headers#21529
Merged
Conversation
…tness headers
The witness `headers` field carried only the parent header plus the blocks
individually reached via the BLOCKHASH opcode. A stateless verifier validates
each ancestor header against the next block's parentHash, so it needs a
*contiguous* chain from the parent back to the oldest accessed ancestor — the
intermediate headers between them are load-bearing even when no opcode read
them directly.
collectAccessedHeaders now fills the contiguous range [oldest-accessed .. parent]
instead of emitting a sparse set.
Measured against the EEST zkevm@v0.4.0 corpus, this fixes 6 of the 7
eip8025_optional_proofs/witness_headers fixtures (e.g. blockhash_at_offset,
blockhash_boundary, multiple_blockhash_max_wins). The 7th
(extra_unused_older_ancestor) is a verifier-tolerance test ("a contiguous extra
older ancestor should still validate") that a minimal producer cannot match by
strict equality.
Refs #21307.
lupin012
approved these changes
May 30, 2026
This was referenced May 30, 2026
awskii
added a commit
that referenced
this pull request
May 31, 2026
Two canonical-shape fixes for executionWitness:
- keys: omit when empty. It is never populated, so it always serialized as
"keys": null; the canonical response shape is {state, codes, headers}.
- headers: emit the ancestor chain ascending by block number instead of
descending from the parent.
Header order does not affect the test suite (headers compare as a multiset),
and keys carries no data; both align serialization with the canonical format.
Stacked on #21529 (contiguous header chain). Refs #21307, #20534.
pull Bot
pushed a commit
to Dustin4444/erigon
that referenced
this pull request
May 31, 2026
…gontech#21532) Two canonical-shape fixes: - `keys`: omitempty. Never populated, so it always serialized as `"keys": null`; canonical shape is `{state, codes, headers}`. - `headers`: emit ascending by block number (was descending). Order doesn't affect tests (multiset compare) and `keys` carries no data — serialization alignment only. Stacked on erigontech#21529. Refs erigontech#20534.
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.
headerscarried only the parent plus blocks hit directly by BLOCKHASH. A stateless verifier validates each header against the next one's parentHash, so it needs the contiguous chain from the parent back to the oldest accessed block. Fill[oldest_accessed .. parent].No-op when there's no BLOCKHASH gap.
Corpus (zkevm@v0.4.0): fixes 6 of 7
witness_headersfixtures; the 7th (extra_unused_older_ancestor) is a verifier-tolerance test a minimal producer can't match. Refs #20534.