From 27094cd8375822f019bfb8b6ff3a24cf9ef10e32 Mon Sep 17 00:00:00 2001 From: brooks Date: Mon, 8 Jan 2024 13:38:03 -0500 Subject: [PATCH] Removes AccountsDataMeter from InvokeContext --- program-runtime/src/invoke_context.rs | 10 +--------- program-runtime/src/message_processor.rs | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/program-runtime/src/invoke_context.rs b/program-runtime/src/invoke_context.rs index 582fa90ecc7d0e..2122f7a74907d2 100644 --- a/program-runtime/src/invoke_context.rs +++ b/program-runtime/src/invoke_context.rs @@ -1,6 +1,5 @@ use { crate::{ - accounts_data_meter::AccountsDataMeter, compute_budget::ComputeBudget, ic_msg, loaded_programs::{LoadedProgram, LoadedProgramType, LoadedProgramsForTxBatch}, @@ -164,7 +163,6 @@ pub struct InvokeContext<'a> { compute_budget: ComputeBudget, current_compute_budget: ComputeBudget, compute_meter: RefCell, - accounts_data_meter: AccountsDataMeter, pub programs_loaded_for_tx_batch: &'a LoadedProgramsForTxBatch, pub programs_modified_by_tx: &'a mut LoadedProgramsForTxBatch, pub feature_set: Arc, @@ -187,7 +185,7 @@ impl<'a> InvokeContext<'a> { feature_set: Arc, blockhash: Hash, lamports_per_signature: u64, - prev_accounts_data_len: u64, + _prev_accounts_data_len: u64, ) -> Self { Self { transaction_context, @@ -196,7 +194,6 @@ impl<'a> InvokeContext<'a> { current_compute_budget: compute_budget, compute_budget, compute_meter: RefCell::new(compute_budget.compute_unit_limit), - accounts_data_meter: AccountsDataMeter::new(prev_accounts_data_len), programs_loaded_for_tx_batch, programs_modified_by_tx, feature_set, @@ -570,11 +567,6 @@ impl<'a> InvokeContext<'a> { *self.compute_meter.borrow_mut() = remaining; } - /// Get this invocation's AccountsDataMeter - pub fn get_accounts_data_meter(&self) -> &AccountsDataMeter { - &self.accounts_data_meter - } - /// Get this invocation's compute budget pub fn get_compute_budget(&self) -> &ComputeBudget { &self.current_compute_budget diff --git a/program-runtime/src/message_processor.rs b/program-runtime/src/message_processor.rs index b8b2177f91476f..f15bcda4a90fcb 100644 --- a/program-runtime/src/message_processor.rs +++ b/program-runtime/src/message_processor.rs @@ -175,7 +175,7 @@ impl MessageProcessor { .map_err(|err| TransactionError::InstructionError(instruction_index as u8, err))?; } Ok(ProcessedMessageInfo { - accounts_data_len_delta: invoke_context.get_accounts_data_meter().delta(), + accounts_data_len_delta: 0, // unused }) } }