Skip to content

Commit c97de26

Browse files
authored
fix(clis/ethrex): fix ethrex error mapping (#1806)
* fix and add missing things * fix type 4 transaction check * change error message of type4 tx * remove hyphen * revert this * Revert "revert this" This reverts commit dba8a99. * try something, revert if it doesn't work * move it just in case (revert) * Revert "move it just in case (revert)" This reverts commit d95ab95. * make regex more specific
1 parent 253fbcc commit c97de26

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/ethereum_clis/clis/ethrex.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ class EthrexExceptionMapper(ExceptionMapper):
3030
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: r"(?i)empty authorization list",
3131
TransactionException.SENDER_NOT_EOA: (
3232
r"reject transactions from senders with deployed code|"
33-
r"Sender account should not have bytecode"
33+
r"Sender account shouldn't be a contract"
3434
),
35-
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+",
35+
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+|"
36+
r"Nonce mismatch.*",
3637
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
3738
r"blob gas used \d+ exceeds maximum allowance \d+"
3839
),
@@ -47,15 +48,17 @@ class EthrexExceptionMapper(ExceptionMapper):
4748
r"blob versioned hashes not supported|"
4849
r"Type 3 transactions are not supported before the Cancun fork"
4950
),
51+
# A type 4 Transaction without a recipient won't even reach the EVM, we can't decode it.
5052
TransactionException.TYPE_4_TX_CONTRACT_CREATION: (
51-
r"unexpected length|Contract creation in type 4 transaction"
53+
r"unexpected length|Contract creation in type 4 transaction|"
54+
r"Error decoding field 'to' of type primitive_types::H160: InvalidLength"
5255
),
5356
TransactionException.TYPE_4_TX_PRE_FORK: (
5457
r"eip 7702 transactions present in pre-prague payload|"
5558
r"Type 4 transactions are not supported before the Prague fork"
5659
),
5760
TransactionException.INSUFFICIENT_ACCOUNT_FUNDS: (
58-
r"lack of funds \(\d+\) for max fee \(\d+\)|Insufficient account founds"
61+
r"lack of funds \(\d+\) for max fee \(\d+\)|Insufficient account funds"
5962
),
6063
TransactionException.INTRINSIC_GAS_TOO_LOW: (
6164
r"gas floor exceeds the gas limit|call gas cost exceeds the gas limit|"
@@ -71,7 +74,8 @@ class EthrexExceptionMapper(ExceptionMapper):
7174
TransactionException.INITCODE_SIZE_EXCEEDED: (
7275
r"create initcode size limit|Initcode size exceeded"
7376
),
74-
BlockException.SYSTEM_CONTRACT_CALL_FAILED: (r"failed to apply .* requests contract call"),
77+
BlockException.SYSTEM_CONTRACT_CALL_FAILED: (r"System call failed.*"),
78+
BlockException.SYSTEM_CONTRACT_EMPTY: (r"System contract:.* has no code after deployment"),
7579
BlockException.INCORRECT_BLOB_GAS_USED: (r"Blob gas used doesn't match value in header"),
7680
BlockException.RLP_STRUCTURES_ENCODING: (r"Error decoding field '\D+' of type \w+.*"),
7781
BlockException.INCORRECT_EXCESS_BLOB_GAS: (r".* Excess blob gas is incorrect"),

0 commit comments

Comments
 (0)