Repository navigation
Verify windowed custody entries on ingest - #687
Volyarosh94 wants to merge 1 commit into
Conversation
Bump retina-custody to 294c0b0 and drop the per-frame signature path.
|
Part of the custody server test: the stand-in node script is offworldlabs/retina-custody#7, and node.py on the new API is offworldlabs/retina-simulation#17. This PR can merge on its own; the droplet run comes after it is on retina-test. |
|
Claude finished @Volyarosh94's task in 4m 21s —— View job Review complete ✅
SummaryThis is a large, carefully-reasoned change, and the implementation matches what the PR description claims. I read Things I specifically checked and found correct/intentional (not bugs):
I did not find a correctness or security bug in this diff. The ingest/verification state machine ( |
|
Ran on retina-test at de93f2b:
|
What
libs/retina-custodyto 294c0b0, the windowed hash chain.backend/uv.lockdoesn't move.services/custody.pyholds oneingest_chain_entryfor TCPCHAIN_ENTRYandPOST /api/custody/chain-entry. The body isnode_id,entry(HashChainEntry.to_dict()) and an optionalbatch(max 4 MiB). The server checks the hash, the signature, the link to the node's last verified window and, with a batch,detections_hash, then keeps the entry with its verdict. A malformed entry gets a 422 or a rejected ack and is not stored.node_identities.SignatureVerifier, the per-frame verify in the frame processor and its TCP stamp are gone; the parquet signature columns stay, nullable.latest_window_end,verifiedandgaps./verifyrunsverify_chainover what is held and caches the verdict per node. The test dashboard getsverified_entries_total, and the admin Custody page shows verified/entries, gaps and the latest window end._ensure_custody_datais removed. It wrote fake_verifiedhourly rows and SIM keys for every connected node, so a real node's windows would have linked to fake rows./api/custody/chain-entryis 8256 KiB in the app and in nginx (main and API hosts). It is provisional until the 15-minute batch is measured on retina-test.tests/test_custody.py(a copy of the library's tests) is deleted. Route and TCP tests use real chains fromtests/custody_helpers.py./v1/nodeschanges, andcontracts/nodes-v1.openapi.yamlis untouched.Calls I made
stale window. Without this a replay passed as verified right after one refused row.CHAIN_ENTRYandREGISTER_KEYneed an accepted HELLO, and a key registers only under the HELLO node. Before, any client could replace a node's key without a HELLO.inputandctx: a 4 MiB batch with a bad character made the default handler 500 and send it all back.-----SIM-KEY-key, hourly rows withoutwindow_end, and the seeded IQ commitments, matched on the seeder's own markers, with one log line counting what went. Production held about 24 such nodes, staging 65 and test 215./verifychecks the held list, refused rows included, so a refused replay shows as aprev_hashissue there even though the windows around it were verified on receipt.Tested
just checkgreen up toweb(5997 passed); web lint fails with main's same 54 problems, web typecheck, tests and build pass; the custody script and node.py ran against a local server, with the tampered and replayed windows refused and every other window verified.