client: only report block import to telemetry if new best#3548
client: only report block import to telemetry if new best#3548andresilva merged 4 commits intomasterfrom
Conversation
|
cc @maciejhirsz |
|
So we will only see finalized blocks? And will not be able to see if finalization or block production is stalled? |
maciejhirsz
left a comment
There was a problem hiding this comment.
LGTM as well.
@bkchr telemetry UI has both best block and finalized block, you might have to enable the relevant columns in the settings if you want to see both numbers / hashes for all nodes.
Yeah I know, but I meant something different. However, I finally looked into the code and found the answer to my question. |
|
@bkchr No, this means that we'll only report to telemetry when we import something that is a new best block (regardless of finality). E.g. with longest chain fork choice rule we will always report to telemetry every time we import a block whose number is higher than the previous best, but e.g. if we import two distinct blocks #10 only one of those will be considered to be a "best" block and therefore we won't report the other one to telemetry. It also means that whenever we import blocks from a different fork we only report to telemetry if we actually re-org (which makes sense to me). |
* client: only report block import to telemetry if new best * grandpa: fix tests * consensus: derive Default for ImportedAux * network: fix test
…#3548) * client: only report block import to telemetry if new best * grandpa: fix tests * consensus: derive Default for ImportedAux * network: fix test
Fixes paritytech/substrate-telemetry#175.
Right now we always report to telemetry when we import a new block. Telemetry assumes that this is the new best block which may not be true (we sync all forks we see). This leads the telemetry UI to show more "re-orgs" than actually exist, and also to always show the highest block number for a peer (instead of best). After this PR telemetry UI should always show the latest block notified by the peer (regardless of number), since that it will always be the best block.