Skip to content

Commit e0cd6da

Browse files
committed
refactor(tests): Rename stack height constants
Rename `MAX_RUNTIME_OPERAND_STACK_HEIGHT` to `MAX_RUNTIME_STACK_HEIGHT` and move it to the ethereum_test_types.eof. Rename `MAX_OPERAND_STACK_HEIGHT` to `MAX_STACK_INCREASE_LIMIT` to indicate it is related specifically to the EOF container format.
1 parent 91687b7 commit e0cd6da

File tree

11 files changed

+59
-50
lines changed

11 files changed

+59
-50
lines changed

src/ethereum_test_tools/eof/v1/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
MAX_CODE_OUTPUTS,
1111
MAX_CODE_SECTIONS,
1212
MAX_INITCODE_SIZE,
13-
MAX_OPERAND_STACK_HEIGHT,
1413
MAX_RETURN_STACK_HEIGHT,
1514
MAX_RJUMPV_COUNT,
15+
MAX_STACK_INCREASE_LIMIT,
1616
NON_RETURNING_SECTION,
1717
TYPES_INPUTS_BYTE_LENGTH,
1818
TYPES_OUTPUTS_BYTE_LENGTH,
@@ -31,7 +31,7 @@
3131
"MAX_CODE_OUTPUTS",
3232
"MAX_CODE_SECTIONS",
3333
"MAX_INITCODE_SIZE",
34-
"MAX_OPERAND_STACK_HEIGHT",
34+
"MAX_STACK_INCREASE_LIMIT",
3535
"MAX_RETURN_STACK_HEIGHT",
3636
"MAX_RJUMPV_COUNT",
3737
"NON_RETURNING_SECTION",

src/ethereum_test_types/eof/constants.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@
2020
"""
2121
Length of the version byte.
2222
"""
23+
24+
MAX_RUNTIME_STACK_HEIGHT = 1024
25+
"""
26+
Maximum height of the EVM runtime operand stack.
27+
Exceeding this value during execution will result in the stack overflow exception.
28+
This value applies to both legacy EVM and EOF.
29+
"""

src/ethereum_test_types/eof/v1/constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
MAX_RETURN_STACK_HEIGHT = 1024
1515

16-
MAX_OPERAND_STACK_HEIGHT = 1023
16+
MAX_STACK_INCREASE_LIMIT = 0x3FF
17+
"""
18+
Maximum value for the max stack increase accepted by the EOF format.
19+
"""
1720

1821
MAX_CODE_INPUTS = 127
1922

tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_all_opcodes_in_container.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from ethereum_test_tools import EOFException, EOFTestFiller, Opcode, UndefinedOpcodes
99
from ethereum_test_tools import Opcodes as Op
1010
from ethereum_test_tools.eof.v1 import Container, ContainerKind, Section
11-
from ethereum_test_tools.eof.v1.constants import MAX_OPERAND_STACK_HEIGHT
11+
from ethereum_test_tools.eof.v1.constants import MAX_STACK_INCREASE_LIMIT
12+
from ethereum_test_types.eof.constants import MAX_RUNTIME_STACK_HEIGHT
1213
from ethereum_test_vm import Bytecode
1314

