-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
let best_block = io.chain().chain_info().best_block_number; | ||
// Make sure the snapshot block is not too far away from our best block, network best block and | ||
// fork detection block | ||
let mut best_block = max(io.chain().chain_info().best_block_number, self.highest_block.unwrap_or(0)); |
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.
isn't highest_block
the highest block we've seen broadcasted? how will the check for sn - best_block > SNAPSHOT_RESTORE_THRESHOLD
ever pass?
.filter(|&(_, p)| p.is_allowed() && p.snapshot_number.map_or(false, |sn| | ||
our_best_block < sn && (sn - our_best_block) > SNAPSHOT_RESTORE_THRESHOLD && | ||
sn > fork_block && | ||
self.highest_block.map_or(true, |highest| highest >= sn && (highest - sn) > SNAPSHOT_RESTORE_THRESHOLD) |
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.
won't this prevent the most recent snapshot from ever being used? This is basically requiring that whatever snapshot is chosen is at least 100k blocks 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.
is it a typo? <
would make sense here
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.
I need to get some sleep
* Additional snapshot sync checks * Proper checks * Proper highset block check
* Additional snapshot sync checks * Proper checks * Proper highset block check
No description provided.