diff --git a/Cargo.lock b/Cargo.lock index 776cd62b6d..a243ad0c80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5160,7 +5160,7 @@ dependencies = [ [[package]] name = "revm" version = "3.0.0" -source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f" +source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538" dependencies = [ "auto_impl", "revm-interpreter", @@ -5170,7 +5170,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "1.0.0" -source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f" +source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538" dependencies = [ "bitvec 1.0.1", "derive_more", @@ -5182,7 +5182,7 @@ dependencies = [ [[package]] name = "revm-precompile" version = "2.0.0" -source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f" +source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538" dependencies = [ "k256", "num", @@ -5198,7 +5198,7 @@ dependencies = [ [[package]] name = "revm-primitives" version = "1.0.0" -source = "git+https://github.com/bluealloy/revm#3a17ca8556ee2933100d1e1ed4e200712715f76f" +source = "git+https://github.com/bluealloy/revm#7bb73da23d0278829f9669f175a6eede247c0538" dependencies = [ "arbitrary", "auto_impl", diff --git a/crates/rpc/rpc/src/eth/error.rs b/crates/rpc/rpc/src/eth/error.rs index 8a080c7b52..ce38462f0d 100644 --- a/crates/rpc/rpc/src/eth/error.rs +++ b/crates/rpc/rpc/src/eth/error.rs @@ -179,15 +179,17 @@ pub enum InvalidTransactionError { /// Unspecific evm halt error #[error("EVM error {0:?}")] EvmHalt(Halt), + #[error("Invalid chain id")] + InvalidChainId, } impl InvalidTransactionError { /// Returns the rpc error code for this error. fn error_code(&self) -> i32 { match self { - InvalidTransactionError::GasTooLow | InvalidTransactionError::GasTooHigh => { - EthRpcErrorCode::InvalidInput.code() - } + InvalidTransactionError::InvalidChainId | + InvalidTransactionError::GasTooLow | + InvalidTransactionError::GasTooHigh => EthRpcErrorCode::InvalidInput.code(), InvalidTransactionError::Revert(_) => EthRpcErrorCode::ExecutionError.code(), _ => EthRpcErrorCode::TransactionRejected.code(), } @@ -214,6 +216,7 @@ impl From for InvalidTransactionError { fn from(err: revm::primitives::InvalidTransaction) -> Self { use revm::primitives::InvalidTransaction; match err { + InvalidTransaction::InvalidChainId => InvalidTransactionError::InvalidChainId, InvalidTransaction::GasMaxFeeGreaterThanPriorityFee => { InvalidTransactionError::TipAboveFeeCap }