rpc/jsonrpc: omit empty keys and order witness headers ascending#21532
Merged
Conversation
AskAlexSharov
approved these changes
May 31, 2026
lupin012
approved these changes
May 31, 2026
AskAlexSharov
pushed a commit
that referenced
this pull request
May 31, 2026
Return `headers` as RLP-encoded bytes instead of JSON header objects, matching the canonical witness format a stateless verifier consumes. Field type `[]map[string]any` → `[]hexutil.Bytes`; drops `marshalWitnessHeader`. Diverges from Geth's `debug_executionWitness` (header objects) — deliberate, the target is the canonical format. Corpus (zkevm@v0.4.0): header hashes match (RLP round-trips), 2846/2881, no regressions. Suite's `rpcHeaderHashes` switches to RLP decode with #21487. Stacked on #21532. Refs #20534.
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.
295f431 to
d90014f
Compare
Return `headers` as RLP-encoded bytes instead of JSON header objects, matching the canonical stateless-witness format (Reth compatibility). Field type `[]map[string]any` → `[]hexutil.Bytes`; drops `marshalWitnessHeader`. Diverges from Geth's `debug_executionWitness` (header objects) — deliberate; the target is Reth-canonical. Corpus (zkevm@v0.4.0): header hashes match (RLP round-trips), no regressions, no decode errors. Re-raise of the earlier #21537 (its branch was lost). Stacked on #21532. Refs #20534.
awskii
added a commit
that referenced
this pull request
Jun 1, 2026
main (#21532) changed ExecutionWitnessResult.Headers to []hexutil.Bytes (RLP-encoded). Update rpcHeaderHashes to RLP-decode like expectedHeaderHashes instead of reading a map["hash"] field.
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.
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
keyscarries no data — serialization alignment only.Stacked on #21529. Refs #20534.