1415
from .. import EOF_FORK_NAME
@@ -337,7 +338,7 @@ def test_all_opcodes_stack_overflow(
337338
opcode = opcode[0] if opcode.has_data_portion() else opcode
338339

339340
assert opcode.pushed_stack_items - opcode.popped_stack_items == 1
340-
opcode_count = MAX_OPERAND_STACK_HEIGHT + 1 - opcode.min_stack_height
341+
opcode_count = MAX_RUNTIME_STACK_HEIGHT - opcode.min_stack_height
341342

342343
bytecode = Op.PUSH0 * opcode.min_stack_height
343344
bytecode += opcode * opcode_count
@@ -347,7 +348,7 @@ def test_all_opcodes_stack_overflow(
347348

348349
if exception == EOFException.INVALID_MAX_STACK_INCREASE:
349350
# Lie about the max stack height to make the code be checked for stack overflow.
350-
kwargs["max_stack_height"] = MAX_OPERAND_STACK_HEIGHT
351+
kwargs["max_stack_height"] = MAX_STACK_INCREASE_LIMIT
351352

352353
sections = [Section.Code(**kwargs)]
353354

tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_container_validation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
MAX_CODE_INPUTS,
1717
MAX_CODE_OUTPUTS,
1818
MAX_CODE_SECTIONS,
19-
MAX_OPERAND_STACK_HEIGHT,
19+
MAX_STACK_INCREASE_LIMIT,
2020
)
2121
from ethereum_test_tools.vm.opcode import Opcodes as Op
2222

@@ -37,10 +37,10 @@
3737
name="single_code_section_max_stack_size",
3838
sections=[
3939
Section.Code(
40-
code=(Op.CALLER * MAX_OPERAND_STACK_HEIGHT)
41-
+ (Op.POP * MAX_OPERAND_STACK_HEIGHT)
40+
code=(Op.CALLER * MAX_STACK_INCREASE_LIMIT)
41+
+ (Op.POP * MAX_STACK_INCREASE_LIMIT)
4242
+ Op.STOP,
43-
max_stack_height=MAX_OPERAND_STACK_HEIGHT,
43+
max_stack_height=MAX_STACK_INCREASE_LIMIT,
4444
),
4545
],
4646
),

tests/osaka/eip7692_eof_v1/eip4750_functions/test_code_validation.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@
99
from ethereum_test_tools.eof.v1.constants import (
1010
MAX_CODE_OUTPUTS,
1111
MAX_CODE_SECTIONS,
12-
MAX_OPERAND_STACK_HEIGHT,
12+
MAX_STACK_INCREASE_LIMIT,
1313
)
1414
from ethereum_test_tools.vm.opcode import Opcodes as Op
15+
from ethereum_test_types.eof.constants import MAX_RUNTIME_STACK_HEIGHT
1516

1617
from .. import EOF_FORK_NAME
1718

1819
REFERENCE_SPEC_GIT_PATH = "EIPS/eip-4750.md"
1920
REFERENCE_SPEC_VERSION = "14400434e1199c57d912082127b1d22643788d11"
2021

21-
MAX_RUNTIME_OPERAND_STACK_HEIGHT = 1024
22-
"""Maximum height of the EVM runtime operand stack."""
23-
2422
pytestmark = pytest.mark.valid_from(EOF_FORK_NAME)
2523

