diff --git a/crates/interpreter/src/instructions/contract.rs b/crates/interpreter/src/instructions/contract.rs index f41d1b7f14..8457fb2afc 100644 --- a/crates/interpreter/src/instructions/contract.rs +++ b/crates/interpreter/src/instructions/contract.rs @@ -7,7 +7,7 @@ use crate::{ gas::{self, cost_per_word, EOF_CREATE_GAS, KECCAK256WORD}, interpreter::Interpreter, primitives::{Address, Bytes, Eof, Spec, SpecId::*, U256}, - CallInputs, CallScheme, CallValue, CreateInputs, CreateScheme, EOFCreateInput, Host, + CallInputs, CallScheme, CallValue, CreateInputs, CreateScheme, EOFCreateInputs, Host, InstructionResult, InterpreterAction, InterpreterResult, LoadAccountResult, MAX_INITCODE_SIZE, }; use core::cmp::max; @@ -68,7 +68,7 @@ pub fn eofcreate(interpreter: &mut Interpreter, _host: &mut H) // Send container for execution container is preverified. interpreter.next_action = InterpreterAction::EOFCreate { - inputs: Box::new(EOFCreateInput::new( + inputs: Box::new(EOFCreateInputs::new( interpreter.contract.target_address, created_address, value, diff --git a/crates/interpreter/src/interpreter_action.rs b/crates/interpreter/src/interpreter_action.rs index 0581e220e4..1459b0226e 100644 --- a/crates/interpreter/src/interpreter_action.rs +++ b/crates/interpreter/src/interpreter_action.rs @@ -9,7 +9,7 @@ pub use call_inputs::{CallInputs, CallScheme, CallValue}; pub use call_outcome::CallOutcome; pub use create_inputs::{CreateInputs, CreateScheme}; pub use create_outcome::CreateOutcome; -pub use eof_create_inputs::EOFCreateInput; +pub use eof_create_inputs::EOFCreateInputs; pub use eof_create_outcome::EOFCreateOutcome; use crate::InterpreterResult; @@ -24,7 +24,7 @@ pub enum InterpreterAction { /// CREATE or CREATE2 instruction called. Create { inputs: Box }, /// EOF CREATE instruction called. - EOFCreate { inputs: Box }, + EOFCreate { inputs: Box }, /// Interpreter finished execution. Return { result: InterpreterResult }, /// No action diff --git a/crates/interpreter/src/interpreter_action/eof_create_inputs.rs b/crates/interpreter/src/interpreter_action/eof_create_inputs.rs index 28a1a471b9..4dc8190be5 100644 --- a/crates/interpreter/src/interpreter_action/eof_create_inputs.rs +++ b/crates/interpreter/src/interpreter_action/eof_create_inputs.rs @@ -4,7 +4,7 @@ use std::boxed::Box; /// Inputs for EOF create call. #[derive(Debug, Default, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct EOFCreateInput { +pub struct EOFCreateInputs { /// Caller of Eof Craate pub caller: Address, /// New contract address. @@ -19,7 +19,7 @@ pub struct EOFCreateInput { pub gas_limit: u64, } -impl EOFCreateInput { +impl EOFCreateInputs { /// Returns boxed EOFCreateInput or error. /// Internally calls [`Self::new_tx`]. pub fn new_tx_boxed(tx: &TxEnv, nonce: u64) -> Result, EofDecodeError> { @@ -31,7 +31,7 @@ impl EOFCreateInput { /// Legacy transaction still have optional nonce so we need to obtain it. pub fn new_tx(tx: &TxEnv, nonce: u64) -> Result { let (eof_init_code, input) = Eof::decode_dangling(tx.data.clone())?; - Ok(EOFCreateInput { + Ok(EOFCreateInputs { caller: tx.caller, created_address: tx.caller.create(nonce), value: tx.value, @@ -49,8 +49,8 @@ impl EOFCreateInput { eof_init_code: Eof, gas_limit: u64, input: Bytes, - ) -> EOFCreateInput { - EOFCreateInput { + ) -> EOFCreateInputs { + EOFCreateInputs { caller, created_address, value, diff --git a/crates/interpreter/src/lib.rs b/crates/interpreter/src/lib.rs index 01db032788..64167dd410 100644 --- a/crates/interpreter/src/lib.rs +++ b/crates/interpreter/src/lib.rs @@ -37,7 +37,7 @@ pub use interpreter::{ }; pub use interpreter_action::{ CallInputs, CallOutcome, CallScheme, CallValue, CreateInputs, CreateOutcome, CreateScheme, - EOFCreateInput, EOFCreateOutcome, InterpreterAction, + EOFCreateInputs, EOFCreateOutcome, InterpreterAction, }; pub use opcode::{Instruction, OpCode, OPCODE_INFO_JUMPTABLE}; pub use primitives::{MAX_CODE_SIZE, MAX_INITCODE_SIZE}; diff --git a/crates/revm/src/context/inner_evm_context.rs b/crates/revm/src/context/inner_evm_context.rs index 3272b0e82e..73fda3af32 100644 --- a/crates/revm/src/context/inner_evm_context.rs +++ b/crates/revm/src/context/inner_evm_context.rs @@ -1,7 +1,7 @@ use crate::{ db::Database, interpreter::{ - analysis::to_analysed, gas, return_ok, Contract, CreateInputs, EOFCreateInput, Gas, + analysis::to_analysed, gas, return_ok, Contract, CreateInputs, EOFCreateInputs, Gas, InstructionResult, Interpreter, InterpreterResult, LoadAccountResult, SStoreResult, SelfDestructResult, MAX_CODE_SIZE, }, @@ -245,7 +245,7 @@ impl InnerEvmContext { pub fn make_eofcreate_frame( &mut self, spec_id: SpecId, - inputs: &EOFCreateInput, + inputs: &EOFCreateInputs, ) -> Result> { let return_error = |e| { Ok(FrameOrResult::new_eofcreate_result( diff --git a/crates/revm/src/evm.rs b/crates/revm/src/evm.rs index 80d536598d..d5b853d220 100644 --- a/crates/revm/src/evm.rs +++ b/crates/revm/src/evm.rs @@ -3,7 +3,7 @@ use crate::{ db::{Database, DatabaseCommit, EmptyDB}, handler::Handler, interpreter::{ - analysis::validate_eof, CallInputs, CreateInputs, EOFCreateInput, EOFCreateOutcome, Gas, + analysis::validate_eof, CallInputs, CreateInputs, EOFCreateInputs, EOFCreateOutcome, Gas, Host, InstructionResult, InterpreterAction, InterpreterResult, SharedMemory, }, primitives::{ @@ -374,7 +374,7 @@ impl Evm<'_, EXT, DB> { }); // Create EOFCreateInput from transaction initdata. - let eofcreate = EOFCreateInput::new_tx_boxed(&ctx.evm.env.tx, nonce) + let eofcreate = EOFCreateInputs::new_tx_boxed(&ctx.evm.env.tx, nonce) .ok() .and_then(|eofcreate| { // validate EOF initcode diff --git a/crates/revm/src/handler/handle_types/execution.rs b/crates/revm/src/handler/handle_types/execution.rs index b671631732..9e17def07c 100644 --- a/crates/revm/src/handler/handle_types/execution.rs +++ b/crates/revm/src/handler/handle_types/execution.rs @@ -6,7 +6,7 @@ use crate::{ CallFrame, Context, CreateFrame, Frame, FrameOrResult, FrameResult, }; use revm_interpreter::{ - opcode::InstructionTables, CallOutcome, CreateOutcome, EOFCreateInput, EOFCreateOutcome, + opcode::InstructionTables, CallOutcome, CreateOutcome, EOFCreateInputs, EOFCreateOutcome, InterpreterAction, InterpreterResult, }; use std::{boxed::Box, sync::Arc}; @@ -91,7 +91,7 @@ pub type InsertCreateOutcomeHandle<'a, EXT, DB> = Arc< pub type FrameEOFCreateHandle<'a, EXT, DB> = Arc< dyn Fn( &mut Context, - Box, + Box, ) -> Result::Error>> + 'a, >; @@ -255,7 +255,7 @@ impl<'a, EXT, DB: Database> ExecutionHandler<'a, EXT, DB> { pub fn eofcreate( &self, context: &mut Context, - inputs: Box, + inputs: Box, ) -> Result> { (self.eofcreate)(context, inputs) } diff --git a/crates/revm/src/handler/mainnet/execution.rs b/crates/revm/src/handler/mainnet/execution.rs index e55d6c4474..4ee557f81b 100644 --- a/crates/revm/src/handler/mainnet/execution.rs +++ b/crates/revm/src/handler/mainnet/execution.rs @@ -10,7 +10,7 @@ use crate::{ }; use core::mem; use revm_interpreter::{ - opcode::InstructionTables, CallOutcome, EOFCreateInput, EOFCreateOutcome, InterpreterAction, + opcode::InstructionTables, CallOutcome, EOFCreateInputs, EOFCreateOutcome, InterpreterAction, InterpreterResult, EMPTY_SHARED_MEMORY, }; use std::boxed::Box; @@ -164,7 +164,7 @@ pub fn insert_create_outcome( #[inline] pub fn eofcreate( context: &mut Context, - inputs: Box, + inputs: Box, ) -> Result> { context.evm.make_eofcreate_frame(SPEC::SPEC_ID, &inputs) } diff --git a/crates/revm/src/inspector.rs b/crates/revm/src/inspector.rs index 2754aee822..26551c8d8d 100644 --- a/crates/revm/src/inspector.rs +++ b/crates/revm/src/inspector.rs @@ -1,5 +1,5 @@ use crate::{ - interpreter::{CallInputs, CreateInputs, EOFCreateInput, EOFCreateOutcome, Interpreter}, + interpreter::{CallInputs, CreateInputs, EOFCreateInputs, EOFCreateOutcome, Interpreter}, primitives::{db::Database, Address, Log, U256}, EvmContext, }; @@ -141,7 +141,7 @@ pub trait Inspector { fn eofcreate( &mut self, context: &mut EvmContext, - inputs: &mut EOFCreateInput, + inputs: &mut EOFCreateInputs, ) -> Option { let _ = context; let _ = inputs; @@ -152,7 +152,7 @@ pub trait Inspector { fn eofcreate_end( &mut self, context: &mut EvmContext, - inputs: &EOFCreateInput, + inputs: &EOFCreateInputs, outcome: EOFCreateOutcome, ) -> EOFCreateOutcome { let _ = context;