Skip to content

Commit a191de9

Browse files
spencer-tbfselmo
andauthored
chore(packages/tests): update bal mappers (#1661)
* chore(packages/tests): update bal mappers * chore(test-tools): ruff format / fix lint --------- Co-authored-by: fselmo <[email protected]>
1 parent de8973e commit a191de9

File tree

4 files changed

+63
-23
lines changed

4 files changed

+63
-23
lines changed

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

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -296,26 +296,6 @@ class BesuExceptionMapper(ExceptionMapper):
296296
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: (
297297
r"Block size of \d+ bytes exceeds limit of \d+ bytes"
298298
),
299-
BlockException.INVALID_BAL_EXTRA_ACCOUNT: (
300-
r"Block access list hash mismatch, "
301-
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
302-
),
303-
BlockException.INVALID_BAL_HASH: (
304-
r"Block access list hash mismatch, "
305-
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
306-
),
307-
BlockException.INVALID_BAL_MISSING_ACCOUNT: (
308-
r"Block access list hash mismatch, "
309-
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
310-
),
311-
BlockException.INVALID_BLOCK_ACCESS_LIST: (
312-
r"Block access list hash mismatch, "
313-
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
314-
),
315-
BlockException.INCORRECT_BLOCK_FORMAT: (
316-
r"Block access list hash mismatch, "
317-
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
318-
),
319299
TransactionException.INITCODE_SIZE_EXCEEDED: (
320300
r"transaction invalid Initcode size of \d+ exceeds maximum size of \d+"
321301
),
@@ -345,4 +325,25 @@ class BesuExceptionMapper(ExceptionMapper):
345325
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: (
346326
r"Blob transaction has too many blobs: \d+|Invalid Blob Count: \d+"
347327
),
328+
# BAL Exceptions: TODO - review once all clients completed.
329+
BlockException.INVALID_BAL_EXTRA_ACCOUNT: (
330+
r"Block access list hash mismatch, "
331+
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
332+
),
333+
BlockException.INVALID_BAL_HASH: (
334+
r"Block access list hash mismatch, "
335+
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
336+
),
337+
BlockException.INVALID_BAL_MISSING_ACCOUNT: (
338+
r"Block access list hash mismatch, "
339+
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
340+
),
341+
BlockException.INVALID_BLOCK_ACCESS_LIST: (
342+
r"Block access list hash mismatch, "
343+
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
344+
),
345+
BlockException.INCORRECT_BLOCK_FORMAT: (
346+
r"Block access list hash mismatch, "
347+
r"calculated:\s*(0x[a-f0-9]+)\s+header:\s*(0x[a-f0-9]+)"
348+
),
348349
}

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ class GethExceptionMapper(ExceptionMapper):
8787
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "system call failed to execute:",
8888
BlockException.INVALID_BLOCK_HASH: "blockhash mismatch",
8989
BlockException.RLP_BLOCK_LIMIT_EXCEEDED: "block RLP-encoded size exceeds maximum",
90-
BlockException.INVALID_BAL_EXTRA_ACCOUNT: "BAL change not reported in computed",
91-
BlockException.INVALID_BAL_MISSING_ACCOUNT: "additional mutations compared to BAL",
92-
BlockException.INVALID_BLOCK_ACCESS_LIST: "unequal",
9390
}
9491
mapping_regex: ClassVar[Dict[ExceptionBase, str]] = {
9592
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
@@ -116,6 +113,19 @@ class GethExceptionMapper(ExceptionMapper):
116113
#
117114
# EELS definition for `is_valid_deposit_event_data`:
118115
# https://github.com/ethereum/execution-specs/blob/5ddb904fa7ba27daeff423e78466744c51e8cb6a/src/ethereum/forks/prague/requests.py#L51
116+
# BAL Exceptions: TODO - review once all clients completed.
117+
BlockException.INVALID_BAL_EXTRA_ACCOUNT: (
118+
r"invalid block access list:"
119+
),
120+
BlockException.INVALID_BAL_HASH: (r"invalid block access list:"),
121+
BlockException.INVALID_BAL_MISSING_ACCOUNT: (
122+
r"computed state diff contained mutated accounts which weren't reported in BAL"
123+
),
124+
BlockException.INVALID_BLOCK_ACCESS_LIST: (
125+
r"difference between computed state diff and BAL entry for account"
126+
r"|invalid block access list:"
127+
),
128+
BlockException.INCORRECT_BLOCK_FORMAT: (r"invalid block access list:"),
119129
}
120130

121131

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,4 +455,19 @@ class NethermindExceptionMapper(ExceptionMapper):
455455
BlockException.SYSTEM_CONTRACT_CALL_FAILED: (
456456
r"(Withdrawals|Consolidations)Failed: Contract execution failed\."
457457
),
458+
# BAL Exceptions: TODO - review once all clients completed.
459+
BlockException.INVALID_BAL_EXTRA_ACCOUNT: (
460+
r"could not be parsed as a block: Could not decode block access list."
461+
),
462+
BlockException.INVALID_BAL_HASH: (r"InvalidBlockLevelAccessListRoot:"),
463+
BlockException.INVALID_BAL_MISSING_ACCOUNT: (
464+
r"InvalidBlockLevelAccessListRoot:"
465+
),
466+
BlockException.INVALID_BLOCK_ACCESS_LIST: (
467+
r"InvalidBlockLevelAccessListRoot:"
468+
r"|could not be parsed as a block: Could not decode block access list."
469+
),
470+
BlockException.INCORRECT_BLOCK_FORMAT: (
471+
r"could not be parsed as a block: Could not decode block access list."
472+
),
458473
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,18 @@ class RethExceptionMapper(ExceptionMapper):
7474
BlockException.INVALID_GAS_USED_ABOVE_LIMIT: (
7575
r"block used gas \(\d+\) is greater than gas limit \(\d+\)"
7676
),
77+
# BAL Exceptions: TODO - review once all clients completed.
78+
BlockException.INVALID_BAL_EXTRA_ACCOUNT: (
79+
r"Block BAL contains an account change that is not present in the computed BAL."
80+
),
81+
BlockException.INVALID_BAL_HASH: (r"Block's access list is invalid."),
82+
BlockException.INVALID_BAL_MISSING_ACCOUNT: (
83+
r"Block BAL is missing an account change that is present in the computed BAL."
84+
),
85+
BlockException.INVALID_BLOCK_ACCESS_LIST: (
86+
r"Block's access list is invalid."
87+
),
88+
BlockException.INCORRECT_BLOCK_FORMAT: (
89+
r"Block's access list is invalid."
90+
),
7791
}

0 commit comments

Comments
 (0)