box-prover.py: a statement mismatch names the hex offset and both tails (the 34-char prefix hid the difference on Devnet 2)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-06 21:40:28 +00:00
parent f7389dd962
commit 03287bcc78

View file

@ -257,7 +257,9 @@ while (time.time() - t_run0) / 3600 < RUN_HOURS:
if ok_shards != len(recs): seg["failed"] = "shards"; continue
pv = res.get("segment_public_values", "")
strip = lambda h: (h[2:] if h.startswith("0x") else h); strip2 = lambda h: (strip(h)[:472] + strip(h)[536:]) if len(strip(h)) == 680 else strip(h)
if strip2(pv) != strip2(expected): say(f"RESULT seg {first} FAILED: statement differs from the node's; ours {pv[:34]} node {expected[:34]}"); seg["failed"] = "statement"; continue
if strip2(pv) != strip2(expected):
a, b = strip2(pv), strip2(expected); off = next((i for i in range(min(len(a), len(b))) if a[i] != b[i]), min(len(a), len(b)))
say(f"RESULT seg {first} FAILED: statement differs from the node's at hex offset {off} (lengths {len(a)} vs {len(b)}); ours ...{a[max(0,off-8):off+56]} node ...{b[max(0,off-8):off+56]}"); seg["failed"] = "statement"; continue
last_hash = next(s["hash"] for s in picked["shards"] if s["number"] == last)
sg = subprocess.run([f"{B}/igneum-miner", "sign-segment-record", LABEL, CHAIN, str(first), str(last), last_hash, WALLET, pv, res["segment_proof_sha256"]], capture_output=True, text=True).stdout.strip().split("\n")[-1]
try: record = json.loads(sg).get("record")