Skip to content

Commit ad4e4e9

Browse files
committed
✨ feat(zkevm): zkevm - proof eater
1 parent cd3229e commit ad4e4e9

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/zkevm/test_proof_size.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def get_proofs(pre: Alloc, proof_count: int) -> List[Address]:
6060
return proofs
6161

6262

63+
def get_proof_eater(pre: Alloc, proof_count: int) -> Address:
64+
"""Generate a proof eater contract that ingests a given proofs."""
65+
proofs = get_proofs(pre, proof_count)
66+
code = sum([Op.EXTCODESIZE(proofs[i]) for i in range(proof_count)])
67+
return pre.deploy_contract(code=code)
68+
69+
6370
##############################
6471
# #
6572
# Test Cases #
@@ -88,13 +95,8 @@ def test_via_opcode(
8895

8996
# MAX_NUM_CONTRACT_CALLS = (gas_limit - 21_000) // (3 + 2600)
9097

91-
proof_addresses = get_proofs(pre, num_called_contracts)
92-
93-
attack_code = sum([Op.EXTCODESIZE(proof_addresses[i]) for i in range(num_called_contracts)])
94-
attack_contract = pre.deploy_contract(code=attack_code)
95-
9698
tx = Transaction(
97-
to=attack_contract,
99+
to=get_proof_eater(pre, num_called_contracts),
98100
gas_limit=gas_limit,
99101
gas_price=10,
100102
sender=pre.fund_eoa(),

0 commit comments

Comments
 (0)