Skip to content
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

Merged
merged 14 commits into from
Mar 21, 2024

Conversation

wen-coding
Copy link

  • Pass final result of aggregate RestartLastVotedForkSlots to next stage
  • Find the heaviest fork based on the information

@wen-coding wen-coding requested a review from AshwinSekar March 11, 2024 17:19
@wen-coding wen-coding self-assigned this Mar 11, 2024
@wen-coding wen-coding changed the title Find heaviest fork wen-restart: Find heaviest fork Mar 11, 2024
@carllin carllin self-requested a review March 12, 2024 03:39
wen-restart/src/wen_restart.rs Outdated Show resolved Hide resolved
wen-restart/src/wen_restart.rs Outdated Show resolved Hide resolved
wen-restart/src/last_voted_fork_slots_aggregate.rs Outdated Show resolved Hide resolved
wen-restart/src/last_voted_fork_slots_aggregate.rs Outdated Show resolved Hide resolved
wen-restart/src/last_voted_fork_slots_aggregate.rs Outdated Show resolved Hide resolved
wen-restart/src/wen_restart.rs Outdated Show resolved Hide resolved
wen-restart/src/wen_restart.rs Outdated Show resolved Hide resolved
wen-restart/src/wen_restart.rs Show resolved Hide resolved
wen-restart/src/wen_restart.rs Outdated Show resolved Hide resolved
wen-restart/src/wen_restart.rs Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 84.69388% with 45 lines in your changes are missing coverage. Please review.

Project coverage is 81.9%. Comparing base (cc3afa5) to head (d519d30).
Report is 25 commits behind head on master.

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     

@wen-coding wen-coding force-pushed the wen_restart_find_heaviest_fork branch from f40615e to 483d12d Compare March 14, 2024 05:37
@wen-coding wen-coding marked this pull request as draft March 14, 2024 18:03
@wen-coding wen-coding force-pushed the wen_restart_find_heaviest_fork branch from 2a69e5c to 834b34e Compare March 15, 2024 14:54
@wen-coding wen-coding marked this pull request as ready for review March 15, 2024 18:44
info!("block meta: {:?}", block_meta);
if block_meta.parent_slot != Some(expected_parent) {
info!(
"Block {} is not linked to expected parent {} but to {:?}",
Copy link

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

Copy link
Author

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) {
Copy link

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

Copy link
Author

@wen-coding wen-coding Mar 16, 2024

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.

Copy link

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?

Copy link
Author

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.

@wen-coding wen-coding requested a review from carllin March 20, 2024 16:09
@wen-coding wen-coding merged commit 11aa06d into anza-xyz:master Mar 21, 2024
37 checks passed
@wen-coding wen-coding deleted the wen_restart_find_heaviest_fork branch March 21, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants