go-ethereum/eth
ozpool 238b160a67 internal/ethapi, eth, eth/catalyst: gate eth_syncing on CL handshake
eth_syncing currently returns false as soon as the local downloader
believes the chain to be done. On a freshly started node this happens
before the consensus client has talked to it: the persisted head loads
into memory, no CL handshake has occurred, the downloader sees nothing
to do, Progress.Done() is true, eth_syncing reports synced.

That is wrong from an operator perspective. Load balancers (HAProxy,
NGINX), L2 supervisors and multi-node setups commonly gate routing on
eth_syncing. They start sending live traffic to a node that has not
actually learned about any new head yet, which surfaces as missing
state, stale reads, and unhealthy upstreams.

Maintainer-endorsed direction in the issue thread: "default geth to
'syncing' on startup and only switch to 'synced' once we learn about
a new block".

Implement that with a sticky atomic.Bool on *Ethereum, set the first
time the consensus layer drives the node via the Engine API
(ForkchoiceUpdated or NewPayload), and consulted from eth_syncing.

  - eth/backend.go: add Ethereum.clContacted with
    MarkConsensusContacted/ConsensusContacted helpers
  - eth/catalyst/api.go: call MarkConsensusContacted at the same point
    where lastForkchoiceUpdate / lastNewPayloadUpdate are stamped, so
    the gate flips on every CL message regardless of the response
    status (handshake recorded even when we reply STATUS_SYNCING)
  - internal/ethapi/backend.go: add ConsensusContacted() to the Backend
    interface and to the two test mocks (api_test.go testBackend,
    transaction_args_test.go backendMock; both default to true so
    existing tests keep their original semantics)
  - eth/api_backend.go: implement ConsensusContacted on EthAPIBackend
  - internal/ethapi/api.go: in EthereumAPI.Syncing, only short-circuit
    to "false" when both progress.Done() AND ConsensusContacted() are
    true; otherwise return the progress map as during an active sync

Adds dedicated tests in internal/ethapi/syncing_test.go covering:
  - the new gate (Done but no CL contact -> truthy progress)
  - normal post-handshake behavior (Done + CL contact -> false)
  - active-sync behavior is unchanged regardless of the gate

Refs #33687.
2026-05-13 12:03:50 +05:30
..
catalyst internal/ethapi, eth, eth/catalyst: gate eth_syncing on CL handshake 2026-05-13 12:03:50 +05:30
downloader eth,node: replace the deprecated TypeMux with Feed (#32585) 2026-05-08 10:12:46 +08:00
ethconfig trie: group 2^N binary trie nodes in serialization (#34794) 2026-05-01 15:28:19 +02:00
fetcher Update eth/fetcher/tx_fetcher.go 2026-04-24 12:12:26 +02:00
filters eth/filters: return -32602 when exceeding the block range limit (#34647) 2026-04-08 12:57:29 +02:00
gasestimator core: use uint256 in core.Message (#34934) 2026-05-11 22:25:57 +08:00
gasprice cmd, core, trie, triedb: split CachingDB into merkle + binary dbs. (#34700) 2026-04-17 08:55:54 +08:00
protocols eth/protocols/eth: stop serving on unavailable responses (#34787) 2026-05-06 15:36:54 +02:00
syncer eth,node: replace the deprecated TypeMux with Feed (#32585) 2026-05-08 10:12:46 +08:00
tracers cmd, core, internal, miner: wrap pre/post-execution (#34812) 2026-05-11 16:17:48 -04:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go internal/ethapi, eth, eth/catalyst: gate eth_syncing on CL handshake 2026-05-13 12:03:50 +05:30
api_backend_test.go core/txpool: add eip2681 check for incoming transactions (#32726) 2025-09-25 13:15:12 +02:00
api_debug.go cmd, core, trie, triedb: split CachingDB into merkle + binary dbs. (#34700) 2026-04-17 08:55:54 +08:00
api_debug_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go internal/ethapi, eth, eth/catalyst: gate eth_syncing on CL handshake 2026-05-13 12:03:50 +05:30
dropper.go eth: fix panic in randomDuration when min equals max (#33193) 2025-11-19 01:54:53 +08:00
handler.go eth,node: replace the deprecated TypeMux with Feed (#32585) 2026-05-08 10:12:46 +08:00
handler_eth.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
handler_eth_test.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00
peer.go eth/protocols/eth: implement eth/69 (#29158) 2025-05-16 17:10:47 +02:00
peerset.go eth: stabilize tx relay peer selection (#31714) 2025-08-28 16:05:54 +02:00
state_accessor.go cmd, core, internal, miner: wrap pre/post-execution (#34812) 2026-05-11 16:17:48 -04:00
sync.go miner: add OpenTelemetry spans for block building path (#33773) 2026-03-16 19:24:41 +01:00
sync_test.go eth: implement EIP-7975 (eth/70 - partial block receipt lists) (#33153) 2026-03-30 15:17:37 +02:00