diff --git a/core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs b/core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs index 54c5bd74f1107b..e9d7a9bbe9d71a 100644 --- a/core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs +++ b/core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs @@ -2,7 +2,9 @@ use { super::{ scheduler_metrics::{SchedulerCountMetrics, SchedulerTimingMetrics}, transaction_state::TransactionState, - transaction_state_container::{SharedBytes, StateContainer, TransactionViewStateContainer}, + transaction_state_container::{ + SharedBytes, StateContainer, TransactionViewState, TransactionViewStateContainer, + }, }, crate::{ banking_stage::{ @@ -460,8 +462,7 @@ impl TransactionViewReceiveAndBuffer { alt_resolved_slot: Slot, sanitized_epoch: Epoch, transaction_account_lock_limit: usize, - ) -> Result>>, ()> - { + ) -> Result { // Parsing and basic sanitization checks let Ok(view) = SanitizedTransactionView::try_new_sanitized(bytes) else { return Err(()); diff --git a/core/src/banking_stage/transaction_scheduler/transaction_state_container.rs b/core/src/banking_stage/transaction_scheduler/transaction_state_container.rs index bbd594e11f1f34..94aabd683f3f3a 100644 --- a/core/src/banking_stage/transaction_scheduler/transaction_state_container.rs +++ b/core/src/banking_stage/transaction_scheduler/transaction_state_container.rs @@ -202,12 +202,14 @@ impl TransactionStateContainer { } pub type SharedBytes = Arc>; +pub(crate) type RuntimeTransactionView = RuntimeTransaction>; +pub(crate) type TransactionViewState = TransactionState; /// A wrapper around `TransactionStateContainer` that allows re-uses /// pre-allocated `Bytes` to copy packet data into and use for serialization. /// This is used to avoid allocations in parsing transactions. pub struct TransactionViewStateContainer { - inner: TransactionStateContainer>>, + inner: TransactionStateContainer, bytes_buffer: Box<[SharedBytes]>, } @@ -216,12 +218,7 @@ impl TransactionViewStateContainer { pub(crate) fn try_insert_with_data( &mut self, data: &[u8], - f: impl FnOnce( - SharedBytes, - ) -> Result< - TransactionState>>, - (), - >, + f: impl FnOnce(SharedBytes) -> Result, ()>, ) -> bool { // Get remaining capacity before inserting. let remaining_capacity = self.remaining_capacity(); @@ -265,9 +262,7 @@ impl TransactionViewStateContainer { } } -impl StateContainer>> - for TransactionViewStateContainer -{ +impl StateContainer for TransactionViewStateContainer { fn with_capacity(capacity: usize) -> Self { let inner = TransactionStateContainer::with_capacity(capacity); let bytes_buffer = (0..inner.id_to_transaction_state.capacity()) @@ -299,8 +294,7 @@ impl StateContainer>> fn get_mut_transaction_state( &mut self, id: TransactionId, - ) -> Option<&mut TransactionState>>> - { + ) -> Option<&mut TransactionViewState> { self.inner.get_mut_transaction_state(id) } @@ -308,8 +302,7 @@ impl StateContainer>> fn get_transaction_ttl( &self, id: TransactionId, - ) -> Option<&SanitizedTransactionTTL>>> - { + ) -> Option<&SanitizedTransactionTTL> { self.inner.get_transaction_ttl(id) }