From e9a6bb35e2636275137fc47837f5afce4dbcf630 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 10 Jan 2024 18:16:56 -0500 Subject: [PATCH] Removes remaining unused accounts data len bits (#34732) --- program-runtime/src/invoke_context.rs | 2 -- program-runtime/src/message_processor.rs | 22 ++-------------------- runtime/src/bank.rs | 2 -- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/program-runtime/src/invoke_context.rs b/program-runtime/src/invoke_context.rs index 2122f7a74907d2..3ac29b5a58e841 100644 --- a/program-runtime/src/invoke_context.rs +++ b/program-runtime/src/invoke_context.rs @@ -185,7 +185,6 @@ impl<'a> InvokeContext<'a> { feature_set: Arc, blockhash: Hash, lamports_per_signature: u64, - _prev_accounts_data_len: u64, ) -> Self { Self { transaction_context, @@ -681,7 +680,6 @@ macro_rules! with_mock_invoke_context { Arc::new(FeatureSet::all_enabled()), Hash::default(), 0, - 0, ); }; } diff --git a/program-runtime/src/message_processor.rs b/program-runtime/src/message_processor.rs index f15bcda4a90fcb..a428cf930efeca 100644 --- a/program-runtime/src/message_processor.rs +++ b/program-runtime/src/message_processor.rs @@ -35,13 +35,6 @@ impl ::solana_frozen_abi::abi_example::AbiExample for MessageProcessor { } } -/// Resultant information gathered from calling process_message() -#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] -pub struct ProcessedMessageInfo { - /// The change in accounts data len - pub accounts_data_len_delta: i64, -} - impl MessageProcessor { /// Process a message. /// This method calls each instruction in the message over the set of loaded accounts. @@ -62,9 +55,8 @@ impl MessageProcessor { sysvar_cache: &SysvarCache, blockhash: Hash, lamports_per_signature: u64, - current_accounts_data_len: u64, accumulated_consumed_units: &mut u64, - ) -> Result { + ) -> Result<(), TransactionError> { let mut invoke_context = InvokeContext::new( transaction_context, sysvar_cache, @@ -75,7 +67,6 @@ impl MessageProcessor { feature_set, blockhash, lamports_per_signature, - current_accounts_data_len, ); debug_assert_eq!(program_indices.len(), message.instructions().len()); @@ -174,9 +165,7 @@ impl MessageProcessor { result .map_err(|err| TransactionError::InstructionError(instruction_index as u8, err))?; } - Ok(ProcessedMessageInfo { - accounts_data_len_delta: 0, // unused - }) + Ok(()) } } @@ -313,7 +302,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); assert!(result.is_ok()); @@ -363,7 +351,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); assert_eq!( @@ -403,7 +390,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); assert_eq!( @@ -533,7 +519,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); assert_eq!( @@ -567,7 +552,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); assert!(result.is_ok()); @@ -598,7 +582,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); assert!(result.is_ok()); @@ -686,7 +669,6 @@ mod tests { &sysvar_cache, Hash::default(), 0, - 0, &mut 0, ); diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 271acb151934bd..612f567ad9d2fb 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -4765,7 +4765,6 @@ impl Bank { log_messages_bytes_limit: Option, programs_loaded_for_tx_batch: &LoadedProgramsForTxBatch, ) -> TransactionExecutionResult { - let prev_accounts_data_len = self.load_accounts_data_size(); let transaction_accounts = std::mem::take(&mut loaded_transaction.accounts); fn transaction_accounts_lamports_sum( @@ -4827,7 +4826,6 @@ impl Bank { &self.sysvar_cache.read().unwrap(), blockhash, lamports_per_signature, - prev_accounts_data_len, &mut executed_units, ); process_message_time.stop();