Skip to content

debug_trace*: emit struct-log refund and returnData fields #12057

Description

@manusw7

Is your feature request related to a problem? Please describe.
After #12056 aligned the default debug_trace* opcode (struct) tracer with execution-apis#762, two optional struct-log fields are still not emitted, leaving Nethermind short of the geth/Besu/Erigon/Reth default output:

  • refund — the accumulated gas-refund counter per step (others emit it when non-zero). This is the one field where Nethermind still diverges from the cross-client default.
  • returnData — per-step return data (others emit it only when enableReturnData is set; off by default, so omission is currently conformant).

Describe the solution you'd like
Emit both in the streaming (GethLikeTxDirectStreamingTracer) and in-memory (GethLikeTxMemoryTracer) tracers:

  • refund: include when non-zero, as the cumulative refund counter at each step (matching geth's pre-op GetRefund()).
  • returnData: include only when the enableReturnData flag is set.

Describe alternatives you've considered
Both fields are optional in execution-apis#762, so omitting them is spec-conformant — but emitting refund would match the cross-client majority.

Additional context
Deferred from #12056 because Nethermind exposes only per-op refund deltas via ReportRefund (no cumulative counter, no roll-back on reverted frames) and no per-step return-data buffer at the op-level hook, so both need EVM plumbing to implement correctly. Reference: go-ethereum eth/tracers/logger/logger.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions