Skip to content

Commit

Permalink
Removes programs_updated_only_for_global_cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Nov 15, 2023
1 parent 2831115 commit 1f70c9e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 35 deletions.
1 change: 0 additions & 1 deletion accounts-db/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,6 @@ mod tests {
accounts_data_len_delta: 0,
},
programs_modified_by_tx: Box::<LoadedProgramsForTxBatch>::default(),
programs_updated_only_for_global_cache: Box::<LoadedProgramsForTxBatch>::default(),
}
}

Expand Down
1 change: 0 additions & 1 deletion accounts-db/src/transaction_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub enum TransactionExecutionResult {
Executed {
details: TransactionExecutionDetails,
programs_modified_by_tx: Box<LoadedProgramsForTxBatch>,
programs_updated_only_for_global_cache: Box<LoadedProgramsForTxBatch>,
},
NotExecuted(TransactionError),
}
Expand Down
5 changes: 0 additions & 5 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ pub struct InvokeContext<'a> {
accounts_data_meter: AccountsDataMeter,
pub programs_loaded_for_tx_batch: &'a LoadedProgramsForTxBatch,
pub programs_modified_by_tx: &'a mut LoadedProgramsForTxBatch,
pub programs_updated_only_for_global_cache: &'a mut LoadedProgramsForTxBatch,
pub feature_set: Arc<FeatureSet>,
pub timings: ExecuteDetailsTimings,
pub blockhash: Hash,
Expand All @@ -185,7 +184,6 @@ impl<'a> InvokeContext<'a> {
compute_budget: ComputeBudget,
programs_loaded_for_tx_batch: &'a LoadedProgramsForTxBatch,
programs_modified_by_tx: &'a mut LoadedProgramsForTxBatch,
programs_updated_only_for_global_cache: &'a mut LoadedProgramsForTxBatch,
feature_set: Arc<FeatureSet>,
blockhash: Hash,
lamports_per_signature: u64,
Expand All @@ -201,7 +199,6 @@ impl<'a> InvokeContext<'a> {
accounts_data_meter: AccountsDataMeter::new(prev_accounts_data_len),
programs_loaded_for_tx_batch,
programs_modified_by_tx,
programs_updated_only_for_global_cache,
feature_set,
timings: ExecuteDetailsTimings::default(),
blockhash,
Expand Down Expand Up @@ -688,15 +685,13 @@ macro_rules! with_mock_invoke_context {
});
let programs_loaded_for_tx_batch = LoadedProgramsForTxBatch::default();
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let mut $invoke_context = InvokeContext::new(
&mut $transaction_context,
&sysvar_cache,
Some(LogCollector::new_ref()),
compute_budget,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
Hash::default(),
0,
Expand Down
16 changes: 0 additions & 16 deletions program-runtime/src/message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ impl MessageProcessor {
log_collector: Option<Rc<RefCell<LogCollector>>>,
programs_loaded_for_tx_batch: &LoadedProgramsForTxBatch,
programs_modified_by_tx: &mut LoadedProgramsForTxBatch,
programs_updated_only_for_global_cache: &mut LoadedProgramsForTxBatch,
feature_set: Arc<FeatureSet>,
compute_budget: ComputeBudget,
timings: &mut ExecuteTimings,
Expand All @@ -73,7 +72,6 @@ impl MessageProcessor {
compute_budget,
programs_loaded_for_tx_batch,
programs_modified_by_tx,
programs_updated_only_for_global_cache,
feature_set,
blockhash,
lamports_per_signature,
Expand Down Expand Up @@ -302,15 +300,13 @@ mod tests {
)));
let sysvar_cache = SysvarCache::default();
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&program_indices,
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand Down Expand Up @@ -354,15 +350,13 @@ mod tests {
]),
)));
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&program_indices,
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand Down Expand Up @@ -396,15 +390,13 @@ mod tests {
]),
)));
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&program_indices,
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand Down Expand Up @@ -528,15 +520,13 @@ mod tests {
)));
let sysvar_cache = SysvarCache::default();
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&program_indices,
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand Down Expand Up @@ -564,15 +554,13 @@ mod tests {
Some(transaction_context.get_key_of_account_at_index(0).unwrap()),
)));
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&program_indices,
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand All @@ -597,15 +585,13 @@ mod tests {
Some(transaction_context.get_key_of_account_at_index(0).unwrap()),
)));
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&program_indices,
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand Down Expand Up @@ -687,15 +673,13 @@ mod tests {
Arc::new(LoadedProgram::new_builtin(0, 0, MockBuiltin::vm)),
);
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::default();
let result = MessageProcessor::process_message(
&message,
&[vec![0], vec![1]],
&mut transaction_context,
None,
&programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
Arc::new(FeatureSet::all_enabled()),
ComputeBudget::default(),
&mut ExecuteTimings::default(),
Expand Down
11 changes: 0 additions & 11 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4918,10 +4918,6 @@ impl Bank {
self.slot,
programs_loaded_for_tx_batch.environments.clone(),
);
let mut programs_updated_only_for_global_cache = LoadedProgramsForTxBatch::new(
self.slot,
programs_loaded_for_tx_batch.environments.clone(),
);
let mut process_message_time = Measure::start("process_message_time");
let process_result = MessageProcessor::process_message(
tx.message(),
Expand All @@ -4930,7 +4926,6 @@ impl Bank {
log_collector.clone(),
programs_loaded_for_tx_batch,
&mut programs_modified_by_tx,
&mut programs_updated_only_for_global_cache,
self.feature_set.clone(),
compute_budget,
timings,
Expand Down Expand Up @@ -5030,9 +5025,6 @@ impl Bank {
accounts_data_len_delta,
},
programs_modified_by_tx: Box::new(programs_modified_by_tx),
programs_updated_only_for_global_cache: Box::new(
programs_updated_only_for_global_cache,
),
}
}

Expand Down Expand Up @@ -5315,7 +5307,6 @@ impl Bank {
if let TransactionExecutionResult::Executed {
details,
programs_modified_by_tx,
programs_updated_only_for_global_cache: _,
} = &result
{
// Update batch specific cache of the loaded programs with the modifications
Expand Down Expand Up @@ -5692,13 +5683,11 @@ impl Bank {
if let TransactionExecutionResult::Executed {
details,
programs_modified_by_tx,
programs_updated_only_for_global_cache,
} = execution_result
{
if details.status.is_ok() {
let mut cache = self.loaded_programs_cache.write().unwrap();
cache.merge(programs_modified_by_tx);
cache.merge(programs_updated_only_for_global_cache);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ fn new_execution_result(
accounts_data_len_delta: 0,
},
programs_modified_by_tx: Box::<LoadedProgramsForTxBatch>::default(),
programs_updated_only_for_global_cache: Box::<LoadedProgramsForTxBatch>::default(),
}
}

Expand Down

0 comments on commit 1f70c9e

Please sign in to comment.