Skip to content

Commit 9c9a63f

Browse files
committed
fix gas limits
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent a47f800 commit 9c9a63f

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

tests/zkevm/test_worst_bytecode.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,9 @@
1010
import pytest
1111

1212
from ethereum_test_forks import Fork
13-
from ethereum_test_tools import (
14-
Account,
15-
Alloc,
16-
Block,
17-
BlockchainTestFiller,
18-
Environment,
19-
Hash,
20-
Transaction,
21-
While,
22-
compute_create2_address,
23-
)
13+
from ethereum_test_tools import (Account, Alloc, Block, BlockchainTestFiller,
14+
Environment, Hash, Transaction, While,
15+
compute_create2_address)
2416
from ethereum_test_tools.vm.opcode import Opcodes as Op
2517

2618
REFERENCE_SPEC_GIT_PATH = "TODO"

tests/zkevm/test_worst_compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def test_worst_ecrecover(
195195
+ Op.MSTORE(3 * 32, 0x789D1DD423D25F0772D2748D60F7E4B81BB14D086EBA8E8E8EFB6DCFF8A4AE02)
196196
)
197197

198-
attack_block = Op.STATICCALL(ECRECOVER_GAS_COST, 0x1, 0, 32 * 4, 0, 0) + Op.POP
198+
attack_block = Op.POP(Op.STATICCALL(ECRECOVER_GAS_COST, 0x1, 0, 32 * 4, 0, 0))
199199
code = code_loop_precompile_call(calldata, attack_block)
200200
code_address = pre.deploy_contract(code=bytes(code))
201201

@@ -218,7 +218,7 @@ def test_worst_ecrecover(
218218

219219
def code_loop_precompile_call(calldata: Bytecode, attack_block: Bytecode):
220220
"""Create a code loop that calls a precompile with the given calldata."""
221-
# The attack contract is: JUMPDEST + [attack_block]* + PUSH0 + JUMP
221+
# The attack contract is: CALLDATA_PREP + #JUMPDEST + [attack_block]* + JUMP(#)
222222
jumpdest = Op.JUMPDEST
223223
jump_back = Op.JUMP(len(calldata))
224224
max_iters_loop = (MAX_CODE_SIZE - len(calldata) - len(jumpdest) - len(jump_back)) // len(

0 commit comments

Comments
 (0)