Skip to content
Open
Changes from all commits
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
21 changes: 21 additions & 0 deletions sweep_layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def parse_args() -> argparse.Namespace:
action="store_true",
help="Emit a JSON summary of all rows to stdout after the table.",
)
parser.add_argument(
"--check-schema",
action="store_true",
help="Verify that JSON from app.py contains all expected keys.",
)

parser.add_argument(
"--leaf-min",
Expand Down Expand Up @@ -149,6 +154,22 @@ def main() -> None:
except Exception as e: # noqa: BLE001
print(f"ERROR: {e}", file=sys.stderr)
continue
if args.check_schema:
required_keys = [
"treeHeight",
"totalNodes",
"proofBranchLength",
"perProofBytes",
"totalCommitmentBytes",
]
missing = [k for k in required_keys if k not in data]
if missing:
print(
f"ERROR: JSON from app.py is missing keys: {missing} "
f"(leaves={leaves}, fanout={fanout})",
file=sys.stderr,
)
continue

# keys are based on README description; tweak if you change app.py
tree_height = data.get("treeHeight")
Expand Down