Repository navigation
feat(private): contiguous key epochs, burned epochs and safe maintainer changes - #64
Merged
Merged
Conversation
Epochs exist only contiguously from 0: a config above a missing epoch number is not an anchor (EpochGap alert), each anchor chains to exactly e-1, and a new epoch is always current+1, so a huge epoch number can no longer exhaust the space. A rotation whose key for n+1 may have reached someone outside the remaining members anchors n+1 burned (config TLV tag 11) and rotates on to n+2, stopping if another maintainer's n+1 anchor wins. A burned epoch only links the chain: no write epoch, late content unless by a member, suspect manifests, and the repair check rotates past it. Maintainer changes keep anchors intact: a removal re-anchors with the same key, chain pair and burned flag and verifies the post-removal resolution (dropping only unreadable top epochs), and adding a maintainer is refused when their old configs would move an anchor. dg repo keys status names who burned the current epoch; the removal's follow-up repair no longer spends on someone else's burn. Spec §4.3/§5.3/§5.5/§5.6/§8.2 and 17 new or regenerated vectors (163 total), with the TS reference from the web branch so both stacks pass. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
After dropping the leaving maintainer's unreadable top epochs, the surviving current epoch must be readable by the remover; otherwise the removal is refused before any write (matches the web). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…pre-posted future configs A maintainer removal drops unreadable top epochs only when the leaving maintainer anchored all of them and no maintainer who stays wrote or received a wrap for them (public wrap rows); staying writers who lose them are named. Re-granting a maintainer is refused when they have a config above the current epoch, and a rotation whose anchor makes room for a pre-posted next-epoch config refuses and names its author (parity with the web). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Anchor selection (spec §5.3): for e >= 1 a config is a candidate only if its (block height, id) is strictly after stated(e-1), the first config of e-1 carrying anchor(e-1)'s commitment. Pre-posted configs (future epochs, re-granted maintainers) never become anchors; measuring from the key's first statement keeps epochs above a re-anchored one intact. Five new vectors (168), Rust and TS. Also applies the simplifier's findings: shared reload/poll helpers, create_private_state via pending_key, burned_by returns the epoch, one still-holds check in the removal. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…hes a burn M2: a burned anchor keeps prevEpoch but carries no prevEpochKey; the next anchor carries prevEpochKey and a new skipEpochKey (TLV tag 12), the key of the nearest epoch below the burned run, and the chain walk steps over the run. C1: the burn path wraps the burned key to every remaining member before anchoring, so any maintainer sees and finishes it. C2: removing your own maintainer role is refused while you anchor an epoch. Security H1: the leaving maintainer's own wraps never pin an epoch. H2: no write epoch while a non-member holds the current key. M2/M3: the remover self-wraps every epoch it holds only through the leaver and the refusal names who displaced an anchor. M1: plain grant refusal; M3: a re-run removal rotates past a burned epoch. L: owner check before any fee, won judged by commitment, earlier-use classification, burn cost estimate, spec wording. 13 new vectors (181), Rust and TS; rotate's decision is the pure step_for. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Scenario 16 on moutai: the owner's rotation dies after its self-wrap, the removal burns epoch 1 and dies after the burned anchor, the other maintainer repairs to epoch 2, the removed writer is refused and both maintainers read every epoch through the skip key. Crash points via the debug-only DASH_FORGE_TEST_FAULT. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The removal refusal names only who changed a commitment; earlier-use content is judged from when the key was first stated (Anchor.stated_height), and only a tag failure on an intact pack counts as one; no_write says when a non-member holds the current key; a wrap only proves holding an epoch if it carries the resolution's key. Burn-aware estimates for rotate and remove, the removal prompt names someone else's burn it will finish, clearer maintainer grant refusal, scenario 16 skips on release builds; spec §5.6 H2 rule, §8.1 EarlierUse and stale wording. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 51 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (59)
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 |
Keeps master's edits-are-judged-too §8.2 paragraph alongside the burned-epoch wording, and adds ForgeIds.group_owner to the keyring test fixture. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This follows up #47. It makes private-repo key epochs contiguous, adds burned epochs, and tightens how anchors are chosen and how maintainers are added or removed. The spec, the conformance vectors, the Rust reference and the web's TypeScript all change together, so master stays green on both stacks.
Rules (docs/security/private-repos.md, §4.3, §5.3, §5.5, §5.6, §7, §8.1, §11)
eexists only if it has an anchor ande − 1exists.EpochGapalert and is ignored.prevEpoch = e − 1.current + 1, so a config at a huge epoch number can no longer use up the epoch space.e ≥ 1, a config counts only if its($createdAtBlockHeight, $id)is strictly afterstated(e − 1). That is the first config fore − 1, by anyone, that carriesanchor(e − 1)'s commitment.$idbytes.n+1may have reached someone outside the remaining members (a crashed earlier run, a visible stray wrap, or a wrap that can't be replaced), the rotation does four things:K_{n+1}to every remaining member.n+1burned, carrying noprevEpochKey.n+2, which carriesprevEpochKey = K_{n+1}and a newskipEpochKey(TLV tag 12): the key of the nearest epoch below that is not burned.writeEpochis null until the rotation lands.Implementation
private/{epoch,tlv,doc}.rs: anchor selection with stated heights, the chain walk with skip keys, burned epochs and the late rule.keyring.rs:rotatemakes its decision in a purestep_for, handles the burn path and usesnext_link/ChainLink.reanchor_plan,wrap_held_through,confirm_removal.rotation_may_burn.dg:repo keys statusnames whoever burned the current epoch.forge-web/lib/private/{epoch,tlv,doc}.tsmirror the Rust exactly; the web agent will take these files as-is when it rebases feat(web): read private repos and manage their members #51.private_*vectors, up from 146. Both harnesses pass all of them, andgen.pyregenerates them byte for byte.Reviews
Live e2e on devnet moutai (
e017aa2build)DASH_FORGE_TEST_FAULT, which only debug builds honour; release builds skip the scenario.Notes
ChainBroken. The only such repos are e2e test repos, so nothing needs migrating.dg repo keys statusnames who burned), and a removal won't pay for someone else's burn without asking.dg repo viewhiding E306, adg repo keys reanchorcommand, and CLI sealing of issues, PRs, comments and reviews.🤖 Generated with Claude Code