File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,12 @@ def max_code_size(cls) -> int:
480
480
"""Return the maximum code size allowed to be deployed in a contract creation."""
481
481
pass
482
482
483
+ @classmethod
484
+ @abstractmethod
485
+ def max_stack_height (cls ) -> int :
486
+ """Return the maximum stack height allowed in the EVM stack."""
487
+ pass
488
+
483
489
@classmethod
484
490
@abstractmethod
485
491
def max_initcode_size (cls ) -> int :
Original file line number Diff line number Diff line change @@ -380,6 +380,11 @@ def max_code_size(cls) -> int:
380
380
"""However, the default is set to the limit of EIP-170 (Spurious Dragon)"""
381
381
return 0x6000
382
382
383
+ @classmethod
384
+ def max_stack_height (cls ) -> int :
385
+ """At genesis, the maximum stack height is 1024."""
386
+ return 1024
387
+
383
388
@classmethod
384
389
def max_initcode_size (cls ) -> int :
385
390
"""At genesis, there is no upper bound for initcode size."""
Original file line number Diff line number Diff line change 41
41
REFERENCE_SPEC_GIT_PATH = "TODO"
42
42
REFERENCE_SPEC_VERSION = "TODO"
43
43
44
- MAX_STACK_HEIGHT = 1024
45
44
KECCAK_RATE = 136
46
45
47
46
@@ -90,7 +89,7 @@ def test_worst_zero_param(
90
89
"""Test running a block with as many zero-parameter opcodes as possible."""
91
90
env = Environment ()
92
91
93
- opcode_sequence = opcode * MAX_STACK_HEIGHT
92
+ opcode_sequence = opcode * fork . max_stack_height ()
94
93
target_contract_address = pre .deploy_contract (code = opcode_sequence )
95
94
96
95
calldata = Bytecode ()
You can’t perform that action at this time.
0 commit comments