fix(bootstrap): age-bound and refresh close-group cache - #149
Open
dirvine wants to merge 3 commits into
Open
Conversation
dirvine
force-pushed
the
fix/close-group-cache-hygiene
branch
from
August 6, 2026 21:04
fd822d0 to
22326b5
Compare
added 2 commits
August 7, 2026 15:57
…he, reject future timestamps - Bind cached addresses to their expected PeerId at dial time; reject and disconnect on handshake identity mismatch so address reassignment cannot import trust from the wrong peer. - Clear/replace the on-disk cache when the authoritative close group is empty instead of leaving stale entries intact. - Reject cache timestamps more than five minutes in the future (also when max-age enforcement is disabled) so wall-clock skew cannot bypass TTL.
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.
Linear issue
V2-884 — Age-bound and refresh the saorsa-core close-group bootstrap cache
Risk tier
Compatibility
close_group_cache.jsonformat is unchanged. Old cache files remain readable. Old serializedNodeConfigvalues that omit the new field receive the one-hour default; explicitnullpreserves disabled TTL.NodeConfig::close_group_cache_max_ageand a builder setter. This is source-breaking for downstream code that constructs the publicNodeConfigwith a struct literal; builder and deserialization callers remain compatible.Semver impact
Test evidence
cargo check --all-targets --all-features— passed.cargo test --lib— 475 passed; unrelated floating-point tolerance testadaptive::trust::tests::test_unit_weight_equivalencefailed once at a 1.78e-10 difference, then passed 5/5 isolated reruns.cargo clippy --all-targets --all-features -- -D warnings— passed.cargo fmt --all -- --checkandgit diff --check— passed.The proposed T2 classification still requires dev-testnet evidence before release. Detailed matrix: V2-894.
New dependency
none
ADR
ADR-016 — Age-Bounded, Periodically Refreshed Close-Group Cache — Proposed; human acceptance pending.
Mitigation / rollback
Disable age enforcement with
close_group_cache_max_age: null, disable cache persistence by omittingclose_group_cache_dir, or revert this PR; configured bootstrap peers remain the fallback path.