Skip to content

Commit

Permalink
fix(tests): EIP-7620,EIP-3540: Failing EOF tests (#594)
Browse files Browse the repository at this point in the history
* EOF fixes

* fix(tests): EIP7620: test_eofcreate_failures.py test

* fix(tests): EIP-7692: skip another test, add function signature for new test
  • Loading branch information
marioevz authored Jun 6, 2024
1 parent 7b868ac commit cca7878
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
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"),
),
],
)
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

0 comments on commit cca7878

Please sign in to comment.