diff --git a/src/ethereum_test_tools/exceptions/evmone_exceptions.py b/src/ethereum_test_tools/exceptions/evmone_exceptions.py index 754af7681d..2b1b8f8f47 100644 --- a/src/ethereum_test_tools/exceptions/evmone_exceptions.py +++ b/src/ethereum_test_tools/exceptions/evmone_exceptions.py @@ -49,6 +49,7 @@ class EvmoneExceptionMapper: ExceptionMessage(EOFException.UNREACHABLE_INSTRUCTIONS, "err: unreachable_instructions"), ExceptionMessage(EOFException.INVALID_RJUMP_DESTINATION, "err: invalid_rjump_destination"), ExceptionMessage(EOFException.UNREACHABLE_CODE_SECTIONS, "err: unreachable_code_sections"), + ExceptionMessage(EOFException.INVALID_DATALOADN_INDEX, "err: invalid_dataloadn_index"), ) def __init__(self) -> None: diff --git a/src/ethereum_test_tools/exceptions/exceptions.py b/src/ethereum_test_tools/exceptions/exceptions.py index 8a3e75cde2..b200a0e4cf 100644 --- a/src/ethereum_test_tools/exceptions/exceptions.py +++ b/src/ethereum_test_tools/exceptions/exceptions.py @@ -307,6 +307,10 @@ class EOFException(ExceptionBase): """ EOF container's body have code sections that are unreachable """ + INVALID_DATALOADN_INDEX = auto() + """ + A DATALOADN instruction has out-of-bounds index for the data section + """ """ diff --git a/tests/prague/eip7692_eof_v1/eip7480_data_section/test_code_validation.py b/tests/prague/eip7692_eof_v1/eip7480_data_section/test_code_validation.py index 650e383cee..3cf3658423 100644 --- a/tests/prague/eip7692_eof_v1/eip7480_data_section/test_code_validation.py +++ b/tests/prague/eip7692_eof_v1/eip7480_data_section/test_code_validation.py @@ -128,7 +128,7 @@ max_stack_height=1, ), ], - validity_error=EOFException.DEFAULT_EXCEPTION, + validity_error=EOFException.INVALID_DATALOADN_INDEX, ), Container( name="DATALOADN_max_small_data", @@ -141,7 +141,7 @@ ), Section.Data(data="1122334455667788" * 16), ], - validity_error=EOFException.DEFAULT_EXCEPTION, + validity_error=EOFException.INVALID_DATALOADN_INDEX, ), Container( name="DATALOADN_max_half_data", @@ -154,7 +154,7 @@ ), Section.Data(data=("1122334455667788" * 4 * 1024)[2:]), ], - validity_error=EOFException.DEFAULT_EXCEPTION, + validity_error=EOFException.INVALID_DATALOADN_INDEX, ), ]