erigon icon indicating copy to clipboard operation
erigon copied to clipboard

max_seconds_behind healthcheck shows latest block ts as "0"

Open mike-code opened this issue 2 years ago • 2 comments

Issue description

If I query the RPC endpoint to get the latest block, I'm getting correct response, but if I query the healthcheck endpoint, it reports that the timestamp of the latest block is 0. It should return a proper timestamp instead.

System information

Erigon version: erigon version 2.57.3 OS & Version: Arch Linux

Erigon Command (with flags/config):

/usr/bin/erigon \
    --chain=sepolia \
    --datadir=/mnt/storage/ansible-managed/ethereum/data \
    --ethash.dagdir=/mnt/storage/ansible-managed/ethereum/data \
    --http=true \
    --healthcheck=true \
    --sentinel.addr=127.0.0.1 \
    --http.addr=127.0.0.1 \
    --http.port=8545 \
    --http.vhosts "any" \
    --private.api.addr 127.0.0.1:8546 \
    --http.api=eth,erigon,engine,web3,net,txpool,trace \
    --authrpc.addr=127.0.0.1 \
    --authrpc.jwtsecret=/mnt/storage/ansible-managed/ethereum/jwt.hex \
    --authrpc.port=8551 \
    --metrics=true \
    --internalcl=false \
    --snapshots=true \
    --torrent.download.slots=4 \
    --torrent.download.rate=128mb \
    --torrent.upload.rate=4mb \
    --verbosity info \
    --rpc.batch.limit 1000 \
    --log.console.verbosity info

Consensus Layer: beacon-chain version Prysm/v4.2.1/59b310a2216c57fcf67ea0fdec739dad07aeec8b

Consensus Layer Command (with flags/config):

/usr/bin/prysm-beacon \
    --accept-terms-of-use \
    --sepolia \
    --checkpoint-sync-url https://beaconstate-sepolia.chainsafe.io \
    --genesis-beacon-api-url https://beaconstate-sepolia.chainsafe.io \
    --datadir "/mnt/storage/ansible-managed/prysm" \
    --execution-endpoint "http://127.0.0.1:8551" \
    --jwt-secret "/mnt/storage/ansible-managed/ethereum/jwt.hex" \
    --p2p-udp-port 12000 \
    --p2p-tcp-port 13000 \
    --rpc-port 4000 \
    --grpc-gateway-port 3500 \
    --monitoring-port 8090

Chain/Network: sepolia

Actual behaviour

❯ curl -X POST -i http://RPC -H 'content-type: application/json' --data-raw '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":"xyz"}'

{"jsonrpc":"2.0","id":"xyz","result":"0x4f4d43"}

❯ curl -XPOST -i http://RPC/health --header 'X-ERIGON-HEALTHCHECK: min_peer_count10' --header 'X-ERIGON-HEALTHCHECK: synced' --header 'X-ERIGON-HEALTHCHECK: max_seconds_behind60'

{"check_block":"DISABLED","max_seconds_behind":"ERROR: timestamp too old: got ts: 0, need: 1706787624","min_peer_count":"HEALTHY","synced":"HEALTHY"}

mike-code avatar Feb 01 '24 11:02 mike-code

Hi @mike-code , any updates on this? I ran into exactly the same problem on erigon v2.58.1 with lighthouse v5.0.0.

lelamaar avatar Mar 04 '24 19:03 lelamaar

Hi @mike-code , any updates on this? I ran into exactly the same problem on erigon v2.58.1 with lighthouse v5.0.0.

Nope. I just stopped using this healthcheck 🤷

mike-code avatar Mar 04 '24 19:03 mike-code

Fixed by PR #10131

yperbasis avatar May 20 '24 11:05 yperbasis