NethermindEth / NethermindEth/juno
Implement/investigate how to get sync_best_known_block_number metric in P2P mode
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 444
- Forks
- 244
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 78
Description
In P2P mode, the sync_best_known_block_number metric is currently returning 0, which is negatively impacting the calculation of the blocks_behind metric in Grafana. This issue makes it difficult to track the node’s sync status accurately, leading to incorrect reporting of sync progress.
While syncing from the feeder, we fetch the sync_best_known_block_number directly from the feeder. However, in P2P sync mode, we should determine the highest block height among all peers. As far as I know, there is currently no feature in the Starknet P2P specification that provides a direct way to retrieve the highest block number from peer.
Action Items:
-
Investigate how to set sync_best_known_block_number for P2P mode by considering the block heights from connected peers.
-
Check whether a feature to retrieve the highest block height from peers is supported or needs to be added to the Starknet P2P specification. How it works in Ethereum?
-
Ensure that the updated metric provides accurate information to Grafana, facilitating correct tracking of node sync progress.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Go implementation of sync_best_known_block_number in P2P sync and the code that exports blocks_behind to Grafana; the issue names no files or tests. Review the Starknet P2P specification and the existing feeder path, then determine a supported source for the highest peer block height. Done means the metric reports accurate P2P sync progress and is covered by relevant tests or validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, grafana
- Domain
- networking, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100