|
@@ -34,7 +34,7 @@ use {
|
|
|
dyn_clone::{clone_trait_object, DynClone},
|
|
dyn_clone::{clone_trait_object, DynClone},
|
|
|
log::*,
|
|
log::*,
|
|
|
scopeguard::defer,
|
|
scopeguard::defer,
|
|
|
- solana_clock::Slot,
|
|
|
|
|
|
|
+ solana_clock::{Epoch, Slot},
|
|
|
solana_cost_model::cost_model::CostModel,
|
|
solana_cost_model::cost_model::CostModel,
|
|
|
solana_ledger::blockstore_processor::{
|
|
solana_ledger::blockstore_processor::{
|
|
|
execute_batch, TransactionBatchWithIndexes, TransactionStatusSender,
|
|
execute_batch, TransactionBatchWithIndexes, TransactionStatusSender,
|
|
@@ -387,11 +387,15 @@ impl BankingStageHelper {
|
|
|
transaction: RuntimeTransaction<SanitizedTransaction>,
|
|
transaction: RuntimeTransaction<SanitizedTransaction>,
|
|
|
task_id: OrderedTaskId,
|
|
task_id: OrderedTaskId,
|
|
|
consumed_block_size: BlockSize,
|
|
consumed_block_size: BlockSize,
|
|
|
|
|
+ sanitized_epoch: Epoch,
|
|
|
|
|
+ alt_invalidation_slot: Slot,
|
|
|
) -> Task {
|
|
) -> Task {
|
|
|
SchedulingStateMachine::create_block_production_task(
|
|
SchedulingStateMachine::create_block_production_task(
|
|
|
transaction,
|
|
transaction,
|
|
|
task_id,
|
|
task_id,
|
|
|
consumed_block_size,
|
|
consumed_block_size,
|
|
|
|
|
+ sanitized_epoch,
|
|
|
|
|
+ alt_invalidation_slot,
|
|
|
&mut |pubkey| self.usage_queue_loader.load(pubkey),
|
|
&mut |pubkey| self.usage_queue_loader.load(pubkey),
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -399,8 +403,16 @@ impl BankingStageHelper {
|
|
|
fn recreate_task(&self, executed_task: Box<ExecutedTask>) -> Task {
|
|
fn recreate_task(&self, executed_task: Box<ExecutedTask>) -> Task {
|
|
|
let new_task_id = self.regenerated_task_id(executed_task.task.task_id());
|
|
let new_task_id = self.regenerated_task_id(executed_task.task.task_id());
|
|
|
let consumed_block_size = executed_task.consumed_block_size();
|
|
let consumed_block_size = executed_task.consumed_block_size();
|
|
|
|
|
+ let sanitized_epoch = executed_task.sanitized_epoch();
|
|
|
|
|
+ let alt_invalidation_slot = executed_task.alt_invalidation_slot();
|
|
|
let transaction = executed_task.into_transaction();
|
|
let transaction = executed_task.into_transaction();
|
|
|
- self.create_new_task(transaction, new_task_id, consumed_block_size)
|
|
|
|
|
|
|
+ self.create_new_task(
|
|
|
|
|
+ transaction,
|
|
|
|
|
+ new_task_id,
|
|
|
|
|
+ consumed_block_size,
|
|
|
|
|
+ sanitized_epoch,
|
|
|
|
|
+ alt_invalidation_slot,
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub fn send_new_task(&self, task: Task) {
|
|
pub fn send_new_task(&self, task: Task) {
|
|
@@ -1045,6 +1057,15 @@ impl TaskHandler for DefaultTaskHandler {
|
|
|
bank.prepare_unlocked_batch_from_single_tx(transaction)
|
|
bank.prepare_unlocked_batch_from_single_tx(transaction)
|
|
|
}
|
|
}
|
|
|
BlockProduction => {
|
|
BlockProduction => {
|
|
|
|
|
+ if let Err(error) = bank.resanitize_transaction_minimally(
|
|
|
|
|
+ transaction,
|
|
|
|
|
+ task.sanitized_epoch(),
|
|
|
|
|
+ task.alt_invalidation_slot(),
|
|
|
|
|
+ ) {
|
|
|
|
|
+ *result = Err(error);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Due to the probable presence of an independent banking thread (like the jito
|
|
// Due to the probable presence of an independent banking thread (like the jito
|
|
|
// thread), we are forced to lock the addresses unlike block verification. The
|
|
// thread), we are forced to lock the addresses unlike block verification. The
|
|
|
// scheduling thread isn't appropriate for these kinds of work; so, instead do that
|
|
// scheduling thread isn't appropriate for these kinds of work; so, instead do that
|
|
@@ -1189,6 +1210,14 @@ impl ExecutedTask {
|
|
|
self.task.consumed_block_size()
|
|
self.task.consumed_block_size()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ fn sanitized_epoch(&self) -> Epoch {
|
|
|
|
|
+ self.task.sanitized_epoch()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ fn alt_invalidation_slot(&self) -> Slot {
|
|
|
|
|
+ self.task.alt_invalidation_slot()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
fn into_transaction(self) -> RuntimeTransaction<SanitizedTransaction> {
|
|
fn into_transaction(self) -> RuntimeTransaction<SanitizedTransaction> {
|
|
|
self.task.into_transaction()
|
|
self.task.into_transaction()
|
|
|
}
|
|
}
|
|
@@ -2775,7 +2804,9 @@ mod tests {
|
|
|
solana_system_transaction as system_transaction,
|
|
solana_system_transaction as system_transaction,
|
|
|
solana_transaction::sanitized::SanitizedTransaction,
|
|
solana_transaction::sanitized::SanitizedTransaction,
|
|
|
solana_transaction_error::TransactionError,
|
|
solana_transaction_error::TransactionError,
|
|
|
- solana_unified_scheduler_logic::NO_CONSUMED_BLOCK_SIZE,
|
|
|
|
|
|
|
+ solana_unified_scheduler_logic::{
|
|
|
|
|
+ MAX_ALT_INVALIDATION_SLOT, MAX_SANITIZED_EPOCH, NO_CONSUMED_BLOCK_SIZE,
|
|
|
|
|
+ },
|
|
|
std::{
|
|
std::{
|
|
|
num::Saturating,
|
|
num::Saturating,
|
|
|
sync::{Arc, RwLock},
|
|
sync::{Arc, RwLock},
|
|
@@ -4654,7 +4685,13 @@ mod tests {
|
|
|
transaction: RuntimeTransaction<SanitizedTransaction>,
|
|
transaction: RuntimeTransaction<SanitizedTransaction>,
|
|
|
task_id: OrderedTaskId,
|
|
task_id: OrderedTaskId,
|
|
|
) -> Task {
|
|
) -> Task {
|
|
|
- self.create_new_task(transaction, task_id, NO_CONSUMED_BLOCK_SIZE)
|
|
|
|
|
|
|
+ self.create_new_task(
|
|
|
|
|
+ transaction,
|
|
|
|
|
+ task_id,
|
|
|
|
|
+ NO_CONSUMED_BLOCK_SIZE,
|
|
|
|
|
+ MAX_SANITIZED_EPOCH,
|
|
|
|
|
+ MAX_ALT_INVALIDATION_SLOT,
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|