fix(t8n): serialize receipt root/status as mutually exclusive - #12867
Open
hudem1 wants to merge 1 commit into
Open
fix(t8n): serialize receipt root/status as mutually exclusive#12867hudem1 wants to merge 1 commit into
hudem1 wants to merge 1 commit into
Conversation
…tConverter Per EIP-658, a receipt carries either a post-state `root` (pre-Byzantium) or a `status` code (post-Byzantium), never both. `TxReceiptConverter.Write` emitted both unconditionally, defaulting `root` to the zero hash when absent. This diverges from the receipt schema in ethereum/execution-apis (where `root` and `status` are optional and conditional) and from go-ethereum's marshalReceipt, which emits exactly one. The DTO path (ReceiptForRpc), used by eth_getTransactionReceipt, eth_getBlockReceipts, parity_getBlockReceipts and proof_getTransactionReceipt, was already correct via JsonIgnoreCondition.WhenWritingNull; this aligns the standalone converter with it. Refs #12835. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hudem1
requested review from
LukaszRozmej,
benaadams,
smartprogrammer93 and
svlachakis
as code owners
August 18, 2026 07:05
batrr
approved these changes
Aug 18, 2026
AnkushinDaniil
approved these changes
Aug 18, 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.
Refs #12835 (partial — see below)
Changes
TxReceiptConverter.Writenow emits either the post-stateroot(pre-Byzantium, whenreceipt.Rootis set) or thestatuscode (post-Byzantium), instead of always writing both withrootdefaulting to the zero hash. This matches EIP-658, the receipt schema inethereum/execution-apis, and go-ethereum'smarshalReceipt.Context
Issue #12835 reports (auto-generated) that many JSON-RPC fields serialize as
nullwhile the docs type them as non-null. After comparing each item against the spec (ethereum/execution-apis) and go-ethereum, 11 of the 12 items are not defects — thenullvalues are intentional and spec-/Geth-conformant (pending blocks/transactions,to: nullfor contract creation, conditional trace fields). Those are at most a docs-site annotation matter and are not addressed here.The one genuine code-level finding is the receipt
root/statushandling, and even there the user-facing JSON-RPC methods (eth_getTransactionReceipt,eth_getBlockReceipts,parity_getBlockReceipts,proof_getTransactionReceipt) were already correct: they serialize theReceiptForRpcDTO, which omits the null field viaJsonIgnoreCondition.WhenWritingNull.TxReceiptConverteris the standalone converter for bareTxReceipt, used by the t8n tool (tools/Evm/T8n). It emitted bothrootandstatus, so t8nresult.receiptscarried a spurious"root":"0x00…00"alongside"status"for post-Byzantium receipts (t8n forcesPostTransactionState = nullfor successful txs). This PR aligns that output with Geth'sevm t8n. No JSON-RPC response changes.Types of changes
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Added
Post_byzantium_receipt_serializes_status_without_rootandPre_byzantium_receipt_serializes_root_without_statusinReceiptsForRpcTests. FullReceiptsForRpcTestsandTransactionReceiptsSubscriptionsuites pass.Documentation
Requires documentation update
Requires explanation in Release Notes
Remarks
Scope is intentionally limited to the t8n output path; the remaining #12835 items are behavior-correct and, where actionable, belong in the docs repo (docs are auto-generated via
tools/DocGen).