Skip to content

Commit abe027d

Browse files
spencer-tbfselmo
authored andcommitted
chore(test-client-clis): final fusaka mapper fixes (#1859)
* chore(test-client-clis): final fusaka mapper fixes * chore(test-tests): fix `gas_price` in `test_tx_gas_limit` to isolate gas limit validation * chore(test-client-clis): re-add `NONCE_MISMATCH_TOO_LOW` mapping back for nethermind * chore(test-client-clis): re-add `NONCE_MISMATCH_TOO_LOW` mapping back for ethrex
1 parent 3b5f8b6 commit abe027d

6 files changed

Lines changed: 25 additions & 12 deletions

File tree

packages/testing/src/execution_testing/client_clis/clis/besu.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ class BesuExceptionMapper(ExceptionMapper):
322322
TransactionException.NONCE_MISMATCH_TOO_LOW: (
323323
r"transaction invalid transaction nonce \d+ below sender account nonce \d+"
324324
),
325+
TransactionException.NONCE_MISMATCH_TOO_HIGH: (
326+
r"transaction invalid transaction nonce \d+ does not match sender account nonce \d+"
327+
),
325328
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: (
326329
r"transaction invalid Transaction gas limit must be at most \d+"
327330
),

packages/testing/src/execution_testing/client_clis/clis/erigon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class ErigonExceptionMapper(ExceptionMapper):
2323
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: "tip higher than fee cap",
2424
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: "max fee per blob gas too low",
2525
TransactionException.NONCE_MISMATCH_TOO_LOW: "nonce too low",
26+
TransactionException.NONCE_MISMATCH_TOO_HIGH: "nonce too high",
2627
TransactionException.GAS_ALLOWANCE_EXCEEDED: "gas limit reached",
2728
TransactionException.TYPE_3_TX_PRE_FORK: "blob txn is not supported by signer",
2829
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: (

packages/testing/src/execution_testing/client_clis/clis/ethrex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class EthrexExceptionMapper(ExceptionMapper):
3939
r"reject transactions from senders with deployed code|"
4040
r"Sender account .* shouldn't be a contract"
4141
),
42-
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+|"
43-
r"Nonce mismatch.*",
42+
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+|Nonce mismatch.*",
43+
TransactionException.NONCE_MISMATCH_TOO_HIGH: r"Nonce mismatch.*",
4444
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
4545
r"blob gas used \d+ exceeds maximum allowance \d+"
4646
),

packages/testing/src/execution_testing/client_clis/clis/nethermind.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ class NethermindExceptionMapper(ExceptionMapper):
392392
TransactionException.NONCE_IS_MAX: "NonceTooHigh",
393393
TransactionException.INITCODE_SIZE_EXCEEDED: "max initcode size exceeded",
394394
TransactionException.NONCE_MISMATCH_TOO_LOW: "wrong transaction nonce",
395+
TransactionException.NONCE_MISMATCH_TOO_HIGH: "wrong transaction nonce",
395396
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: (
396397
"InsufficientMaxFeePerBlobGas: Not enough to cover blob gas fee"
397398
),

packages/testing/src/execution_testing/client_clis/clis/reth.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class RethExceptionMapper(ExceptionMapper):
3030
TransactionException.TYPE_4_TX_PRE_FORK: (
3131
"eip 7702 transactions present in pre-prague payload"
3232
),
33-
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
34-
"failed to decode deposit requests from receipts"
35-
),
3633
BlockException.INVALID_REQUESTS: "mismatched block requests hash",
3734
BlockException.INVALID_RECEIPTS_ROOT: "receipt root mismatch",
3835
BlockException.INVALID_STATE_ROOT: "mismatched block state root",
@@ -45,6 +42,7 @@ class RethExceptionMapper(ExceptionMapper):
4542
}
4643
mapping_regex = {
4744
TransactionException.NONCE_MISMATCH_TOO_LOW: r"nonce \d+ too low, expected \d+",
45+
TransactionException.NONCE_MISMATCH_TOO_HIGH: r"nonce \d+ too high, expected \d+",
4846
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: (
4947
r"blob gas price \(\d+\) is greater than max fee per blob gas \(\d+\)"
5048
),
@@ -100,11 +98,21 @@ class RethExceptionMapper(ExceptionMapper):
10098
BlockException.INCORRECT_BLOCK_FORMAT: (
10199
r"Block's access list is invalid."
102100
),
103-
BlockException.INVALID_GASLIMIT: (r"child gas_limit \d+ max .* is .*"),
104-
BlockException.INVALID_BLOCK_TIMESTAMP_OLDER_THAN_PARENT: (
105-
r"block timestamp \d+ is in the past compared to the parent timestamp \d+"
106-
),
107-
BlockException.INVALID_BLOCK_NUMBER: (
108-
r"block number \d+ does not match parent block number \d+"
101+
# Reth does not validate the sizes or offsets of the deposit
102+
# contract logs. As a workaround we have set
103+
# INVALID_DEPOSIT_EVENT_LAYOUT equal to INVALID_REQUESTS.
104+
#
105+
# Although this is out of spec, it is understood that this
106+
# will not cause an issue so long as the mainnet/testnet
107+
# deposit contracts don't change.
108+
#
109+
# The offsets are checked second and the sizes are checked
110+
# third within the `is_valid_deposit_event_data` function:
111+
# https://eips.ethereum.org/EIPS/eip-6110#block-validity
112+
#
113+
# EELS definition for `is_valid_deposit_event_data`:
114+
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
115+
BlockException.INVALID_DEPOSIT_EVENT_LAYOUT: (
116+
r"failed to decode deposit requests from receipts|mismatched block requests hash"
109117
),
110118
}

tests/frontier/validation/test_transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_tx_gas_limit(
3030
tx = Transaction(
3131
gas_limit=21001,
3232
to=to,
33-
gas_price=0x01,
33+
gas_price=0x10, # Must be >= base fee to isolate gas limit validation
3434
sender=sender,
3535
protected=False,
3636
error=TransactionException.GAS_ALLOWANCE_EXCEEDED,

0 commit comments

Comments
 (0)