Skip to content

Commit cca7878

Browse files
authored
fix(tests): EIP-7620,EIP-3540: Failing EOF tests (#594)
* EOF fixes * fix(tests): EIP7620: test_eofcreate_failures.py test * fix(tests): EIP-7692: skip another test, add function signature for new test
1 parent 7b868ac commit cca7878

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

tests/prague/eip7692_eof_v1/eip3540_eof_v1/container.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,10 @@
401401
name="trailing_bytes_after_data_section",
402402
extra=bytes([0xEE]),
403403
sections=[
404-
Section.Code(code=Op.PUSH1(0) + Op.STOP),
404+
Section.Code(
405+
code=Op.PUSH1(0) + Op.STOP,
406+
code_outputs=NON_RETURNING_SECTION,
407+
),
405408
Section.Data(data="0xAABBCCDD"),
406409
],
407410
# TODO should be more specific exception about trailing bytes

tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_example_valid_invalid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def test_example_valid_invalid(
423423
False, # but it's code input bytes still listed in container's body
424424
False, # but it's code input bytes size still added to types section size
425425
"ef000101000802000100030400040000800001000000003050003050000bad60A7",
426-
EOFException.INVALID_SECTION_BODIES_SIZE,
426+
EOFException.INVALID_TYPE_SECTION_SIZE,
427427
),
428428
(
429429
False, # second section is mentioned in code header array (0003)

tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,16 @@ def test_initcode_aborts(
167167
pytest.param(MAX_BYTECODE_SIZE, id="max"),
168168
pytest.param(MAX_BYTECODE_SIZE + 1, id="overmax"),
169169
pytest.param(MAX_INITCODE_SIZE - factory_size, id="initcodemax"),
170-
pytest.param(MAX_INITCODE_SIZE - factory_size + 1, id="initcodeovermax"),
171-
pytest.param(0xFFFF - factory_size, id="64k-1"),
170+
pytest.param(
171+
MAX_INITCODE_SIZE - factory_size + 1,
172+
id="initcodeovermax",
173+
marks=pytest.mark.skip("Oversized container in pre-alloc"),
174+
),
175+
pytest.param(
176+
0xFFFF - factory_size,
177+
id="64k-1",
178+
marks=pytest.mark.skip("Oversized container in pre-alloc"),
179+
),
172180
],
173181
)
174182
def test_eofcreate_deploy_sizes(
@@ -249,6 +257,29 @@ def test_eofcreate_deploy_sizes(
249257
state_test(env=env, pre=pre, post=post, tx=simple_transaction())
250258

251259

260+
@pytest.mark.parametrize(
261+
"target_deploy_size",
262+
[
263+
pytest.param(0x4000, id="large"),
264+
pytest.param(MAX_BYTECODE_SIZE, id="max"),
265+
pytest.param(MAX_BYTECODE_SIZE + 1, id="overmax"),
266+
pytest.param(MAX_INITCODE_SIZE - factory_size, id="initcodemax"),
267+
pytest.param(MAX_INITCODE_SIZE - factory_size + 1, id="initcodeovermax"),
268+
pytest.param(0xFFFF - factory_size, id="64k-1"),
269+
],
270+
)
271+
@pytest.mark.skip("Not implemented")
272+
def test_eofcreate_deploy_sizes_tx(
273+
state_test: StateTestFiller,
274+
target_deploy_size: int,
275+
):
276+
"""
277+
Verifies a mix of runtime contract sizes mixing success and multiple size failure modes
278+
where the initcontainer is included in a transaction
279+
"""
280+
raise NotImplementedError("Not implemented")
281+
282+
252283
@pytest.mark.parametrize(
253284
"auxdata_size",
254285
[

0 commit comments

Comments
 (0)