Skip to content

fix(tests): fixed test_push.py::test_stack_overflow test by reducing contract size to below allowed max #2002

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

Merged
merged 5 commits into from
Aug 12, 2025
Merged
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion tests/frontier/opcodes/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ethereum_test_forks import Fork, Frontier, Homestead
from ethereum_test_tools import Account, Alloc, Environment, StateTestFiller, Transaction
from ethereum_test_tools import Opcodes as Op
from ethereum_test_vm.bytecode import Bytecode


def get_input_for_push_opcode(opcode: Op) -> bytes:
Expand Down Expand Up @@ -112,7 +113,11 @@ def test_stack_overflow(
| SSTORE | | [0]: excerpt |
+---------------------------------------------------+
"""
contract_code = push_opcode(excerpt) * stack_height + Op.SSTORE
contract_code: Bytecode = Bytecode()
for _ in range(stack_height - 2):
contract_code += Op.PUSH0 # mostly use push0 to avoid contract size limit exceeded
contract_code += push_opcode(excerpt) * 2 + Op.SSTORE

contract = pre.deploy_contract(contract_code)

tx = Transaction(
Expand Down
Loading