This repository was archived by the owner on Jul 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathethrex.py
More file actions
94 lines (90 loc) · 4.79 KB
/
Copy pathethrex.py
File metadata and controls
94 lines (90 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
"""Ethrex execution client transition tool."""
from ethereum_test_exceptions import BlockException, ExceptionMapper, TransactionException
class EthrexExceptionMapper(ExceptionMapper):
"""Ethrex exception mapper."""
mapping_substring = {
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
"Exceeded MAX_BLOB_GAS_PER_BLOCK"
),
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: ("Invalid deposit request layout"),
BlockException.INVALID_REQUESTS: (
"Requests hash does not match the one in the header after executing"
),
BlockException.INVALID_RECEIPTS_ROOT: (
"Receipts Root does not match the one in the header after executing"
),
BlockException.INVALID_STATE_ROOT: (
"World State Root does not match the one in the header after executing"
),
BlockException.INVALID_GAS_USED: "Gas used doesn't match value in header",
BlockException.INCORRECT_BLOB_GAS_USED: "Blob gas used doesn't match value in header",
}
mapping_regex = {
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: (
r"(?i)priority fee.* is greater than max fee.*"
),
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: r"(?i)empty authorization list",
TransactionException.SENDER_NOT_EOA: (
r"reject transactions from senders with deployed code|"
r"Sender account .* shouldn't be a contract"
),
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+|"
r"Nonce mismatch.*",
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
r"blob gas used \d+ exceeds maximum allowance \d+"
),
TransactionException.TYPE_3_TX_ZERO_BLOBS: (
r"blob transactions present in pre-cancun payload|empty blobs|"
r"Type 3 transaction without blobs"
),
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: (
r"blob version not supported|Invalid blob versioned hash"
),
TransactionException.TYPE_3_TX_PRE_FORK: (
r"blob versioned hashes not supported|"
r"Type 3 transactions are not supported before the Cancun fork"
),
# A type 4 Transaction without a recipient won't even reach the EVM, we
# can't decode it.
TransactionException.TYPE_4_TX_CONTRACT_CREATION: (
r"unexpected length|Contract creation in type 4 transaction|"
r"Error decoding field 'to' of type primitive_types::H160: InvalidLength"
),
TransactionException.TYPE_3_TX_CONTRACT_CREATION: (
r"unexpected length|Contract creation in type 3 transaction|"
r"Error decoding field 'to' of type primitive_types::H160: InvalidLength"
),
TransactionException.TYPE_4_TX_PRE_FORK: (
r"eip 7702 transactions present in pre-prague payload|"
r"Type 4 transactions are not supported before the Prague fork"
),
TransactionException.INSUFFICIENT_ACCOUNT_FUNDS: (
r"lack of funds \(\d+\) for max fee \(\d+\)|Insufficient account funds"
),
TransactionException.INTRINSIC_GAS_TOO_LOW: (
r"gas floor exceeds the gas limit|call gas cost exceeds the gas limit|"
r"Transaction gas limit lower than the minimum gas cost to execute the transaction"
),
TransactionException.INTRINSIC_GAS_BELOW_FLOOR_GAS_COST: (
r"Transaction gas limit lower than the gas cost floor for calldata tokens"
),
TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS: (
r"gas price is less than basefee|Insufficient max fee per gas"
),
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: (
r"blob gas price is greater than max fee per blob gas|"
r"Insufficient max fee per blob gas.*"
),
TransactionException.INITCODE_SIZE_EXCEEDED: (
r"create initcode size limit|Initcode size exceeded.*"
),
TransactionException.NONCE_IS_MAX: (r"Nonce is max"),
TransactionException.GAS_ALLOWANCE_EXCEEDED: (r"Gas allowance exceeded.*"),
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: (r"Blob count exceeded.*"),
BlockException.SYSTEM_CONTRACT_CALL_FAILED: (r"System call failed.*"),
BlockException.SYSTEM_CONTRACT_EMPTY: (r"System contract:.* has no code after deployment"),
BlockException.INCORRECT_BLOB_GAS_USED: (r"Blob gas used doesn't match value in header"),
BlockException.RLP_STRUCTURES_ENCODING: (r"Error decoding field '\D+' of type \w+.*"),
BlockException.INCORRECT_EXCESS_BLOB_GAS: (r".* Excess blob gas is incorrect"),
BlockException.INVALID_BLOCK_HASH: (r"Invalid block hash. Expected \w+, got \w+"),
}