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: play unfrozen block #4626

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

wen-coding
Copy link

Sometimes blocks may be in bank_forks but not frozen yet before the restart, need to replay them.

carllin
carllin previously approved these changes Jan 24, 2025
Comment on lines 622 to 631
let bank_with_scheduler = if let Some(bank) = saved_bank {
bank
} else {
let new_bank = Bank::new_from_parent(
parent_bank.clone(),
&leader_schedule_cache
.slot_leader_at(slot, Some(&parent_bank))
.unwrap(),
slot,
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe simpler to do

let bank_with_scheduler = saved_bank.unwrap_or_else(|| {
    let leader = leader_schedule_cache
        .slot_leader_at(slot, Some(&parent_bank))
        .expect("Failed to get slot leader");

    Bank::new_from_parent(&parent_bank, &leader, slot)
});

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, ready for another look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants