go-ethereum/miner
Barnabas Busa 73b84bb822 miner: supply a slot number when synthesising pending block post-Amsterdam
getPending builds the pending block on demand via generateWork, but after
EIP-7843 (#33589) prepareWork rejects the call unless generateParams.slotNum
is non-nil once Amsterdam is active:

    if miner.chainConfig.IsAmsterdam(header.Number, header.Time) {
        if genParams.slotNum == nil {
            return nil, errors.New("no slot number set post-amsterdam")
        }
        header.SlotNumber = genParams.slotNum
    }

getPending never populated slotNum, so on any Amsterdam-activated chain
eth_getBalance(addr, "pending") (and every other RPC that resolves through
the pending state) fails with "pending state is not available", breaking
faucets and nonce trackers that poll pending.

Fix by synthesising a slot number from the parent header when available,
mirroring how the Shanghai branch above already conditionally populates
withdrawals. The pending block is empty post-merge so the exact slot value
is not user-visible; SlotNumber+1 (or zero) is sufficient to satisfy the
prepareWork invariant.

Observed on a bal-devnet-3 Geth build: every eth_getBalance(...,"pending")
returned -32000 "pending state is not available" until the faucet was
repointed at a non-Geth EL. Other clients (Nethermind, Besu, Reth, Erigon,
Ethrex) serve pending on the same chain without issue.
2026-04-28 22:42:53 +02:00
..
stress core: implement eip-7778: block gas accounting without refunds (#33593) 2026-03-04 18:18:18 +08:00
miner.go miner: supply a slot number when synthesising pending block post-Amsterdam 2026-04-28 22:42:53 +02:00
miner_test.go cmd, core, trie, triedb: split CachingDB into merkle + binary dbs. (#34700) 2026-04-17 08:55:54 +08:00
ordering.go core/txpool, eth, miner: retrieve plain and blob txs separately (#29026) 2024-02-20 11:37:23 +02:00
ordering_test.go core/txpool, miner: speed up blob pool pending retrievals (#29008) 2024-02-19 15:59:40 +02:00
payload_building.go beacon/engine, miner: fix testing_buildBlockV1 response (#34704) 2026-04-13 13:45:35 +02:00
payload_building_test.go miner: add OpenTelemetry spans for block building path (#33773) 2026-03-16 19:24:41 +01:00
pending.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
worker.go core: apply fixes for BAL (claude) 2026-04-28 22:42:37 +02:00