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

Move record_external_operation to StackState trait #171

Merged
merged 1 commit into from
Jun 22, 2023
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 src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
mod memory;

pub use self::memory::{MemoryAccount, MemoryBackend, MemoryVicinity};
use crate::ExitError;
use alloc::vec::Vec;
use primitive_types::{H160, H256, U256};
/// Basic account information.
Expand Down Expand Up @@ -49,7 +48,7 @@ pub enum Apply<I> {
}

/// EVM backend.
//#[auto_impl::auto_impl(&, Arc, Box)]
#[auto_impl::auto_impl(&, Arc, Box)]
pub trait Backend {
/// Gas price. Unused for London.
fn gas_price(&self) -> U256;
Expand Down Expand Up @@ -84,13 +83,6 @@ pub trait Backend {
fn storage(&self, address: H160, index: H256) -> H256;
/// Get original storage value of address at index, if available.
fn original_storage(&self, address: H160, index: H256) -> Option<H256>;

fn record_external_operation(
&mut self,
_op: crate::ExternalOperation,
) -> Result<(), ExitError> {
Ok(())
}
}

/// EVM backend that can apply changes.
Expand Down
7 changes: 7 additions & 0 deletions src/executor/stack/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ pub trait StackState<'config>: Backend {
H256::from_slice(Keccak256::digest(self.code(address)).as_slice())
}

fn record_external_operation(
&mut self,
_op: crate::ExternalOperation,
) -> Result<(), ExitError> {
Ok(())
}

fn record_external_dynamic_opcode_cost(
&mut self,
_opcode: Opcode,
Expand Down