-
Notifications
You must be signed in to change notification settings - Fork 239
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
wen-restart: Find heaviest fork #183
wen-restart: Find heaviest fork #183
Conversation
wen-coding
commented
Mar 11, 2024
- Pass final result of aggregate RestartLastVotedForkSlots to next stage
- Find the heaviest fork based on the information
stage and find the heaviest fork we will Gossip to others.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #183 +/- ##
========================================
Coverage 81.9% 81.9%
========================================
Files 837 837
Lines 226823 227084 +261
========================================
+ Hits 185828 186068 +240
- Misses 40995 41016 +21 |
f40615e
to
483d12d
Compare
2a69e5c
to
834b34e
Compare
wen-restart/src/wen_restart.rs
Outdated
info!("block meta: {:?}", block_meta); | ||
if block_meta.parent_slot != Some(expected_parent) { | ||
info!( | ||
"Block {} is not linked to expected parent {} but to {:?}", |
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: Block in blockstore is not linked to expected parent from Wen Restart {} but to
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.
Done.
} | ||
if let Ok(Some(block_meta)) = blockstore.meta(slot) { | ||
info!("block meta: {:?}", block_meta); | ||
if block_meta.parent_slot != Some(expected_parent) { |
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.
Hmmm if you start with a really old root N
and everyone else's root is at N + 1000
, are you guaranteed to have gotten all the slots between your root and everyone else's root through the aggregation phase?
Seems like it's not guaranteed if people didn't gossip the older slots in their last voted forks
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.
We always send back (last_vote - 64k, last_vote), it may include the local root and slots older than local root. So yes you should see N to N+1000 in the RestartLastVotedForkSlots and you will aggregate those.
The number of slots may be less than 64k, depending on how much we can fit in one UDP packet, but it's definitely more than 1000.
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.
Mayeb a custom error message would be good here if the only mismatch is on the root? Say that this means potentially we don't have enough ancestors or your root is too old?
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.
Sure, I think an error log on first mismatch being on root is useful. But not sure we need the error log when the root mismatch is the only error, because even if the list is screwed up we might want to print root mismatch, changed.