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

Move more logic in blockstore_processor behind allow_dead_slots flag #2341

Merged
merged 2 commits into from
Jul 31, 2024
Merged
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
17 changes: 10 additions & 7 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,18 +1725,21 @@ fn process_next_slots(
blockstore: &Blockstore,
leader_schedule_cache: &LeaderScheduleCache,
pending_slots: &mut Vec<(SlotMeta, Bank, Hash)>,
halt_at_slot: Option<Slot>,
opts: &ProcessOptions,

Choose a reason for hiding this comment

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

don't love the name, but I know you're just maintaining the existing convention, so I'll hold my nose

) -> result::Result<(), BlockstoreProcessorError> {
if meta.next_slots.is_empty() {
return Ok(());
}

// This is a fork point if there are multiple children, create a new child bank for each fork
for next_slot in &meta.next_slots {
let skip_next_slot = halt_at_slot
.map(|halt_at_slot| *next_slot > halt_at_slot)
.unwrap_or(false);
if skip_next_slot {
if opts
.halt_at_slot
.is_some_and(|halt_at_slot| *next_slot > halt_at_slot)
{
continue;
}
if !opts.allow_dead_slots && blockstore.is_dead(*next_slot) {
continue;
}

Expand Down Expand Up @@ -1815,7 +1818,7 @@ fn load_frozen_forks(
blockstore,
leader_schedule_cache,
&mut pending_slots,
opts.halt_at_slot,
opts,
)?;

let on_halt_store_hash_raw_data_for_debug = opts.on_halt_store_hash_raw_data_for_debug;
Expand Down Expand Up @@ -1994,7 +1997,7 @@ fn load_frozen_forks(
blockstore,
leader_schedule_cache,
&mut pending_slots,
opts.halt_at_slot,
opts,
)?;
}
} else if on_halt_store_hash_raw_data_for_debug {
Expand Down