Skip to content

Commit

Permalink
more clean up and enable local cluster test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Mar 3, 2025
1 parent 2523799 commit ee42538
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
1 change: 0 additions & 1 deletion local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5850,7 +5850,6 @@ fn test_randomly_mixed_block_verification_methods_between_bootstrap_and_not() {

#[test]
#[serial]
#[ignore]
fn test_randomly_mixed_block_production_methods_between_bootstrap_and_not() {
// tailored logging just to see two block production methods are working correctly
solana_logger::setup_with_default(
Expand Down
8 changes: 0 additions & 8 deletions unified-scheduler-logic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,14 +839,6 @@ impl SchedulingStateMachine {
transaction: RuntimeTransaction<SanitizedTransaction>,
index: usize,
usage_queue_loader: &mut impl FnMut(Pubkey) -> UsageQueue,
) -> Task {
Self::do_create_task(transaction, index, usage_queue_loader)
}

pub fn do_create_task(
transaction: RuntimeTransaction<SanitizedTransaction>,
index: usize,
usage_queue_loader: &mut impl FnMut(Pubkey) -> UsageQueue,
) -> Task {
// It's crucial for tasks to be validated with
// `account_locks::validate_account_locks()` prior to the creation.
Expand Down
24 changes: 13 additions & 11 deletions unified-scheduler-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ impl HandlerContext {
},
}
}

fn banking_stage_helper(&self) -> &BankingStageHelper {
self.banking_stage_helper.as_ref().unwrap()
}
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -322,7 +326,7 @@ impl BankingStageHelper {
transaction: RuntimeTransaction<SanitizedTransaction>,
index: usize,
) -> Task {
SchedulingStateMachine::do_create_task(transaction, index, &mut |pubkey| {
SchedulingStateMachine::create_task(transaction, index, &mut |pubkey| {
self.usage_queue_loader.load(pubkey)
})
}
Expand All @@ -335,9 +339,9 @@ impl BankingStageHelper {
self.do_create_task(transaction, index)
}

fn recreate_task(&self, task: Task) -> Task {
fn recreate_task(&self, executed_task: Box<ExecutedTask>) -> Task {
let new_index = self.generate_task_ids(1);
let transaction = task.into_transaction();
let transaction = executed_task.into_task().into_transaction();
self.do_create_task(transaction, new_index)
}

Expand Down Expand Up @@ -1008,7 +1012,7 @@ impl ExecutedTask {
})
}

fn into_inner(self) -> Task {
fn into_task(self) -> Task {
self.task
}
}
Expand Down Expand Up @@ -1717,9 +1721,7 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> {
if trigger_ending {
assert_matches!(scheduling_mode, BlockProduction);
session_ending = true;
let task = handler_context.banking_stage_helper.as_ref().unwrap().recreate_task(
executed_task.into_inner(),
);
let task = handler_context.banking_stage_helper().recreate_task(executed_task);
state_machine.buffer_task(task);
}
},
Expand Down Expand Up @@ -1773,9 +1775,7 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> {
if trigger_ending {
assert_matches!(scheduling_mode, BlockProduction);
session_ending = true;
let task = handler_context.banking_stage_helper.as_ref().unwrap().recreate_task(
executed_task.into_inner(),
);
let task = handler_context.banking_stage_helper().recreate_task(executed_task);
state_machine.buffer_task(task);
}
},
Expand Down Expand Up @@ -1831,7 +1831,7 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> {
runnable_task_sender
.send_chained_channel(&new_context, handler_count)
.unwrap();
if scheduling_mode == BlockVerification {
if matches!(scheduling_mode, BlockVerification) {
result_with_timings = new_result_with_timings;
break;
}
Expand All @@ -1849,6 +1849,8 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> {
}
Ok(NewTaskPayload::Unblock) => {
assert_matches!(scheduling_mode, BlockProduction);
// borrow checker won't allow us to do this inside OpenSubchannel
// to remove duplicate assignments...
result_with_timings = new_result_with_timings;
break;
}
Expand Down

0 comments on commit ee42538

Please sign in to comment.