Skip to content

Commit

Permalink
fix(fw): EOF - add EOFException.INVALID_DATALOADN_INDEX (ethereum#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored and spencer-tb committed May 20, 2024
1 parent cdb8a76 commit d1228d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/ethereum_test_tools/exceptions/evmone_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions src/ethereum_test_tools/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""


"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -154,7 +154,7 @@
),
Section.Data(data=("1122334455667788" * 4 * 1024)[2:]),
],
validity_error=EOFException.DEFAULT_EXCEPTION,
validity_error=EOFException.INVALID_DATALOADN_INDEX,
),
]

Expand Down

0 comments on commit d1228d0

Please sign in to comment.