Skip to content

Commit 1574434

Browse files
committed
feat(exceptions,clis): Add system contract failures
1 parent 074dbc0 commit 1574434

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Test fixtures for use by clients are available for each release on the [Github r
2020

2121
- 🐞 Fix fixture tarball downloading with regular, non-Github release URLS and with numerical versions in regular release specs, e.g., `[email protected]` ([#1437](https://github.com/ethereum/execution-spec-tests/pull/1437)).
2222

23+
#### Exceptions
24+
25+
- ✨ New exceptions `BlockException.SYSTEM_CONTRACT_EMPTY` and `BlockException.SYSTEM_CONTRACT_CALL_FAILED` to handle EIP updates [#9508](https://github.com/ethereum/EIPs/pull/9508) and [#9582](https://github.com/ethereum/EIPs/pull/9582) ([#1394](https://github.com/ethereum/execution-spec-tests/pull/1394)).
26+
2327
### 🧪 Test Cases
2428

2529
-[EIP-7702](https://eips.ethereum.org/EIPS/eip-7702): Test precompile case in same transaction as delegation without extra gas in case of precompile code execution; parametrize all call opcodes in existing precompile test ([#1431](https://github.com/ethereum/execution-spec-tests/pull/1431)).

src/ethereum_clis/clis/execution_specs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from typing import ClassVar, Dict, List, Optional
1414

1515
from ethereum_test_exceptions import (
16+
BlockException,
1617
EOFException,
1718
ExceptionBase,
1819
ExceptionMapper,
@@ -159,6 +160,8 @@ class ExecutionSpecsExceptionMapper(ExceptionMapper):
159160
TransactionException.TYPE_3_TX_CONTRACT_CREATION: "ction: ",
160161
TransactionException.NONCE_IS_MAX: "tion: ",
161162
TransactionException.GAS_ALLOWANCE_EXCEEDED: "ion: ",
163+
BlockException.SYSTEM_CONTRACT_EMPTY: "System contract address",
164+
BlockException.SYSTEM_CONTRACT_CALL_FAILED: "call failed:",
162165
# TODO EVMONE needs to differentiate when the section is missing in the header or body
163166
EOFException.MISSING_STOP_OPCODE: "err: no_terminating_instruction",
164167
EOFException.MISSING_CODE_HEADER: "err: code_section_missing",

src/ethereum_test_exceptions/exceptions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,14 @@ class BlockException(ExceptionBase):
574574
"""
575575
Trying to import a block after paris fork that has difficulty != 0.
576576
"""
577+
SYSTEM_CONTRACT_EMPTY = auto()
578+
"""
579+
A system contract address contains no code at the end of fork activation block.
580+
"""
581+
SYSTEM_CONTRACT_CALL_FAILED = auto()
582+
"""
583+
A system contract call at the end of block execution (from the system address) fails.
584+
"""
577585

578586

579587
@unique

0 commit comments

Comments
 (0)