Skip to content

Commit 73abb3e

Browse files
committed
fix(ethereum): Detect Nethermind eth_call reverts
The Nethermind-based clients use a similar format to Parity ones, but we've seen messages like `"Reverted ERC721"` so we need the message detection to be broader than `"Reverted 0x"`.
1 parent 08f10a8 commit 73abb3e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,10 @@ impl EthereumAdapter {
619619
// See f0af4ab0-6b7c-4b68-9141-5b79346a5f61.
620620
const PARITY_OUT_OF_GAS: &str = "Out of gas";
621621

622+
// Also covers Nethermind reverts
622623
const PARITY_VM_EXECUTION_ERROR: i64 = -32015;
623-
const PARITY_REVERT_PREFIX: &str = "Reverted 0x";
624+
const PARITY_REVERT_PREFIX: &str = "revert";
625+
624626
const XDAI_REVERT: &str = "revert";
625627

626628
// Deterministic Geth execution errors. We might need to expand this as
@@ -678,7 +680,7 @@ impl EthereumAdapter {
678680
{
679681
match rpc_error.data.as_ref().and_then(|d| d.as_str()) {
680682
Some(data)
681-
if data.starts_with(PARITY_REVERT_PREFIX)
683+
if data.to_lowercase().starts_with(PARITY_REVERT_PREFIX)
682684
|| data.starts_with(PARITY_BAD_JUMP_PREFIX)
683685
|| data.starts_with(PARITY_STACK_LIMIT_PREFIX)
684686
|| data == PARITY_BAD_INSTRUCTION_FE

0 commit comments

Comments
 (0)