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

vote: allow block_id to be None until new shred format is rolled out #3231

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,9 @@ impl Tower {
// `self.vote_state`
let block_id = bank.block_id().unwrap_or_else(|| {
// This can only happen for our leader bank
assert!(
*bank.collector_id() == self.node_pubkey,
"block_id must not be None for a frozen non-leader bank"
);
// Note: since the new shred format is yet to be rolled out to all clusters,
// this can also happen for non-leader banks. Once rolled out we can assert
// here that this is our leader bank.
Hash::default()
});
self.record_bank_vote_and_update_lockouts(
Expand Down
4 changes: 2 additions & 2 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3599,8 +3599,8 @@ impl ReplayStage {
// Here we don't have to check if this is our leader bank, as since we are adopting this bank,
// that means that it was created from a different instance (hot spare setup or a previous restart),
// and thus we must have replayed and set the block_id from the shreds.
bank.block_id()
.expect("block_id for an adopted bank cannot be None")
// Note: since the new shred format is not rolled out everywhere, we have to provide a default
bank.block_id().unwrap_or_default()
};
tower.update_last_vote_from_vote_state(
progress
Expand Down
Loading