diff --git a/crates/context/interface/src/result.rs b/crates/context/interface/src/result.rs index 99bd6b4f4c..62cd8a4b8b 100644 --- a/crates/context/interface/src/result.rs +++ b/crates/context/interface/src/result.rs @@ -200,8 +200,6 @@ pub enum EVMError { /// /// Useful for handler registers where custom logic would want to return their own custom error. Custom(String), - /// Precompile error - Precompile(String), } impl From for EVMError { @@ -236,7 +234,7 @@ impl EVMError EVMError::Transaction(e), Self::Header(e) => EVMError::Header(e), Self::Database(e) => EVMError::Database(op(e)), - Self::Precompile(e) => EVMError::Precompile(e), + // Self::Precompile(e) => EVMError::Precompile(e), Self::Custom(e) => EVMError::Custom(e), } } @@ -253,7 +251,8 @@ where Self::Transaction(e) => Some(e), Self::Header(e) => Some(e), Self::Database(e) => Some(e), - Self::Precompile(_) | Self::Custom(_) => None, + // Self::Precompile(_) | Self::Custom(_) => None, + Self::Custom(_) => None, } } } @@ -269,7 +268,8 @@ where Self::Transaction(e) => write!(f, "transaction validation error: {e}"), Self::Header(e) => write!(f, "header validation error: {e}"), Self::Database(e) => write!(f, "database error: {e}"), - Self::Precompile(e) | Self::Custom(e) => f.write_str(e), + // Self::Precompile(e) | Self::Custom(e) => f.write_str(e), + Self::Custom(e) => f.write_str(e), } } } diff --git a/crates/handler/src/frame.rs b/crates/handler/src/frame.rs index 53a0f53bd1..5b105d1e37 100644 --- a/crates/handler/src/frame.rs +++ b/crates/handler/src/frame.rs @@ -82,7 +82,7 @@ where InterpreterTypes = EthInterpreter, >, >, - ERROR: From> + From + FromStringError, + ERROR: From> + FromStringError, { type Evm = EVM; type FrameInit = FrameInput; @@ -151,7 +151,7 @@ where Precompiles: PrecompileProvider, Instructions: InstructionProvider, >, - ERROR: From> + From, + ERROR: From>, { /// Make call frame #[inline] @@ -522,7 +522,7 @@ where InterpreterTypes = EthInterpreter, >, >, - ERROR: From> + From + FromStringError, + ERROR: From> + FromStringError, { pub fn init_first( evm: &mut EVM, diff --git a/crates/handler/src/handler.rs b/crates/handler/src/handler.rs index 0ed60e2e20..a82efec8fe 100644 --- a/crates/handler/src/handler.rs +++ b/crates/handler/src/handler.rs @@ -19,7 +19,6 @@ pub trait EvmTrError: From + From + From<<::Db as Database>::Error> - + From + FromStringError { } @@ -29,7 +28,6 @@ impl< T: From + From + From<<::Db as Database>::Error> - + From + FromStringError, > EvmTrError for T { diff --git a/crates/handler/src/precompile_provider.rs b/crates/handler/src/precompile_provider.rs index a939efc426..9f09725cfc 100644 --- a/crates/handler/src/precompile_provider.rs +++ b/crates/handler/src/precompile_provider.rs @@ -20,7 +20,7 @@ pub trait PrecompileProvider { address: &Address, bytes: &Bytes, gas_limit: u64, - ) -> Result, PrecompileError>; + ) -> Result, String>; /// Get the warm addresses. fn warm_addresses(&self) -> Box>; @@ -76,7 +76,7 @@ impl PrecompileProvider for EthPrecompiles { address: &Address, bytes: &Bytes, gas_limit: u64, - ) -> Result, PrecompileError> { + ) -> Result, String> { let Some(precompile) = self.precompiles.get(address) else { return Ok(None); }; @@ -95,8 +95,8 @@ impl PrecompileProvider for EthPrecompiles { result.output = output.bytes; } Err(e) => { - if let PrecompileError::Fatal(_) = e { - return Err(e); + if let PrecompileError::Fatal(msg) = e { + return Err(msg); } result.result = if e.is_oog() { InstructionResult::PrecompileOOG diff --git a/crates/inspector/src/traits.rs b/crates/inspector/src/traits.rs index d3cd6afc6c..6036754dd1 100644 --- a/crates/inspector/src/traits.rs +++ b/crates/inspector/src/traits.rs @@ -86,7 +86,7 @@ where InterpreterTypes = EthInterpreter, >, > + InspectorEvmTr, - ERROR: From> + From + FromStringError, + ERROR: From> + FromStringError, { type IT = EthInterpreter; diff --git a/examples/erc20_gas/src/main.rs b/examples/erc20_gas/src/main.rs index 092387791f..177ea24dfc 100644 --- a/examples/erc20_gas/src/main.rs +++ b/examples/erc20_gas/src/main.rs @@ -87,7 +87,6 @@ where ERROR: From + From + From<::Error> - + From, { let sender_balance_slot = erc_address_storage(sender); let sender_balance = context.journal().sload(TOKEN, sender_balance_slot)?.data;