prysmaticlabs / prysm

Go implementation of Ethereum proof of stake
https://www.offchainlabs.com
GNU General Public License v3.0
3.44k stars 981 forks source link

eth/v1/node/syncing endpoint returns wrong value #14226

Open eenagy opened 1 month ago

eenagy commented 1 month ago

Describe the bug

Prysm returns true for el_offline after el connected, this should be false.

Has this worked before in a previous version?

Not sure.

🔬 Minimal Reproduction

  1. Start any el client
    besu  --rpc-http-enabled --data-path=$HOME/.run-a-node/sepolia --network=SEPOLIA --engine-jwt-secret=$HOME/.run-a-node/sepolia/jwt.hex --rpc-http-api=ETH --rpc-http-port=8545
  2. Start prysm
    beacon-chain  --accept-terms-of-use --sepolia --datadir=$HOME/.run-a-node/sepolia --checkpoint-sync-url=https://beaconstate-sepolia.chainsafe.io --disable-grpc-gateway=false --execution-endpoint=http://localhost:8551 --genesis-beacon-api-url=https://beaconstate.info --grpc-gateway-port=5052 --http-modules=eth --jwt-secret=$HOME/.run-a-node/sepolia/jwt.hex
  3. Wait until you see the message the Connected to new endpoint endpoint=http://localhost:8551
  4. Check for status
    curl -s -X GET -H Content-Type: application/json http://localhost:5052/eth/v1/node/syncing

    See that the el_offline is true instead of false

    {"data":{"head_slot":"5450336","sync_distance":"131","is_syncing":true,"is_optimistic":false,"el_offline":true}}

For this test, I have included besu, but same result with erigon/geth/nethermind/reth. All other CL client will return false when EL is connected.

Error

No response

Platform(s)

Linux (x86)

What version of Prysm are you running? (Which release)

beacon-chain version Prysm/v5.0.4/3b184f43c86baf6c36478f65a5113e7cf0836d41. Built at: 2024-06-21 00:26:00+00:00

Anything else relevant (validator index / public key)?

No response

james-prysm commented 1 month ago

I don't believe this is a bug, it'll return "el_offline":true if it's not synced to head. if the execution client returns any errors it'll retry and the endpoint will return "el_offline":true

eenagy commented 1 month ago

According to the specs, this looks like a bug: Beacon Node Syncing Endpoint.

I've tested this endpoint with several clients before reporting it. lighthouse, lodestar, nimbus-eth2, and teku all report true initially, then false; however, prysm seems inconsistent with the other clients.

I have a work-in-progress branch where I test client configs against each other; if that helps, please check it out.

james-prysm commented 1 month ago

perhaps other clients are returning false when it's syncing? will followup with my teammate

eenagy commented 1 month ago

@james-prysm I don't think the sync status has anything to do with el_offline. All other clients initially return (true) then when execution client is connected they return false. If you disconnect (shut down the client), they change the status back to true. I'm basing this on what I see happening when values are returned.