Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): EIP-7620,EIP-3540: Failing EOF tests #594

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/prague/eip7692_eof_v1/eip3540_eof_v1/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@
name="trailing_bytes_after_data_section",
extra=bytes([0xEE]),
sections=[
Section.Code(code=Op.PUSH1(0) + Op.STOP),
Section.Code(
code=Op.PUSH1(0) + Op.STOP,
code_outputs=NON_RETURNING_SECTION,
),
Section.Data(data="0xAABBCCDD"),
],
# TODO should be more specific exception about trailing bytes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def test_example_valid_invalid(
False, # but it's code input bytes still listed in container's body
False, # but it's code input bytes size still added to types section size
"ef000101000802000100030400040000800001000000003050003050000bad60A7",
EOFException.INVALID_SECTION_BODIES_SIZE,
EOFException.INVALID_TYPE_SECTION_SIZE,
),
(
False, # second section is mentioned in code header array (0003)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,16 @@ def test_initcode_aborts(
pytest.param(MAX_BYTECODE_SIZE, id="max"),
pytest.param(MAX_BYTECODE_SIZE + 1, id="overmax"),
pytest.param(MAX_INITCODE_SIZE - factory_size, id="initcodemax"),
pytest.param(MAX_INITCODE_SIZE - factory_size + 1, id="initcodeovermax"),
pytest.param(0xFFFF - factory_size, id="64k-1"),
pytest.param(
MAX_INITCODE_SIZE - factory_size + 1,
id="initcodeovermax",
marks=pytest.mark.skip("Oversized container in pre-alloc"),
),
pytest.param(
0xFFFF - factory_size,
id="64k-1",
marks=pytest.mark.skip("Oversized container in pre-alloc"),
marioevz marked this conversation as resolved.
Show resolved Hide resolved
),
],
)
def test_eofcreate_deploy_sizes(
Expand Down Expand Up @@ -249,6 +257,29 @@ def test_eofcreate_deploy_sizes(
state_test(env=env, pre=pre, post=post, tx=simple_transaction())


@pytest.mark.parametrize(
"target_deploy_size",
[
pytest.param(0x4000, id="large"),
pytest.param(MAX_BYTECODE_SIZE, id="max"),
pytest.param(MAX_BYTECODE_SIZE + 1, id="overmax"),
pytest.param(MAX_INITCODE_SIZE - factory_size, id="initcodemax"),
pytest.param(MAX_INITCODE_SIZE - factory_size + 1, id="initcodeovermax"),
pytest.param(0xFFFF - factory_size, id="64k-1"),
],
)
@pytest.mark.skip("Not implemented")
def test_eofcreate_deploy_sizes_tx(
state_test: StateTestFiller,
target_deploy_size: int,
):
"""
Verifies a mix of runtime contract sizes mixing success and multiple size failure modes
where the initcontainer is included in a transaction
"""
raise NotImplementedError("Not implemented")


@pytest.mark.parametrize(
"auxdata_size",
[
Expand Down