Summary
execution-apis#762 (merged) standardizes the default opcode (struct) logger output for debug_traceTransaction, debug_traceBlockByNumber, and debug_traceBlockByHash. It is a spec + conformance-test standardization (not a hard fork), but we have a few small divergences worth aligning for cross-client conformance.
Nethermind already approved the spec direction in review (no concerns beyond reexec, which was dropped), and the streaming/field-order concern raised there is already covered by #11693.
Alignments / fixes needed
| # |
Spec (#762) |
Current Nethermind |
Fix |
| 1 |
error absent when no error occurred |
Always emits "error": null — GethTxTraceEntry.cs uses [JsonIgnore(Condition = JsonIgnoreCondition.Never)] |
Change to WhenWritingNull |
| 2 |
storage emitted only at SLOAD/SSTORE, absent (not {}) otherwise |
Cumulative snapshot copied onto every opcode entry (GethLikeTxMemoryTracer.StartOperation) → emits "storage":{} on non-SLOAD/SSTORE ops |
Attach Storage only at SLOAD/SSTORE; omit when empty |
| 3 |
memory words 0x-prefixed bytes32 |
No 0x prefix — TraceMemory.ToHexWordList() uses ToHexString() (default withZeroX:false) |
ToHexString(true) — need to check geth behaviour |
| 4 |
storage keys/values 0x-prefixed bytes32 |
No 0x prefix — GethLikeTxMemoryTracer.SetOperationStorage uses ToHexString(false) |
ToHexString(true) — need to check geth behaviour |
Already compliant (no change): stack encoding (0x-prefixed canonical uint256), top-level field names (gas/failed/returnValue/structLogs), integer gas/gasCost, op as opcode-name string, block-trace { txHash, result } pairing.
Scope
This issue covers the opcode-tracer wire-format alignment only. The error-path conformance cases that execution-apis#762 also ships are tracked/handled separately:
Suggested sequencing
- Solve 1-4.
- Port the conformance cases shipped in #762 (
tests/debug_trace*) into the rpc-tests integration suite once the output aligns, including debug_traceBlockByHash coverage for the new txHash/result pairing.
Out of scope (tracked upstream, deferred from #762)
- Memory-trace size optimization (
enableMemory, memoryMode: none|full|onChange) — real issue (mainnet blocks producing hundreds of GiB of JSON) but a separate future PR.
gasCost accounting redesign for CALL (no client implements the "sum equals gas used" proposal).
Refs: ethereum/execution-apis#762, #11693
Summary
execution-apis#762 (merged) standardizes the default opcode (struct) logger output for
debug_traceTransaction,debug_traceBlockByNumber, anddebug_traceBlockByHash. It is a spec + conformance-test standardization (not a hard fork), but we have a few small divergences worth aligning for cross-client conformance.Nethermind already approved the spec direction in review (no concerns beyond
reexec, which was dropped), and the streaming/field-order concern raised there is already covered by #11693.Alignments / fixes needed
errorabsent when no error occurred"error": null—GethTxTraceEntry.csuses[JsonIgnore(Condition = JsonIgnoreCondition.Never)]WhenWritingNullstorageemitted only at SLOAD/SSTORE, absent (not{}) otherwiseGethLikeTxMemoryTracer.StartOperation) → emits"storage":{}on non-SLOAD/SSTORE opsStorageonly at SLOAD/SSTORE; omit when empty0x-prefixedbytes320xprefix —TraceMemory.ToHexWordList()usesToHexString()(defaultwithZeroX:false)ToHexString(true)— need to check geth behaviour0x-prefixedbytes320xprefix —GethLikeTxMemoryTracer.SetOperationStorageusesToHexString(false)ToHexString(true)— need to check geth behaviourAlready compliant (no change): stack encoding (
0x-prefixed canonical uint256), top-level field names (gas/failed/returnValue/structLogs), integergas/gasCost,opas opcode-name string, block-trace{ txHash, result }pairing.Scope
This issue covers the opcode-tracer wire-format alignment only. The error-path conformance cases that execution-apis#762 also ships are tracked/handled separately:
debug_traceBlockByHash/debug_traceBlockByNumber) →debug_traceBlockByHash/debug_traceBlockByNumberreturns[]for genesis block instead of an error #12038 / add error in debug_traceBlock* if block is genesis #12039 (out of scope here).Suggested sequencing
tests/debug_trace*) into the rpc-tests integration suite once the output aligns, includingdebug_traceBlockByHashcoverage for the newtxHash/resultpairing.Out of scope (tracked upstream, deferred from #762)
enableMemory,memoryMode: none|full|onChange) — real issue (mainnet blocks producing hundreds of GiB of JSON) but a separate future PR.gasCostaccounting redesign forCALL(no client implements the "sum equals gas used" proposal).Refs: ethereum/execution-apis#762, #11693