Skip to content

feat!: remove bootstrap_cache module - #73

Draft
mickvandijke wants to merge 1 commit into
mainfrom
mick/remove-bootstrap-cache
Draft

feat!: remove bootstrap_cache module#73
mickvandijke wants to merge 1 commit into
mainfrom
mick/remove-bootstrap-cache

Conversation

@mickvandijke

Copy link
Copy Markdown
Member

Summary

  • Deletes the entire src/bootstrap_cache/ module (cache.rs, config.rs, entry.rs, persistence.rs, selection.rs, token_store.rs) and its pub use re-exports from lib.rs.
  • Drops P2pConfig::bootstrap_cache, the Arc<BootstrapCache> field on P2pEndpoint, and the BootstrapCacheUpdated event variant on TransportEvent.
  • Replaces BootstrapTokenStore with None for the Quinn TokenStore slot (Quinn NEW_TOKEN-based fast-reconnect goes away with the cache; full handshake on every reconnect, no protocol breakage).
  • Removes the Cache CLI 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 of All connect attempts failed warnings during DHT lookups and as fatal Merkle candidate pool rejected payment-validation failures on the first chunk.

Backwards compatibility

  • PROTOCOL_VERSION, the on-wire Capabilities struct, and DHT/chunk/payment wire formats are unchanged. Mixed-version networks interoperate freely.
  • New clients pass None for the Quinn TokenStore → discard incoming NEW_TOKEN frames, never replay. No protocol violation.
  • The orphan file at ~/Library/Caches/saorsa/bootstrap/bootstrap_cache.json is no longer read or written.

Test plan

  • cargo check --all-targets
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --lib (1450 passed locally)

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Performance Comparison

Benchmark Baseline Current Change Status

Summary

Configuration

  • Regression threshold: >10% slower
  • Improvement threshold: >10% faster
  • Measurements: Mean execution time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant