Files
Antje WorringandHanzo Dev e656eb9cf7 fix(ethapi): emit withdrawalsRoot/requestsHash; make genesis block round-trip
Under all-upgrades-active (Shanghai+), the genesis header carries a
WithdrawalsHash that is part of the canonical (geth-standard) header
hash, but RPCMarshalHeader never emitted withdrawalsRoot — so a client
that decoded the genesis block's JSON-RPC form recomputed a different
hash, breaking eth_* consumers and fork-at-genesis.

Also: extDataHash is an optional RLP field of the Lux header (Pos 16,
part of the hash). The genesis header has none (nil), but the marshaler
unconditionally emitted a zero extDataHash, so a decoded genesis header
carried a non-nil ExtDataHash and hashed differently.

Bring header marshaling current with modern Ethereum:
- emit withdrawalsRoot when WithdrawalsHash != nil (EIP-4895 / Shanghai)
- emit extDataHash only when present (matches the canonical RLP; genesis
  omits it)
- emit requestsHash when present (EIP-7685 / Prague), matching upstream geth

Now the genesis block's JSON-RPC representation round-trips to the same
hash. Verified by ethclient/simulated TestFork/TestForkResendTx, which
now fork at the *client-decoded* genesis hash (workaround removed).
Regenerated the affected genesis/block-0 golden files. Full suite 52/52.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-06 22:59:15 -07:00
..