Skip to content
This repository was archived by the owner on Sep 12, 2026. It is now read-only.

Commit e9cd16d

Browse files
committed
missing MAX_LOG_BYTECODE in verifier.py
1 parent 9363053 commit e9cd16d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎python-verifier/verifier.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,7 @@ def verify_constraints(
10341034
# VM statement, layout, and AIR -----------------------------------------------
10351035

10361036
FAMILY_DIGEST = bytes.fromhex("afed7472c6f771a857599272ff33a4da86b21f2600f057fa0da797d15863eb58")
1037+
MAX_LOG_BYTECODE = 32
10371038
BASES = (6, 21, 36, 44, 59, 77, 112)
10381039
WIDTHS = (15, 15, 8, 15, 18, 35, 11)
10391040
CONSTRAINT_COUNTS = (0, 0, 0, 0, 2, 0, 0)
@@ -1143,6 +1144,9 @@ def parse(cls, data: dict[str, Any]) -> "Program":
11431144
operations = tuple(Operation.parse(item) for item in encoded)
11441145
require(bool(operations) and not len(operations) & (len(operations) - 1),
11451146
"program length must be a nonzero power of two")
1147+
# One of the public instance caps the counting arguments rest on (doc
1148+
# sec:bytecode, sec:memchan): reject an oversized announcement outright.
1149+
require(len(operations) <= 1 << MAX_LOG_BYTECODE, "program exceeds the bytecode cap")
11461150
return cls(operations)
11471151

11481152
def digest(self) -> tuple[int, int, int, int]:

0 commit comments

Comments
 (0)