Skip to content

Commit

Permalink
Removes remaining unused accounts data len bits (solana-labs#34732)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jan 10, 2024
1 parent 7ee9d9a commit e9a6bb3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
2 changes: 0 additions & 2 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ impl<'a> InvokeContext<'a> {
feature_set: Arc<FeatureSet>,
blockhash: Hash,
lamports_per_signature: u64,
_prev_accounts_data_len: u64,
) -> Self {
Self {
transaction_context,
Expand Down Expand Up @@ -681,7 +680,6 @@ macro_rules! with_mock_invoke_context {
Arc::new(FeatureSet::all_enabled()),
Hash::default(),
0,
0,
);
};
}
Expand Down
22 changes: 2 additions & 20 deletions program-runtime/src/message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<ProcessedMessageInfo, TransactionError> {
) -> Result<(), TransactionError> {
let mut invoke_context = InvokeContext::new(
transaction_context,
sysvar_cache,
Expand All @@ -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());
Expand Down Expand Up @@ -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(())
}
}

Expand Down Expand Up @@ -313,7 +302,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);
assert!(result.is_ok());
Expand Down Expand Up @@ -363,7 +351,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);
assert_eq!(
Expand Down Expand Up @@ -403,7 +390,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);
assert_eq!(
Expand Down Expand Up @@ -533,7 +519,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);
assert_eq!(
Expand Down Expand Up @@ -567,7 +552,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);
assert!(result.is_ok());
Expand Down Expand Up @@ -598,7 +582,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);
assert!(result.is_ok());
Expand Down Expand Up @@ -686,7 +669,6 @@ mod tests {
&sysvar_cache,
Hash::default(),
0,
0,
&mut 0,
);

Expand Down
2 changes: 0 additions & 2 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4765,7 +4765,6 @@ impl Bank {
log_messages_bytes_limit: Option<usize>,
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(
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e9a6bb3

Please sign in to comment.