Skip to content

Commit fa708fb

Browse files
committed
fix(clis): Exceptions in mappers
1 parent f4da9d3 commit fa708fb

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

Diff for: src/ethereum_clis/clis/besu.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ class BesuExceptionMapper(ExceptionMapper):
235235
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: "Invalid Blob Count",
236236
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: "Invalid Blob Count",
237237
TransactionException.TYPE_3_TX_PRE_FORK: (
238-
"Transaction type BLOB is invalid, accepted transaction types are "
239-
"[EIP1559, ACCESS_LIST, FRONTIER]"
238+
"Transaction type BLOB is invalid, accepted transaction types are"
240239
),
241240
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: (
242241
"transaction invalid transaction code delegation transactions must have a "

Diff for: src/ethereum_clis/clis/erigon.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ErigonExceptionMapper(ExceptionMapper):
1717
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: "tip higher than fee cap",
1818
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: "max fee per blob gas too low",
1919
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low",
20+
TransactionException.TYPE_3_TX_PRE_FORK: "blob txn is not supported by signer",
2021
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: (
2122
"invalid blob versioned hash, must start with VERSIONED_HASH_VERSION_KZG"
2223
),

Diff for: src/ethereum_clis/clis/ethereumjs.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,14 @@ class EthereumJSExceptionMapper(ExceptionMapper):
6161
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: (
6262
"maxFeePerGas cannot be less than maxPriorityFeePerGas"
6363
),
64-
TransactionException.TYPE_3_TX_PRE_FORK: (
65-
"blob tx used but field env.ExcessBlobGas missing"
66-
),
6764
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: (
6865
"versioned hash does not start with KZG commitment version"
6966
),
7067
# This message is the same as TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED
7168
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: "exceed maximum allowance",
7269
TransactionException.TYPE_3_TX_ZERO_BLOBS: "tx should contain at least one blob",
7370
TransactionException.TYPE_3_TX_WITH_FULL_BLOBS: "Invalid EIP-4844 transaction",
74-
TransactionException.TYPE_4_TX_CONTRACT_CREATION: (
71+
TransactionException.TYPE_3_TX_CONTRACT_CREATION: (
7572
'tx should have a "to" field and cannot be used to create contracts'
7673
),
7774
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: (
@@ -140,6 +137,9 @@ class EthereumJSExceptionMapper(ExceptionMapper):
140137
r"tx causes total blob gas of \d+ to exceed maximum blob gas per block of \d+|"
141138
r"tx can contain at most \d+ blobs"
142139
),
140+
TransactionException.TYPE_3_TX_PRE_FORK: (
141+
r"blob tx used but field env.ExcessBlobGas missing|EIP-4844 not enabled on Common"
142+
),
143143
BlockException.BLOB_GAS_USED_ABOVE_LIMIT: r"invalid blobGasUsed expected=\d+ actual=\d+",
144144
BlockException.INCORRECT_BLOB_GAS_USED: r"invalid blobGasUsed expected=\d+ actual=\d+",
145145
BlockException.INVALID_BLOCK_HASH: (

Diff for: src/ethereum_clis/clis/geth.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ class GethExceptionMapper(ExceptionMapper):
4444
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: (
4545
"max priority fee per gas higher than max fee per gas"
4646
),
47-
TransactionException.TYPE_3_TX_PRE_FORK: (
48-
"blob tx used but field env.ExcessBlobGas missing"
49-
),
47+
TransactionException.TYPE_3_TX_PRE_FORK: ("transaction type not supported"),
5048
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: "has invalid hash version",
5149
# This message is the same as TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED
5250
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: "exceed maximum allowance",
@@ -67,6 +65,7 @@ class GethExceptionMapper(ExceptionMapper):
6765
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low",
6866
BlockException.INCORRECT_BLOB_GAS_USED: "blob gas used mismatch",
6967
BlockException.INCORRECT_EXCESS_BLOB_GAS: "invalid excessBlobGas",
68+
BlockException.INVALID_VERSIONED_HASHES: "invalid number of versionedHashes",
7069
BlockException.INVALID_REQUESTS: "invalid requests hash",
7170
BlockException.INVALID_BLOCK_HASH: "blockhash mismatch",
7271
# TODO EVMONE needs to differentiate when the section is missing in the header or body

Diff for: src/ethereum_clis/clis/nethermind.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ class NethermindExceptionMapper(ExceptionMapper):
323323

324324
mapping_substring = {
325325
TransactionException.SENDER_NOT_EOA: "sender has deployed code",
326-
TransactionException.INSUFFICIENT_ACCOUNT_FUNDS: "insufficient sender balance",
327326
TransactionException.INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low",
328327
TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS: "miner premium is negative",
329328
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: (
@@ -334,6 +333,9 @@ class NethermindExceptionMapper(ExceptionMapper):
334333
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: (
335334
"InsufficientMaxFeePerBlobGas: Not enough to cover blob gas fee"
336335
),
336+
TransactionException.TYPE_3_TX_PRE_FORK: (
337+
"InvalidTxType: Transaction type in Custom is not supported"
338+
),
337339
TransactionException.TYPE_3_TX_ZERO_BLOBS: "blob transaction missing blob hashes",
338340
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: (
339341
"InvalidBlobVersionedHashVersion: Blob version not supported"
@@ -351,6 +353,9 @@ class NethermindExceptionMapper(ExceptionMapper):
351353
BlockException.INVALID_REQUESTS: "InvalidRequestsHash: Requests hash mismatch in block",
352354
}
353355
mapping_regex = {
356+
TransactionException.INSUFFICIENT_ACCOUNT_FUNDS: (
357+
r"insufficient sender balance|insufficient MaxFeePerGas for sender balance"
358+
),
354359
TransactionException.TYPE_3_TX_WITH_FULL_BLOBS: r"Transaction \d+ is not valid",
355360
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
356361
r"BlobTxGasLimitExceeded: Transaction's totalDataGas=\d+ "

Diff for: src/ethereum_clis/clis/reth.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class RethExceptionMapper(ExceptionMapper):
2222
TransactionException.TYPE_3_TX_CONTRACT_CREATION: "unexpected length",
2323
TransactionException.TYPE_3_TX_WITH_FULL_BLOBS: "unexpected list",
2424
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: "blob version not supported",
25-
TransactionException.TYPE_3_TX_ZERO_BLOBS: "empty blobs",
25+
TransactionException.TYPE_3_TX_ZERO_BLOBS: (
26+
"blob transactions present in pre-cancun payload"
27+
),
2628
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: "empty authorization list",
2729
TransactionException.TYPE_4_TX_CONTRACT_CREATION: "unexpected length",
2830
BlockException.INVALID_REQUESTS: "mismatched block requests hash",

0 commit comments

Comments
 (0)