Skip to content

Commit 39d9c3a

Browse files
committed
chain/ethereum: Restore logic checking for geth eth_call errors
1 parent af94dfa commit 39d9c3a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,15 @@ impl EthereumAdapter {
529529
"invalid opcode",
530530
// Ethereum says 1024 is the stack sizes limit, so this is deterministic.
531531
"stack limit reached 1024",
532+
// See f0af4ab0-6b7c-4b68-9141-5b79346a5f61 for why the gas limit is considered deterministic.
533+
"out of gas",
532534
];
533535

536+
let mut geth_execution_errors = GETH_EXECUTION_ERRORS
537+
.iter()
538+
.map(|s| *s)
539+
.chain(GETH_ETH_CALL_ERRORS_ENV.iter().map(|s| s.as_str()));
540+
534541
let as_solidity_revert_with_reason = |bytes: &[u8]| {
535542
let solidity_revert_function_selector =
536543
&tiny_keccak::keccak256(b"Error(string)")[..4];
@@ -549,8 +556,7 @@ impl EthereumAdapter {
549556

550557
// Check for Geth revert.
551558
Err(web3::Error::Rpc(rpc_error))
552-
if GETH_EXECUTION_ERRORS
553-
.iter()
559+
if geth_execution_errors
554560
.any(|e| rpc_error.message.to_lowercase().contains(e)) =>
555561
{
556562
Err(EthereumContractCallError::Revert(rpc_error.message))

0 commit comments

Comments
 (0)