2624
VALID: List[Container] = [
@@ -652,12 +650,12 @@ def test_callf_stack_height_limit_exceeded(eof_test, callee_outputs):
652650
The code reaches the maximum runtime stack height (1024)
653651
which is above the EOF limit for the stack height in the type section (1023).
654652
"""
655-
callf_stack_height = MAX_RUNTIME_OPERAND_STACK_HEIGHT - callee_outputs
653+
callf_stack_height = MAX_RUNTIME_STACK_HEIGHT - callee_outputs
656654
container = Container(
657655
sections=[
658656
Section.Code(
659657
Op.PUSH0 * callf_stack_height + Op.CALLF[1] + Op.STOP,
660-
max_stack_height=MAX_RUNTIME_OPERAND_STACK_HEIGHT,
658+
max_stack_height=MAX_RUNTIME_STACK_HEIGHT,
661659
),
662660
Section.Code(
663661
Op.PUSH0 * callee_outputs + Op.RETF,
@@ -682,7 +680,7 @@ def test_callf_stack_overflow(eof_test: EOFTestFiller, stack_height: int):
682680
),
683681
],
684682
)
685-
stack_overflow = stack_height > MAX_RUNTIME_OPERAND_STACK_HEIGHT // 2
683+
stack_overflow = stack_height > MAX_RUNTIME_STACK_HEIGHT // 2
686684
eof_test(
687685
container=container,
688686
expect_exception=EOFException.STACK_OVERFLOW if stack_overflow else None,
@@ -707,7 +705,7 @@ def test_callf_stack_overflow_after_callf(eof_test: EOFTestFiller, stack_height:
707705
),
708706
],
709707
)
710-
stack_overflow = 1023 + stack_height > MAX_RUNTIME_OPERAND_STACK_HEIGHT
708+
stack_overflow = 1023 + stack_height > MAX_RUNTIME_STACK_HEIGHT
711709
eof_test(
712710
container=container,
713711
expect_exception=EOFException.STACK_OVERFLOW if stack_overflow else None,
@@ -721,7 +719,7 @@ def test_callf_stack_overflow_variable_stack(eof_test: EOFTestFiller, stack_heig
721719
sections=[
722720
Section.Code(
723721
code=Op.RJUMPI[2](0)
724-
+ Op.PUSH0 * (MAX_RUNTIME_OPERAND_STACK_HEIGHT // 2)
722+
+ Op.PUSH0 * (MAX_RUNTIME_STACK_HEIGHT // 2)
725723
+ Op.CALLF[1]
726724
+ Op.STOP,
727725
max_stack_height=512,
@@ -733,7 +731,7 @@ def test_callf_stack_overflow_variable_stack(eof_test: EOFTestFiller, stack_heig
733731
),
734732
],
735733
)
736-
stack_overflow = stack_height > MAX_RUNTIME_OPERAND_STACK_HEIGHT // 2
734+
stack_overflow = stack_height > MAX_RUNTIME_STACK_HEIGHT // 2
737735
eof_test(
738736
container=container,
739737
expect_exception=EOFException.STACK_OVERFLOW if stack_overflow else None,
@@ -749,7 +747,7 @@ def test_callf_stack_overflow_variable_stack_2(eof_test: EOFTestFiller, stack_he
749747
code=Op.PUSH0 * 2
750748
+ Op.RJUMPI[2](0)
751749
+ Op.POP * 2
752-
+ Op.PUSH0 * (MAX_RUNTIME_OPERAND_STACK_HEIGHT // 2)
750+
+ Op.PUSH0 * (MAX_RUNTIME_STACK_HEIGHT // 2)
753751
+ Op.CALLF[1]
754752
+ Op.STOP,
755753
max_stack_height=514,
@@ -761,7 +759,7 @@ def test_callf_stack_overflow_variable_stack_2(eof_test: EOFTestFiller, stack_he
761759
),
762760
],
763761
)
764-
stack_overflow = stack_height > (MAX_RUNTIME_OPERAND_STACK_HEIGHT // 2) - 2
762+
stack_overflow = stack_height > (MAX_RUNTIME_STACK_HEIGHT // 2) - 2
765763
eof_test(
766764
container=container,
767765
expect_exception=EOFException.STACK_OVERFLOW if stack_overflow else None,
@@ -775,7 +773,7 @@ def test_callf_stack_overflow_variable_stack_3(eof_test: EOFTestFiller, stack_he
775773
sections=[
776774
Section.Code(
777775
code=Op.RJUMPI[2](0)
778-
+ Op.PUSH0 * (MAX_RUNTIME_OPERAND_STACK_HEIGHT - 1)
776+
+ Op.PUSH0 * (MAX_RUNTIME_STACK_HEIGHT - 1)
779777
+ Op.CALLF[1]
780778
+ Op.STOP,
781779
max_stack_height=1023,
@@ -789,7 +787,7 @@ def test_callf_stack_overflow_variable_stack_3(eof_test: EOFTestFiller, stack_he
789787
)
790788
assert container.sections[0].max_stack_height is not None
791789
stack_overflow = (
792-
container.sections[0].max_stack_height + stack_height > MAX_RUNTIME_OPERAND_STACK_HEIGHT
790+
container.sections[0].max_stack_height + stack_height > MAX_RUNTIME_STACK_HEIGHT
793791
)
794792
eof_test(
795793
container=container,
@@ -805,7 +803,7 @@ def test_callf_stack_overflow_variable_stack_4(eof_test: EOFTestFiller):
805803
code=Op.PUSH0 * 2
806804
+ Op.RJUMPI[2](0)
807805
+ Op.POP * 2
808-
+ Op.PUSH0 * (MAX_RUNTIME_OPERAND_STACK_HEIGHT - 1)
806+
+ Op.PUSH0 * (MAX_RUNTIME_STACK_HEIGHT - 1)
809807
+ Op.CALLF[1]
810808
+ Op.STOP,
811809
max_stack_height=1023,
@@ -930,7 +928,7 @@ def test_callf_with_inputs_stack_overflow(
930928
exception = None
931929
if (
932930
push_stack + code_section.max_stack_height - code_section.code_inputs
933-
> MAX_RUNTIME_OPERAND_STACK_HEIGHT
931+
> MAX_RUNTIME_STACK_HEIGHT
934932
):
935933
exception = EOFException.STACK_OVERFLOW
936934
elif push_stack - code_section.code_inputs + code_section.code_outputs - pop_stack < 2:
@@ -1061,7 +1059,7 @@ def test_callf_with_inputs_stack_overflow_variable_stack(
10611059
exception = None
10621060
if (
10631061
push_stack + initial_stack + code_section.max_stack_height - code_section.code_inputs
1064-
> MAX_RUNTIME_OPERAND_STACK_HEIGHT
1062+
> MAX_RUNTIME_STACK_HEIGHT
10651063
):
10661064
exception = EOFException.STACK_OVERFLOW
10671065
elif push_stack + initial_stack > 1023:
@@ -1072,7 +1070,7 @@ def test_callf_with_inputs_stack_overflow_variable_stack(
10721070

10731071
@pytest.mark.parametrize("callee_outputs", [1, 2, MAX_CODE_OUTPUTS - 1, MAX_CODE_OUTPUTS])
10741072
@pytest.mark.parametrize(
1075-
"max_stack_height", [0, 1, MAX_OPERAND_STACK_HEIGHT - 1, MAX_OPERAND_STACK_HEIGHT]
1073+
"max_stack_height", [0, 1, MAX_STACK_INCREASE_LIMIT - 1, MAX_STACK_INCREASE_LIMIT]
10761074
)
10771075
def test_callf_stack_overflow_by_outputs(eof_test, callee_outputs, max_stack_height):
10781076
"""
@@ -1081,7 +1079,7 @@ def test_callf_stack_overflow_by_outputs(eof_test, callee_outputs, max_stack_hei
10811079
is always above the maximum allowed in the EOF type section. Therefore, the test declares
10821080
an invalid max_stack_height.
10831081
"""
1084-
callf_stack_height = (MAX_RUNTIME_OPERAND_STACK_HEIGHT + 1) - callee_outputs
1082+
callf_stack_height = (MAX_RUNTIME_STACK_HEIGHT + 1) - callee_outputs
10851083
container = Container(
10861084
sections=[
10871085
Section.Code(
@@ -1100,7 +1098,7 @@ def test_callf_stack_overflow_by_outputs(eof_test, callee_outputs, max_stack_hei
11001098

11011099
@pytest.mark.parametrize(
11021100
"callee_stack_height",
1103-
[2, 3, MAX_OPERAND_STACK_HEIGHT - 1, MAX_OPERAND_STACK_HEIGHT],
1101+
[2, 3, MAX_STACK_INCREASE_LIMIT - 1, MAX_STACK_INCREASE_LIMIT],
11041102
)
11051103
def test_callf_stack_overflow_by_height(eof_test, callee_stack_height):
11061104
"""
@@ -1112,8 +1110,8 @@ def test_callf_stack_overflow_by_height(eof_test, callee_stack_height):
11121110
container = Container(
11131111
sections=[
11141112
Section.Code(
1115-
Op.PUSH0 * MAX_OPERAND_STACK_HEIGHT + Op.CALLF[1] + Op.STOP,
1116-
max_stack_height=MAX_OPERAND_STACK_HEIGHT,
1113+
Op.PUSH0 * MAX_STACK_INCREASE_LIMIT + Op.CALLF[1] + Op.STOP,
1114+
max_stack_height=MAX_STACK_INCREASE_LIMIT,
11171115
),
11181116
Section.Code(
11191117
Op.PUSH0 * callee_stack_height + Op.POP * callee_stack_height + Op.RETF,

tests/osaka/eip7692_eof_v1/eip5450_stack/test_code_validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ethereum_test_tools import Account, EOFStateTestFiller, EOFTestFiller
1111
from ethereum_test_tools.eof.v1 import Container, Section
1212
from ethereum_test_tools.vm.opcode import Opcodes as Op
13-
from ethereum_test_types.eof.v1.constants import MAX_OPERAND_STACK_HEIGHT, NON_RETURNING_SECTION
13+
from ethereum_test_types.eof.v1.constants import MAX_STACK_INCREASE_LIMIT, NON_RETURNING_SECTION
1414
from ethereum_test_vm.bytecode import Bytecode
1515

1616
from .. import EOF_FORK_NAME
@@ -457,7 +457,7 @@ def gen_stack_underflow_params():
457457
yield op, op.min_stack_height - 1
458458

459459

460-
@pytest.mark.parametrize("spread", [-1, 0, 1, MAX_OPERAND_STACK_HEIGHT])
460+
@pytest.mark.parametrize("spread", [-1, 0, 1, MAX_STACK_INCREASE_LIMIT])
461461
@pytest.mark.parametrize("op,stack_height", gen_stack_underflow_params())
462462
def test_all_opcodes_stack_underflow(
463463
eof_test: EOFTestFiller, op: Op, stack_height: int, spread: int
@@ -473,7 +473,7 @@ def test_all_opcodes_stack_underflow(
473473
# We need to leave space for this increase not to cause stack overflow.
474474
max_stack_increase = max(op.pushed_stack_items - op.popped_stack_items, 0)
475475
# Cap the spread if it would exceed the maximum stack height.
476-
spread = min(spread, MAX_OPERAND_STACK_HEIGHT - (stack_height + max_stack_increase))
476+
spread = min(spread, MAX_STACK_INCREASE_LIMIT - (stack_height + max_stack_increase))
477477
# Create a range stack height of 0-spread.
478478
code += Op.RJUMPI[spread](Op.CALLVALUE) + Op.PUSH0 * spread
479479

tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_stack.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from ethereum_test_tools import Account, EOFException, EOFStateTestFiller
77
from ethereum_test_tools.eof.v1 import Container, Section
88
from ethereum_test_tools.vm.opcode import Opcodes as Op
9+
from ethereum_test_types.eof.constants import MAX_RUNTIME_STACK_HEIGHT
910

1011
from .. import EOF_FORK_NAME
11-
from ..eip4750_functions.test_code_validation import MAX_RUNTIME_OPERAND_STACK_HEIGHT
1212
from .helpers import slot_code_worked, value_code_worked
1313

1414
REFERENCE_SPEC_GIT_PATH = "EIPS/eip-6206.md"
@@ -310,7 +310,7 @@ def test_jumpf_variadic_stack_overflow(
310310
),
311311
],
312312
validity_error=EOFException.STACK_OVERFLOW
313-
if stack_height + callee_stack_height > MAX_RUNTIME_OPERAND_STACK_HEIGHT
313+
if stack_height + callee_stack_height > MAX_RUNTIME_STACK_HEIGHT
314314
else None,
315315
)
316316
eof_test(container=container)
@@ -335,7 +335,7 @@ def test_jumpf_with_inputs_stack_overflow(
335335
),
336336
],
337337
validity_error=EOFException.STACK_OVERFLOW
338-
if stack_height + callee_stack_increase > MAX_RUNTIME_OPERAND_STACK_HEIGHT
338+
if stack_height + callee_stack_increase > MAX_RUNTIME_STACK_HEIGHT
339339
else None,
340340
)
341341
eof_test(container=container)
@@ -360,7 +360,7 @@ def test_jumpf_with_inputs_stack_overflow_variable_stack(
360360
),
361361
],
362362
validity_error=EOFException.STACK_OVERFLOW
363-
if stack_height + callee_stack_increase > MAX_RUNTIME_OPERAND_STACK_HEIGHT
363+
if stack_height + callee_stack_increase > MAX_RUNTIME_STACK_HEIGHT
364364
else None,
365365
)
366366
eof_test(container=container)

tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from ethereum_test_tools import EOFException, EOFTestFiller
66
from ethereum_test_tools.eof.v1 import Container, Section
77
from ethereum_test_tools.vm.opcode import Opcodes as Op
8+
from ethereum_test_types.eof.constants import MAX_RUNTIME_STACK_HEIGHT
89

910
from .. import EOF_FORK_NAME
10-
from ..eip4750_functions.test_code_validation import MAX_RUNTIME_OPERAND_STACK_HEIGHT
1111

1212
REFERENCE_SPEC_GIT_PATH = "EIPS/eip-6206.md"
1313
REFERENCE_SPEC_VERSION = "2f365ea0cd58faa6e26013ea77ce6d538175f7d0"
@@ -150,7 +150,7 @@ def test_jumpf_self_stack_overflow(eof_test: EOFTestFiller, stack_height: int):
150150
),
151151
],
152152
)
153-
stack_overflow = stack_height > MAX_RUNTIME_OPERAND_STACK_HEIGHT // 2
153+
stack_overflow = stack_height > MAX_RUNTIME_STACK_HEIGHT // 2
154154
eof_test(
155155
container=container,
156156
expect_exception=EOFException.STACK_OVERFLOW if stack_overflow else None,
@@ -175,7 +175,7 @@ def test_jumpf_other_stack_overflow(
175175
),
176176
],
177177
)
178-
stack_overflow = stack_height + stack_height_other > MAX_RUNTIME_OPERAND_STACK_HEIGHT
178+
stack_overflow = stack_height + stack_height_other > MAX_RUNTIME_STACK_HEIGHT
179179
eof_test(
180180
container=container,
181181
expect_exception=EOFException.STACK_OVERFLOW if stack_overflow else None,

tests/osaka/eip7692_eof_v1/eip663_dupn_swapn_exchange/test_dupn.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Transaction,
1717
)
1818
from ethereum_test_tools.eof.v1 import Container, Section
19-
from ethereum_test_tools.eof.v1.constants import MAX_OPERAND_STACK_HEIGHT
19+
from ethereum_test_tools.eof.v1.constants import MAX_STACK_INCREASE_LIMIT
2020
from ethereum_test_tools.vm.opcode import Opcodes as Op
2121

