-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Better progress reporting for stage checkpoints #2982
Conversation
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Codecov Report
@@ Coverage Diff @@
## main #2982 +/- ##
==========================================
+ Coverage 71.04% 71.17% +0.13%
==========================================
Files 519 519
Lines 67318 68077 +759
==========================================
+ Hits 47824 48457 +633
- Misses 19494 19620 +126
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, next step is allowing stages to report progress in between commits, e.g. the execution/header/bodies stages could say how much they have processed every x seconds and not only when they commit (since these take a long time between commits)
} | ||
} | ||
|
||
// The function proceeds as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rewrite as doc comment so it shows up in tooltips etc
} | ||
} | ||
|
||
// The function proceeds as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shekhirin pls do in followup
crates/storage/db/src/tables/mod.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we/can we remove the SyncStageProgress
table, since the mid-block checkpointing info is now stored in SyncStage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, the Merkle stage still uses it for the execute checkpoints. We couldn't merge it into the SyncStage
straight away because it would force all the structs depending on StageCheckpoint
to be Clone
. It's not a breaking DB change to do it later because adding a new enum variant to StageUnitCheckpoint
is backward-compatible.
Main benefit is that progress reporting is now normalized for all stages by the cost unit for that stage. This allows better node CLI UX, % completion metrics etc. Next step would be better performance by normalizing the load on db commits.
We introduced two new metrics for sync:
reth_sync_entities_processed
andreth_sync_entities_total
. By dividing them, we can get a percentage progress for each stage.Headers
–processed
is the number of downloaded headers,total
is the number of total headers since genesis with respect to the known remote tip.Bodies
– reported as a block number, no change.SenderRecovery
–processed
is the number of entries in theTxSenders
table,total
is the number of entries in theTransactions
table.TotalDifficulty
– reported as a block number, no change.(Account|Storage)Hashing
–processed
is the number of entries in theHashed(Account|Storage)
table,total
is the number of entries in thePlain(Account|Storage)State
table.Index(Account|Storage)History
–processed
is the number of walked changesets,total
is the number of total changesets in the(Account|Storage)ChangeSet
table.Merkle
–processed
is the number of walked hashed accounts/storages,total
is the number of entries in theHashedAccount
andHashedStorage
tables.Execution
–processed
is the amount of gas executed,total
is the total amount of gas from headers.TransactionLookup
–processed
is the number of entries in theTxHashNumber
table,total
is the number of entries in theTransactions
table.Finish
– N/AWe also need to be careful with the situation when we do an initial sync using
Pipeline
, then keep up with the network usingBlockchainTree
, then do aPipeline
sync again, because we don't go through stages during theBlockchainTree
phase, hence no updates to checkpoint progresses is done beyond block numbers.Currently, the solution is for stages to be able to detect the validity of checkpoint according to block range with which it was last ran. If it's invalid, we recalculate the whole checkpoint progress or the missing part, comparing the block ranges.