Skip to content
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

Reth's stage-based sync format not supported, leads to NaN sync percentage #115

Open
segunjkf opened this issue Jan 6, 2025 · 0 comments

Comments

@segunjkf
Copy link

segunjkf commented Jan 6, 2025

Problem

The metrics exporter doesn't properly handle Reth's stage-based sync status format, resulting in sync percentage showing as NaN and incorrect sync blocks.

Current Output

When using Reth, the /metrics endpoint shows:

eth_exe_sync_current_block{ethereum_role="execution",module="sync",node_name="execution"} 0
eth_exe_sync_highest_block{ethereum_role="execution",module="sync",node_name="execution"} 0
eth_exe_sync_percentage{ethereum_role="execution",module="sync",node_name="execution"} NaN
eth_exe_sync_is_syncing{ethereum_role="execution",module="sync",node_name="execution"} 1

How to Reproduce

  • Run metrics exporter with Reth as execution client
  • Check eth_syncing RPC endpoint response from Reth:
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545

Reth returns stage-based format:

{
  "result": {
    "stages": [
      {
        "name": "Headers",
        "block": "0x2f22e5"  // Target block
      },
      {
        "name": "Bodies",
        "block": "0xbb418"   // Current progress
      },
      {
        "name": "Execution",
        "block": "0x0"
      }
    ]
  }
}
  • Observe that sync percentage shows as NaN in /metrics output

Additional Context

Reth also exposes sync progress via its own metrics:

prometheusCopyreth_sync_checkpoint{stage="Headers"} 3088189
reth_sync_checkpoint{stage="Execution"} 1011014

This could be an alternative data source for calculating sync progress.

Environment

  • ethereum-metrics-exporter: 0.26.0-debian
  • Reth: v1.1.4
  • Network: Holesky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant