[BUG]: `proof.py` does not check the chain against `anchor.json`
Maintainer thường phản hồi trong vòng 2 ngày
@insanekrishnna đang làm issue này rồi.
Từ ngày 28/11/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Start with simple/proof.py around the chain loading and membership-proof construction, then compare cmd_verify and check_anchor_timestamps() in simple/ovl.py. The shared anchor-validation behavior should be exercised with the simple/proof.py CLI. Done means honest anchored chains pass, while rewritten chains and missing anchors fail unless explicitly disabled, with the expected timestamp and proof-output behavior covered by tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Description
simple/proof.py builds a membership proof from chain.jsonl, but it never reads anchor.json or its timestamps. It only checks that each entry links to the one before it. Anyone can rewrite entries and recompute the links, so a rewritten chain still passes.
ovl.py verify does check the anchor. It requires anchor.json unless --no-anchor is given, and it checks the RFC 3161 timestamps unless --no-timestamps is given. proof.py does neither.
On the same run folder:
ovl.py verifyfails withchain head differs from anchor.json.proof.pyexits 0 and reports"membership_status": "excluded"and"bound_to_chain": true.
So proof.py can say an article was excluded, or trained in segment k, for a chain that is not the published one. The "bound_to_chain": true field makes that result look verified. This goes against CONTRIBUTING rule 3 (fail closed).
Where the problem is
chain = read_chain(a.run) # checks links only
doc = find_article(a.data, a.article)
...
bound, data_hash = verify_data_commitment(a.data, chain[0]) # compares data with entry 0 of the same chain
proof = build_membership_proof(doc, chain, bound, data_hash)
verify_data_commitment compares the data with entry 0 of the same chain. A rewritten chain passes that check too, so it cannot catch this.
Steps to Reproduce
Tested on commit 913dd5a, CPU only, no release files needed. Save this as repro_proof_anchor.py and run it from the repository root:
import hashlib, json, os, subprocess, sys, tempfile
from pathlib import Path
link = lambda e: hashlib.sha256(json.dumps(e, sort_keys=True).encode()).hexdigest()
with tempfile.TemporaryDirectory() as tmp:
data, run = Path(tmp) / "prep", Path(tmp) / "run"
(data / "wikipedia").mkdir(parents=True); run.mkdir()
docs = [{"identity": ["src", "12", "1"], "offset": 0, "target_start": 0, "targets": 100, "tokens": 100},
{"identity": ["src", "39", "1"], "offset": 100, "target_start": 100, "targets": 100, "tokens": 100}]
doc_path = data / "wikipedia" / "documents.jsonl"
doc_path.write_text("".join(json.dumps(d) + "\n" for d in docs))
stream = {"files": [{"path": "documents.jsonl", "sha256": hashlib.sha256(doc_path.read_bytes()).hexdigest()}]}
(data / "wikipedia" / "stream.json").write_text(json.dumps(stream))
stream_hash = hashlib.sha256((data / "wikipedia" / "stream.json").read_bytes()).hexdigest()
def chain_of(controls):
chain = []
for i, (kind, ctl) in enumerate(controls):
e = {"index": i, "kind": kind, "control": ctl, "state": f"{i:064x}", "model": f"{i:064x}",
"previous": link(chain[-1]) if chain else None}
if i == 0:
e["data"] = {"wikipedia": stream_hash}
chain.append(e)
return chain
def write(chain):
(run / "chain.jsonl").write_text("".join(json.dumps(e, sort_keys=True) + "\n" for e in chain))
# Honest run: page 12 trained in segment 0, and anchored.
honest = chain_of([("initial", {"phase": "wikipedia", "cursor": 0}),
("progress", {"phase": "wikipedia", "cursor": 100}),
("base", {"phase": "wikipedia", "cursor": 200})])
write(honest)
(run / "anchor.json").write_text(json.dumps({"chain_entries": 3, "chain_head_sha256": link(honest[-1])}))
# Rewritten chain: page 12 "excluded" from the start, links recomputed.
write(chain_of([("initial", {"phase": "wikipedia", "cursor": 0, "exclude": {"wikipedia": [[0, 100]]}}),
("progress", {"phase": "wikipedia", "cursor": 100}),
("base", {"phase": "wikipedia", "cursor": 200})]))
env = {**os.environ, "OVL_DEVICE": "cpu"}
for cmd in (["simple/ovl.py", "verify", "--run", str(run), "--no-timestamps"],
["simple/proof.py", "--data", str(data), "--run", str(run), "--article", "12"]):
r = subprocess.run([sys.executable, *cmd], env=env, capture_output=True, text=True)
print(cmd[0], "exit", r.returncode); print((r.stdout + r.stderr)[:600])
Actual output
simple/ovl.py exit 1
chain head differs from .../run/anchor.json: 3 entries, head 2d9805e6cb10...
simple/proof.py exit 0
{
"membership_status": "excluded",
"data_provenance": { "bound_to_chain": true, ... },
"segments": [],
"exclusion_proof": { "at_boundary": 0, "excluded_range": [0, 100], ... }
}
Expected Behavior
proof.py should check the chain against the anchor the same way verify does, and exit non-zero when they differ:
- No anchor: if
RUN/anchor.json(or the file given with--anchor) is missing, exit non-zero, unless--no-anchoris given. - Chain head: if the number of entries or the head hash differs from
chain_entries/chain_head_sha256, exit non-zero. - Timestamps: check the two anchor timestamps, unless
--no-timestampsis given.
Proposed Fix
- Move the anchor check out of
cmd_verifyinto a shared helper inovl.py, for examplecheck_anchor(run, chain, anchor, no_anchor, no_timestamps). It would reusecheck_anchor_timestamps().cmd_verifyandproof.pywould both call it, so behavior and messages stay the same. - Add
--anchor,--no-anchorand--no-timestampstoproof.py, matchingverify. - Add an
"anchor"field to the proof JSON (chain head, entry count, timestamps, ornull), so a reader can see what the proof is tied to. - Tests (CONTRIBUTING rule 2):
- An anchored, honest chain passes.
- A rewritten chain with recomputed links fails.
- A missing anchor fails unless
--no-anchoris given.
This change only touches proof.py and the anchor check. It does not change the proof's logic.
Logs and Screenshots
No response
Environment Details
No response
Impact
High - Major feature is broken
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Ngôn ngữ chính
- Python
- Star
- 27
- Fork
- 72
- Merge trung bình
- 3 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 32
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/OpenVerifiableLLM
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AOSSIE-Org/OpenVerifiableLLM#399 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG]: simple/ovl.py read_chain raises raw tracebacks when a chain.jsonl line is valid JSON but not a chain entryCó thể đã có người làm @Arnav0107 đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AOSSIE-Org/OpenVerifiableLLM#395 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG]: ovl.py verify --weights crashes with AttributeError on checkpoint .pt filesCó thể đã có người làm @panshularora đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AOSSIE-Org/OpenVerifiableLLM#387 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG]: verify_segment accepts empty, wrong-phase, or non-positive fork exclusions as MATCHCó thể đã có người làm @panshularora đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/OpenVerifiableLLM#385 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG]: preparation.lock install fails on macOSCó thể đã có người làm @darshith2527-sketch đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/OpenVerifiableLLM#357 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của AOSSIE-Org/OpenVerifiableLLM
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
comet-ml/opik#9877 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Resource]: FlavianĐang mởresource-submission validation-passed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
hesreallyhim/awesome-claude-code#3736 · 1 bình luận ·
-
area: trackers bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Review: WordPress copy/snapshot download media with no size cap and a hostname-only origin checkĐang mởperformance product:quill
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Community-Access/quill#2634 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày