Skip to content

eth/tracers: port the upstream supply tracer end-to-end tests #2904

Open

Description

@gzliudan

Found while reviewing #2833 (the EIP-8246 selfdestruct-burn fix for #2832). This tree never ported go-ethereum's supply live-tracer end-to-end tests: upstream has eth/tracers/internal/tracetest/supply_test.go since the tracer landed (go-ethereum ethereum#29347, c9e0b3105b), while this tree only has the hook-level table tests added by #2833 in eth/tracers/live/supply_test.go.

core/state/statedb_hooked_test.go:31 still points at the missing test:

// (There is also a higher-level test in eth/tracers: TestSupplySelfDestruct )

Scope

Port TestSupplySelfdestruct and TestSupplySelfdestructItselfAndRevert - the two cases that drive burn.misc end to end - to eth/tracers/internal/tracetest/supply_test.go, adapted to this tree, plus the issuance/fee cases (TestSupplyOmittedFields, TestSupplyGenesisAlloc, TestSupplyEip1559Burn, TestSupplyWithdrawals) as far as this tree supports them (there are no beacon withdrawals here).

Blockers (verified while planning the port)

  1. No beacon merge. core.BlockGen has no SetPoS() (core/chain_makers.go), and there is no core.SystemContractAllocs(). Upstream's tests depend on both (b.SetPoS(), Alloc: core.SystemContractAllocs()).
  2. Different constructor. Here core.NewBlockChain(db, cacheConfig, genesis, engine, vmConfig); upstream uses core.NewBlockChain(db, genesis, engine, options). The tracer is attached through vm.Config{Tracer: hooks}.
  3. Legacy SELFDESTRUCT is unreachable. enable6780 replaces the shared jump-table slot, so opSelfdestruct never executes even with CancunBlock == nil (established while working on fix(core/state,eth/tracers): report the selfdestruct burn from the state layer #2870). Upstream's pre-Cancun expectations (Misc = 5 gwei in TestSupplySelfdestruct; Misc = 5 ETH with B's balance ending at zero in TestSupplySelfdestructItselfAndRevert) cannot be reproduced here, so the expected values and the state assertions have to be recomputed under 6780-only semantics.
  4. Missing helpers. eth/tracers/internal/tracetest has neither testSupplyTracer (chain generation plus tracer output scrape) nor compareAsJSON; both have to be added (~50 lines) together with the two contract bytecode blobs the selfdestruct cases use.

Why a separate change

#2833 only needed hook-level coverage for the EIP-8246 accounting, and the end-to-end expectations will shift again once #2870 (state-layer burn accounting) lands. Adding the port there would have meant rewriting it inside an already reviewed PR.

Acceptance

  • eth/tracers/internal/tracetest/supply_test.go exists and go test ./eth/tracers/internal/tracetest/ -run TestSupply -count=1 passes.
  • Expectations that diverge from upstream carry a comment explaining why (6780-only selfdestruct, no PoS, no withdrawals).
  • The stale reference in core/state/statedb_hooked_test.go is updated or removed.

References

Activity

  1. self-assigned this
    on Oct 29, 2026
  2. added 3 commits that reference this issue on Oct 30, 2026
    0cdc19f
    73c7472
    f281cb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions