NethermindEth / juno

Starknet client implementation.
https://juno.nethermind.io
Apache License 2.0
402 stars 170 forks source link

Implement/investigate how to get sync_best_known_block_number metric in P2P mode #2162

Open wojciechos opened 2 months ago

wojciechos commented 2 months ago

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: