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

Merged

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

@wen-coding wen-coding requested a review from carllin January 27, 2025 18:20
@wen-coding wen-coding merged commit 1d77f88 into anza-xyz:master Jan 30, 2025
47 checks passed
@wen-coding wen-coding deleted the wen_restart_play_unfrozen_block branch January 30, 2025 20:37
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.

2 participants