-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Loop over confirm_slot until no more entries or slot completed #28535
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1727,20 +1727,27 @@ impl ReplayStage { | |||||||
// All errors must lead to marking the slot as dead, otherwise, | ||||||||
// the `check_slot_agrees_with_cluster()` called by `replay_active_banks()` | ||||||||
// will break! | ||||||||
blockstore_processor::confirm_slot( | ||||||||
blockstore, | ||||||||
bank, | ||||||||
&mut w_replay_stats, | ||||||||
&mut w_replay_progress, | ||||||||
false, | ||||||||
transaction_status_sender, | ||||||||
Some(replay_vote_sender), | ||||||||
None, | ||||||||
verify_recyclers, | ||||||||
false, | ||||||||
log_messages_bytes_limit, | ||||||||
prioritization_fee_cache, | ||||||||
)?; | ||||||||
|
||||||||
let mut more_entries_to_process = true; | ||||||||
// more entries may have been received while replaying this slot. | ||||||||
// looping over this ensures that slots will be processed as fast as possible with the | ||||||||
// lowest latency. | ||||||||
while more_entries_to_process { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we might want some kind of exit out of here based on timing as a safe-guard. Otherwise we are potentially not voting for a long time or starting a leader slot which wouldn't be great. @carllin wdyt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i agree that'd be the safest thing to do, could limit to 400-ish ms. worst case exec takes longer than expected and we just hit another iteration of replay before hitting this again There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sleep may not be necessary, worst case we just hit one more iteration of reading from blockstore before returning here right: solana/ledger/src/blockstore_processor.rs Lines 1151 to 1153 in 0145447
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think sleep is the right word, more like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm yeah that works, should prevent bad leader from DOSing by continually streaming new shreds There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could even probably warn if it hits that timeout |
||||||||
more_entries_to_process = blockstore_processor::confirm_slot( | ||||||||
blockstore, | ||||||||
bank, | ||||||||
&mut w_replay_stats, | ||||||||
&mut w_replay_progress, | ||||||||
false, | ||||||||
transaction_status_sender, | ||||||||
Some(replay_vote_sender), | ||||||||
None, | ||||||||
verify_recyclers, | ||||||||
false, | ||||||||
log_messages_bytes_limit, | ||||||||
prioritization_fee_cache, | ||||||||
)?; | ||||||||
} | ||||||||
let tx_count_after = w_replay_progress.num_txs; | ||||||||
let tx_count = tx_count_after - tx_count_before; | ||||||||
Ok(tx_count) | ||||||||
|
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.
could do bank.is_complete here, but should've been picked up after-the-fact on the previous iteration and not marked for replay