-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth_syncing returns 'false' while Geth node is still syncing #25534
Comments
The |
I did one more testing this morning on Goerli. My Geth/Prysm was stopped overnight and restarted in the morning. Etherscan block height was at 7426914 when I started the testing. Please see below output from Geth JavaScript console. The eth.blockNumber showed the geth node was in syncing, while eth_syncing constantly returned false. Did I miss anything? $ geth attach /data/goerli/geth.ipc instance: Geth/v1.10.21-stable-67109427/linux-amd64/go1.18.4 To exit, press ctrl-d or type exit
|
Post merge there's a weird new quirk. If the beacon client tells us "hey, sync your chain to this new HEAD", then we will spin up a new sync cycle and do all the usual reportings. However, what usually happens is that the beacon client retrieves the (beacon) blocks 1 by 1, unpacks the payload and feeds it to us, 1 by 1. In that case, we're never really syncing, we're just receiving 1 new block each time, which we import. Perhaps we could (after the merge) visit this issue and extend the newpayload API to feed some more metadata from the beacon client to the execution so we might also know what's happening. |
According to ethereum/go-ethereum#25534, the `eth_syncing` check doesn't seem to reflect useful information for the node gateway: > The eth_syncing is set to true by the downloader, when it downloads the N blocks it needs from peers. If you have fallen behind, that can be a pretty quick thing. > Just because "a higher block exists somewhere", that doesn't mean eth_syncing becomes set to true. We look only at the local behaviour: are we in a sync-cycle? We've had this check cause flakes lately where a node is within the block lag limit, but it returns "syncing" so we stop routing requests to it. Relying on block lag only appears to be more accurate. Not deleting the relevant logic for now in case we decide we do want to re-enable it at some point in the near future.
According to ethereum/go-ethereum#25534, the `eth_syncing` check doesn't seem to reflect useful information for the node gateway: > The eth_syncing is set to true by the downloader, when it downloads the N blocks it needs from peers. If you have fallen behind, that can be a pretty quick thing. > Just because "a higher block exists somewhere", that doesn't mean eth_syncing becomes set to true. We look only at the local behaviour: are we in a sync-cycle? We've had this check cause flakes lately where a node is within the block lag limit, but it returns "syncing" so we stop routing requests to it. Relying on block lag only appears to be more accurate. Not deleting the relevant logic for now in case we decide we do want to re-enable it at some point in the near future.
System information
Geth version: 1.10.21-stable
OS & Version: Linux
Geth is paired with Prysm v2.1.4
Expected behaviour
While geth node is still syncing, eth_syncing API should return accurate syncing status with currentBlock and highestBlock info
Actual behaviour
eth_syncing returns 'false', while eth_blockNumber is still behind the latest block.
Steps to reproduce the behaviour
Stop Prysm/Geth to let the node behind the blockchain. Restart Prysm/Geth, curl eth_syncing and eth_blockNumber APIs.
We tested in both Goerli testnet and mainnet, and observed the same behavior. Is this an expected behavior post merge? If yes, what's the reliable mechanism to determine if Geth is fully in sync with the blockchain?
The text was updated successfully, but these errors were encountered: