Skip to content

Commit c190c7a

Browse files
committed
chain(ethereum): Expand deterministic RPC execution errors list (#6355)
1 parent 872e708 commit c190c7a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,10 @@ impl EthereumAdapter {
624624

625625
const XDAI_REVERT: &str = "revert";
626626

627-
// Deterministic Geth execution errors. We might need to expand this as
627+
// Deterministic RPC execution errors. We might need to expand this as
628628
// subgraphs come across other errors. See
629629
// https://github.com/ethereum/go-ethereum/blob/cd57d5cd38ef692de8fbedaa56598b4e9fbfbabc/core/vm/errors.go
630-
const GETH_EXECUTION_ERRORS: &[&str] = &[
630+
const RPC_EXECUTION_ERRORS: &[&str] = &[
631631
// The "revert" substring covers a few known error messages, including:
632632
// Hardhat: "error: transaction reverted",
633633
// Ganache and Moonbeam: "vm exception while processing transaction: revert",
@@ -641,10 +641,14 @@ impl EthereumAdapter {
641641
// See f0af4ab0-6b7c-4b68-9141-5b79346a5f61 for why the gas limit is considered deterministic.
642642
"out of gas",
643643
"stack underflow",
644+
"vm execution error",
645+
"invalidjump",
646+
"notactivated",
647+
"invalidfeopcode",
644648
];
645649

646650
let env_geth_call_errors = ENV_VARS.geth_eth_call_errors.iter();
647-
let mut geth_execution_errors = GETH_EXECUTION_ERRORS
651+
let mut execution_errors = RPC_EXECUTION_ERRORS
648652
.iter()
649653
.copied()
650654
.chain(env_geth_call_errors.map(|s| s.as_str()));
@@ -665,9 +669,9 @@ impl EthereumAdapter {
665669
// A successful response.
666670
Ok(bytes) => Ok(call::Retval::Value(scalar::Bytes::from(bytes))),
667671

668-
// Check for Geth revert.
672+
// Check for RPC revert.
669673
Err(web3::Error::Rpc(rpc_error))
670-
if geth_execution_errors
674+
if execution_errors
671675
.any(|e| rpc_error.message.to_lowercase().contains(e)) =>
672676
{
673677
reverted(&logger, &rpc_error.message)

0 commit comments

Comments
 (0)