fix(node): anchor the real old_sha and issue a per-ref certificate#72
fix(node): anchor the real old_sha and issue a per-ref certificate#72beardthelion wants to merge 1 commit into
Conversation
The push handler discarded the real old->new transition before anchoring and only certified the first ref of a multi-ref push, so the permanent Arweave record was a weaker, incomplete copy of facts the node had already parsed. - Thread the parsed old_sha through the clone moved into the anchor task instead of hardcoding a 64-zero placeholder. This also fixes the SHA width mismatch: object ids are 40-hex SHA-1, not 64-hex. - Issue a signed RefCertificate for every ref the push advanced, each carrying that ref's real old/new, rather than one cert for the first ref (which, on an empty push, signed a timestamp string as new_sha). Lock the anchor-body contract with a test asserting the upload carries the real old_sha and new_sha, never a placeholder. Scope is the integrity subset only. Carrying the signed certificate on Turbo, capturing the pusher signature, chaining certificates, and gl-side verification remain open under #26. Refs #26
|
Warning Review limit reached
More reviews will be available in 24 minutes and 4 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Refs #26 (integrity subset only; the issue stays open for the foundation work).
What was wrong
The push handler built the Arweave anchor from a copy of the ref updates that had already dropped the real
old_sha, then hardcodedold_shato 64 zeros. The signedRefCertificatewith the realold -> newstayed local. On top of that, a multi-ref push only ever produced one certificate (for the first ref), and an empty push signed a timestamp string asnew_sha. The 64-zero placeholder was also the wrong width: git object ids are 40-hex SHA-1.What this changes
old_shathrough the clone moved into the anchoring task, so the anchor records the realold -> newtransition. This drops the"0".repeat(64)placeholder and fixes the width mismatch.RefCertificatefor every ref the push advanced, each carrying that ref's realold/new, instead of one cert for the first ref.No new dependencies, no schema or config changes.
Scope
Deliberately the integrity subset of #26. Carrying the signed certificate on Turbo, capturing the pusher signature, chaining certificates, and
gl-side verification against the anchor remain open under #26.Tests
arweave::tests::test_anchor_body_carries_real_old_shalocks the anchor-body contract: the upload must serialize the realold_sha/new_sha, never a placeholder.gitlawb-nodesuite green (126 passed);fmtandclippyclean.The per-ref certificate issuance and
old_shathreading live in thegit_receive_packhandler, which has no test harness (it needs a live Postgres and git), so those are verified by compile and review rather than an automated test.