feat!: remove bootstrap_cache module - #73
Draft
mickvandijke wants to merge 1 commit into
Draft
Conversation
Persistent peer cache shared a single on-disk file across every saorsa network the user connected to (mainnet, testnets, dev), with no per-network namespacing. A polluted cache from a prior session poisoned routing-table population — visible as hundreds of stale "All connect attempts failed" warnings during DHT lookups, and as fatal Merkle pool rejections at payment time when foreign peer keys landed in the candidate pool. Removes the entire bootstrap_cache module, its lib.rs re-exports, the BootstrapCacheConfig field on P2pConfig, the P2pEndpoint cache field and its propagation, the BootstrapCacheUpdated event variant on TransportEvent, and the bootstrap_cache::BootstrapTokenStore decorator over Quinn's TokenStore (now passed as None to NatTraversalEndpoint::new_with_socket — Quinn NEW_TOKEN-based fast-reconnect goes away with the cache). The CLI Cache subcommand (stats / clear) and its doctor check are gone too. BREAKING CHANGE: BootstrapCache, BootstrapCacheConfig, CachedPeer, PeerCapabilities, PeerSource, and the rest of the bootstrap_cache public surface are removed from the crate. P2pConfig::bootstrap_cache, P2pEndpoint::bootstrap_cache, and TransportEvent::BootstrapCacheUpdated no longer exist. Consumers that relied on Quinn token persistence across restarts must wire their own TokenStore impl. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 29, 2026
Contributor
Benchmark ResultsPerformance Comparison
SummaryConfiguration
|
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
src/bootstrap_cache/module (cache.rs, config.rs, entry.rs, persistence.rs, selection.rs, token_store.rs) and itspub usere-exports fromlib.rs.P2pConfig::bootstrap_cache, theArc<BootstrapCache>field onP2pEndpoint, and theBootstrapCacheUpdatedevent variant onTransportEvent.BootstrapTokenStorewithNonefor the QuinnTokenStoreslot (QuinnNEW_TOKEN-based fast-reconnect goes away with the cache; full handshake on every reconnect, no protocol breakage).CacheCLI subcommand (stats/clear) and the doctor check.Why
The on-disk cache at
~/Library/Caches/saorsa/bootstrap/is shared across every saorsa network the user connects to (mainnet, testnets, dev) — no per-network namespacing. A polluted cache from a prior session was poisoning routing-table population on testnet uploads, surfacing as hundreds ofAll connect attempts failedwarnings during DHT lookups and as fatalMerkle candidate pool rejectedpayment-validation failures on the first chunk.Backwards compatibility
PROTOCOL_VERSION, the on-wireCapabilitiesstruct, and DHT/chunk/payment wire formats are unchanged. Mixed-version networks interoperate freely.Nonefor the QuinnTokenStore→ discard incomingNEW_TOKENframes, never replay. No protocol violation.~/Library/Caches/saorsa/bootstrap/bootstrap_cache.jsonis no longer read or written.Test plan
cargo check --all-targetscargo clippy --all-targets --all-features -- -D warningscargo test --lib(1450 passed locally)🤖 Generated with Claude Code