feat(audit): submit canonical commitments through the durable Anchorer (#52) #267
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/i-got-this-faa/device-audit/pull/267?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>
<!-- review_stack_entry_end -->
<!-- This is an auto-generated comment: failure by coderabbit.ai -->
[!CAUTION]
## Review failed
> <!-- failure_reason_start -->
The pull request is closed.
<!-- failure_reason_end -->
<!-- end of auto-generated comment: failure by coderabbit.ai -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
<details>
<summary><strong>Share</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
<!-- tips_end -->
Approved these changes.
jR4dh3y
CierCier
<!-- claude-projects-attribution: {"github_login":"CierCier"} -->
_Requested by cier · project thread_
Closes #52 (CHAIN03).
What this does
Adds
packages/audit.DurableAnchorer, which submits a stored manifest's CT09 public commitment to the registry asanchor(1, id, C)(C from CHAIN07, domain from an enabled CHAIN01 descriptor).audit_anchor_requests(randomanchor-req:retry ID, unique per adapter and commitment ID, must reference a stored manifest with the same digest),audit_anchor_transactions(one signed tx per request, randomevm-tx:reference, unique writer nonce) and append-onlyaudit_anchor_attempts.eth_sendRawTransaction. A restart orResumerebroadcasts the same bytes and never signs again.already_anchored/digest_conflict), per-transaction fee ceiling and rolling 24h reservation budget. A per-adapter Postgres advisory lock serializes nonce and fee allocation across controller processes.eth_signTransaction(Clef/Web3Signer/Anvil shape). The returned envelope is RLP-decoded and every field must equal the approved call (zero value, no access list), or it is refused assigner_mismatch.POST /console/api/audit-manifests/{id}/anchor(fresh admin) andGET(admin). Responses carry only opaque IDs, evidence class and outcomes.anchor_stateisunverifiedorpending, neverfinalized. Retryable refusals return 503, non-retryable ones 409.--chain-descriptor-fileplusDEVICE_AUDIT_CHAIN_RPC_URL/DEVICE_AUDIT_CHAIN_SIGNER_URL(environment variables, so URLs with credentials stay out of argv, logs and the descriptor). The controller resumes stored work at startup and every 5 minutes.Anchorer.Commit/Verifyinterface (with itsFinalizedreceipt flag) is replaced bySubmit/Resume.Evidence
All run locally on 29 Nov in the cloud container: PostgreSQL 16, Foundry/Anvil v1.7.1, solc 0.8.39.
go test -race -tags=chain_integration ./contracts/integration: newTestDurableAnchorerSubmitsThroughRPCAndSignerplus the 3 existing tests pass. It uses the production JSON-RPC client and RPC signer: fee-ceiling refusal before signing (nonce stays 0), lost broadcast, restart rebroadcasting identical bytes with a signer that refuses every call, minedAnchored(1,id,C)event and state, duplicate request spending no nonce, ID already on-chain, revoked writer. Local: 71,941 gas, reserved worst case 9.0e13 wei (< 0.0001 ETH ceiling), 213-byte envelope.make check(fmt, vet, race tests withTEST_DATABASE_URL, model-check, fake-check),make cross-build,make contract-check(367 golden vectors, 81 wire cases) pass.Details:
docs/validation/chain-anchorer-52.md. Decision entry and requirements row updated.Caveats / not tested
getL1FeeUpperBoundoracle (required on 8453/84532, absent on Anvil so 0 there), funded writer or production signing service/custody. Anvil's unlocked account stood in for the signer.claude/52-durable-anchorer(same commit) was pushed by mistake and the proxy refused to delete it. It can be deleted safely.---
_Generated by Claude Code_