fix(replication): strengthen audit cadence and penalties#103
fix(replication): strengthen audit cadence and penalties#103mickvandijke wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens replication storage audit behavior by increasing audit frequency and strengthening the trust penalty applied to confirmed audit failures, while updating the replication design reference profile accordingly.
Changes:
- Reduce audit scheduler jitter window from 30–60 minutes to 10–20 minutes in the replication reference config.
- Increase
AUDIT_FAILURE_TRUST_WEIGHTfrom2.0to5.0and add/adjust unit tests to reflect the new reference profile. - Document the audit failure trust penalty weight in
REPLICATION_DESIGN.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/replication/config.rs |
Updates audit tick interval bounds and the confirmed audit failure trust penalty weight; adjusts/adds tests for the new reference values. |
docs/REPLICATION_DESIGN.md |
Updates the reference profile table to reflect the new audit cadence and documents AUDIT_FAILURE_TRUST_WEIGHT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a6312aa to
19905fb
Compare
Semver: patch Run closest-node audits more frequently and use the max consumer trust penalty for confirmed audit failures. Tests: cargo test replication::config --lib
19905fb to
909e87f
Compare
Review: fix(replication): strengthen audit cadence and penaltiesOverall VerdictChanges are sensible and well-scoped — tighter audit cadence and stronger penalties should improve data integrity. A few notes below. Analysis1. Audit frequency 30-60min → 10-20min (3-6x increase) 2. AUDIT_FAILURE_TRUST_WEIGHT 2.0 → 5.0 (2.5x increase) 3. New test: audit_failure_weight_matches_max_consumer_trust_event_weight 4. Test scenario_31_audit_cadence_within_jitter_bounds 5. macOS CI: Test (macos-latest) FAILURE Summary
The PR is clean and well-targeted. Nice work @mickvandijke. |
dirvine
left a comment
There was a problem hiding this comment.
Reviewed via Hermes. Code is clean, well-scoped, all builds/lint/security pass. Test coverage adequate. Changes are sound.
Update base audit response timeout to 10s and increase per-chunk allowance to 20ms per challenged key. Modify documentation to reflect these changes. Semver: patch
| /// Base audit response deadline (independent of challenge size). | ||
| const AUDIT_RESPONSE_BASE_SECS: u64 = 6; | ||
| const AUDIT_RESPONSE_BASE_SECS: u64 = 10; | ||
| /// Per-chunk allowance added to the base audit response deadline. | ||
| const AUDIT_RESPONSE_PER_CHUNK_MS: u64 = 10; | ||
| const AUDIT_RESPONSE_PER_CHUNK_MS: u64 = 20; |
| /// Base audit response deadline (independent of challenge size). | ||
| const AUDIT_RESPONSE_BASE_SECS: u64 = 6; | ||
| const AUDIT_RESPONSE_BASE_SECS: u64 = 10; | ||
| /// Per-chunk allowance added to the base audit response deadline. | ||
| const AUDIT_RESPONSE_PER_CHUNK_MS: u64 = 10; | ||
| const AUDIT_RESPONSE_PER_CHUNK_MS: u64 = 20; |
|
|
||
| #[test] | ||
| fn audit_failure_weight_is_five() { | ||
| assert_eq!(AUDIT_FAILURE_TRUST_WEIGHT.to_bits(), 5.0_f64.to_bits()); |
Summary:
Semver: patch
Tests: