go-ethereum/internal
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
..
blocktest crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323) 2026-02-03 14:55:27 -07:00
build .gitea, build: cross-compile windows binaries (#34889) 2026-05-08 15:18:24 +02:00
cmdtest cmd/geth, internal: fix flaky console tests (#31784) 2025-05-08 15:15:36 +02:00
debug internal/debug: add integration with Grafana Pyroscope (#33623) 2026-01-20 10:33:09 +01:00
download internal/download: close dst on io.Copy error (#34910) 2026-05-10 13:43:40 +02:00
era internal/era/onedb: return false if err (#34816) 2026-05-01 14:10:41 +02:00
ethapi internal/ethapi, eth, eth/catalyst: gate eth_syncing on CL handshake 2026-05-13 12:03:50 +05:30
flags internal/flags: update copyright year to 2026 (#33550) 2026-01-08 11:49:13 +08:00
guide all: fix typos in docs and comments (#31548) 2025-04-02 13:52:40 -06:00
jsre internal/jsre: pass correct args to setTimeout/setInterval callbacks (#32936) 2025-10-28 12:34:14 +01:00
reexec internal/reexec: fix broken link to Docker/Moby in comment (#31859) 2025-05-20 15:58:00 +08:00
shutdowncheck eth, les: update unclean shutdown markers regularly (#24077) 2021-12-17 15:18:51 +01:00
syncx core: improve shutdown synchronization in BlockChain (#22853) 2021-10-07 15:47:50 +02:00
tablewriter cmd/geth: add inspect trie tool to analysis trie storage (#28892) 2026-02-24 10:56:00 -07:00
telemetry internal/telemetry: add gRPC transport for OTLP trace export (#33941) 2026-04-21 14:48:21 +02:00
testlog internal/testlog: fix log output from sub-loggers (#31539) 2025-04-10 18:21:32 +02:00
testrand triedb/pathdb: improve tests (#29278) 2024-03-19 10:50:08 +08:00
utesting internal: run tests in parallel (#30381) 2024-09-16 08:44:47 +02:00
version build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
web3ext cmd, core, eth, tests: prevent state flushing in RPC (#33931) 2026-03-04 14:40:45 +08:00