Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes AccountsDataMeter from InvokeContext #34698

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use {
crate::{
accounts_data_meter::AccountsDataMeter,
compute_budget::ComputeBudget,
ic_msg,
loaded_programs::{LoadedProgram, LoadedProgramType, LoadedProgramsForTxBatch},
Expand Down Expand Up @@ -164,7 +163,6 @@ pub struct InvokeContext<'a> {
compute_budget: ComputeBudget,
current_compute_budget: ComputeBudget,
compute_meter: RefCell<u64>,
accounts_data_meter: AccountsDataMeter,
pub programs_loaded_for_tx_batch: &'a LoadedProgramsForTxBatch,
pub programs_modified_by_tx: &'a mut LoadedProgramsForTxBatch,
pub feature_set: Arc<FeatureSet>,
Expand All @@ -187,7 +185,7 @@ impl<'a> InvokeContext<'a> {
feature_set: Arc<FeatureSet>,
blockhash: Hash,
lamports_per_signature: u64,
prev_accounts_data_len: u64,
_prev_accounts_data_len: u64,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be removed in a subsequent PR.

) -> Self {
Self {
transaction_context,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion program-runtime/src/message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be removed in a subsequent PR.

})
}
}
Expand Down
Loading