2222
from .. import EOF_FORK_NAME
@@ -88,10 +88,10 @@ def test_dupn_stack_underflow(
8888
@pytest.mark.parametrize(
8989
"dupn_operand,max_stack_height,expect_exception",
9090
[
91-
[0, MAX_OPERAND_STACK_HEIGHT, EOFException.INVALID_MAX_STACK_INCREASE],
92-
[0, MAX_OPERAND_STACK_HEIGHT + 1, EOFException.MAX_STACK_INCREASE_ABOVE_LIMIT],
93-
[2**8 - 1, MAX_OPERAND_STACK_HEIGHT, EOFException.INVALID_MAX_STACK_INCREASE],
94-
[2**8 - 1, MAX_OPERAND_STACK_HEIGHT + 1, EOFException.MAX_STACK_INCREASE_ABOVE_LIMIT],
91+
[0, MAX_STACK_INCREASE_LIMIT, EOFException.INVALID_MAX_STACK_INCREASE],
92+
[0, MAX_STACK_INCREASE_LIMIT + 1, EOFException.MAX_STACK_INCREASE_ABOVE_LIMIT],
93+
[2**8 - 1, MAX_STACK_INCREASE_LIMIT, EOFException.INVALID_MAX_STACK_INCREASE],
94+
[2**8 - 1, MAX_STACK_INCREASE_LIMIT + 1, EOFException.MAX_STACK_INCREASE_ABOVE_LIMIT],
9595
],
9696
)
9797
def test_dupn_stack_overflow(
@@ -104,7 +104,7 @@ def test_dupn_stack_overflow(
104104
eof_code = Container(
105105
sections=[
106106
Section.Code(
107-
code=sum(Op.PUSH2[v] for v in range(0, MAX_OPERAND_STACK_HEIGHT))
107+
code=sum(Op.PUSH2[v] for v in range(0, MAX_STACK_INCREASE_LIMIT))
108108
+ Op.DUPN[dupn_operand]
109109
+ Op.STOP,
110110
max_stack_height=max_stack_height,

0 commit comments

Comments
 (0)