fix(replication): gate audits by mature repair proofs#106
Open
mickvandijke wants to merge 7 commits into
Open
Conversation
Track key-specific repair hints per close group and require proof before auditing or prune-confirming a peer for a key. SemVer: patch
There was a problem hiding this comment.
Pull request overview
This PR tightens replication audit and prune-confirmation eligibility by requiring key-specific “repair proof” evidence (tied to a close-group snapshot and local sync-cycle epoch) before a peer can be audited or used for prune-confirmation. It also adds lifecycle invalidation for those proofs (close-group changes, local key deletion, peer removal) and wires proof tracking through neighbor-sync, audit, and pruning.
Changes:
- Introduce
RepairProofsto record per-(peer, key) replica-hint evidence, including maturity by local sync-cycle epoch and invalidation rules. - Gate normal audits and prune-confirmation audits on mature repair proofs; clear proofs on record deletion and peer removal.
- Update replication internals and e2e tests to pass new context (repair proofs + epoch) through pruning and audit flows.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/replication.rs | Updates prune-pass e2e test to construct/seed RepairProofs and provide sync epoch context. |
| src/replication/types.rs | Adds RepairProofs data structure + unit tests for proof recording, maturity, and invalidation. |
| src/replication/pruning.rs | Refactors prune pass to take a context struct and requires mature proofs before prune-confirmation audits; clears proofs on deletion. |
| src/replication/neighbor_sync.rs | Returns NeighborSyncOutcome to track which replica hints were sent (for proof recording). |
| src/replication/mod.rs | Adds sync-cycle epoch + proof table to the engine, records sent hints as proofs, clears proofs on peer removal, and threads new parameters into audit/prune. |
| src/replication/audit.rs | Filters audited (peer, key) pairs to those with mature repair proofs. |
| docs/REPLICATION_DESIGN.md | Updates design doc invariants/rules to describe key-specific RepairProof and maturity gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Invalidate key repair proofs when close-group membership changes and require a completed sync-cycle epoch before audits or prune-confirmation challenges can use a proof. SemVer: patch
99846c5 to
98c20ea
Compare
Avoid cloning full neighbor-sync responses when recording repair hints, and carry close-group snapshots from hint construction into proof recording instead of performing another DHT lookup per hinted key. Keep the public audit, prune, and neighbor-sync entry points compatible while routing the engine through proof-aware internal variants. SemVer: patch
Document the send success boolean used by repair proof recording and make the conservative behavior of the legacy prune wrapper explicit. SemVer: patch
SemVer: patch
SemVer: patch
SemVer: patch
Comment on lines
1533
to
+1549
| @@ -1484,13 +1546,13 @@ async fn send_replication_response( | |||
| request_id: u64, | |||
| body: ReplicationMessageBody, | |||
| rr_message_id: Option<&str>, | |||
| ) { | |||
| ) -> bool { | |||
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.
Summary:
SemVer: patch
Tests:
Note: full all-target clippy is still blocked locally by the existing duplicate saorsa_core path override in unstaged Cargo.toml/Cargo.lock.