besu icon indicating copy to clipboard operation
besu copied to clipboard

eth_syncing reports syncing when already at chain head

Open ajsutton opened this issue 4 years ago • 0 comments

Description

The eth_syncing API sometimes returns results like:

localhost:8546 [2]: {
  "jsonrpc" : "2.0",
  "id" : 11759,
  "result" : {
    "startingBlock" : "0x485abd",
    "currentBlock" : "0x485abe",
    "highestBlock" : "0x485abe"
  }
}

This suggests that the node is actually in sync (current block is the same as the highest block) but is reporting as still syncing. Either there's a race condition and the JSON-RPC handler checked if it was syncing first, the sync completed and then it got the head block or it's actually syncing a fork but incorrectly reporting the head block instead of where the sync is up to.

Frequency: [What percentage of the time does it occur?] Very rare - most often for an in-sync node it will either return false or be behind by a single block.

Versions (Add all that apply)

  • Software version: besu/v21.1.2/linux-x86_64/corretto-java-11
  • Java version: [java -version]
openjdk version "11.0.8" 2020-07-14 LTS
OpenJDK Runtime Environment Corretto-11.0.8.10.1 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.8.10.1 (build 11.0.8+10-LTS, mixed mode)

Additional Information

Low priority - the eth_syncing API is unfortunately pretty useless on all clients for actually determining if the node is suitably in sync since it will often return syncing while the latest block is being imported.

ajsutton avatar May 09 '21 22:05 ajsutton