Last active
May 2, 2025 01:28
-
-
Save jsign/a572fd2ccf5e7320322f7e79f2990685 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.mark.zkevm | |
@pytest.mark.valid_from("Cancun") | |
@pytest.mark.parametrize( | |
"gas_limit", | |
[ | |
36_000_000, | |
], | |
) | |
def test_worst_jumpdest( | |
blockchain_test: BlockchainTestFiller, | |
pre: Alloc, | |
fork: Fork, | |
gas_limit: int, | |
): | |
"""Test running a block with as many JUMPDEST calls as possible.""" | |
env = Environment(gas_limit=gas_limit) | |
# code = sum([Op.JUMP(Op.ADD(5, Op.PC))+Op.JUMPDEST] * (MAX_CODE_SIZE // 6)) | |
code = sum([Op.PUSH0+Op.POP] * (MAX_CODE_SIZE // 2)) | |
code_address = pre.deploy_contract(code=bytes(code)) | |
tx = Transaction( | |
to=code_address, | |
gas_limit=gas_limit, | |
gas_price=10, | |
sender=pre.fund_eoa(), | |
data=[], | |
value=0, | |
) | |
blockchain_test( | |
env=env, | |
pre=pre, | |
post={}, | |
blocks=[Block(txs=[tx])], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment