Skip to content

feat!: remove bootstrap cache integration#101

Open
mickvandijke wants to merge 9 commits into
mainfrom
codex/remove-bootstrap-cache
Open

feat!: remove bootstrap cache integration#101
mickvandijke wants to merge 9 commits into
mainfrom
codex/remove-bootstrap-cache

Conversation

@mickvandijke
Copy link
Copy Markdown
Contributor

@mickvandijke mickvandijke commented May 28, 2026

Summary

  • remove ant-core peer-cache recording hooks into the old BootstrapManager APIs
  • delete bootstrap-cache E2E coverage and the direct test-only saorsa-core dev dependency
  • add a persistent client peer cache at the ant data-dir client_peer_cache.json
  • load all usable cached peer addresses as first-choice CLI bootstrap candidates, then append configured/hardcoded bootstrap peers as fallback only after cache candidates have had priority
  • keep Client::connect exact to the bootstrap peers supplied by the caller; it no longer loads or saves the client peer cache implicitly
  • filter cached CLI bootstrap candidates for --ipv4-only before selecting the startup address for each cached peer
  • rely on saorsa-core client bootstrap early-return behavior to stop after 6 successful bootstrap peers, cancelling pending cache dials before fallback is reached on a healthy cache
  • log when a client bootstrap cache file is found and loaded, including cached peer count, usable cached peer count, direct address count, and bootstrap candidate count
  • promote live authenticated connected peers into the cache from P2PNode::peer_info(); a DHT Direct tag is no longer required for cache admission
  • store only dialable peer addresses with /p2p/<peer_id> suffixes
  • cap the cache at 50 peers, apply k-bucket IP diversity limits, prefer peer-id XOR spread over recency, and round-robin startup candidates across peer-id sectors
  • disable the client peer cache for CLI runs using explicit network selectors: --bootstrap or --devnet-manifest
  • update git imports to the pushed branch heads for saorsa-core, saorsa-transport, ant-protocol, and ant-node
  • rebase the branch on current main

Timeout Scope

  • saorsa-core removes the outer 6s peer dial timeout and the outer 25s connect_happy_eyeballs timeout
  • direct peer dials are now bounded by the transport strategy's direct connect and handshake timeouts instead of an additional wrapper deadline

SemVer

  • Major: removes the old ant-core bootstrap-cache recording hook surface and bootstrap-cache E2E/dev-dependency surface
  • Minor: adds the persistent client peer cache
  • Patch: cached startup now tries the full usable cache before configured/hardcoded fallback; explicit --bootstrap disables cache load/save; cache-load logging now reports cache counts
  • Patch: restores Client::connect exact-bootstrap behavior by keeping implicit peer-cache load/save out of that API
  • Patch: honors --ipv4-only for cached CLI bootstrap candidates
  • Patch: removes redundant outer direct-dial timeouts in saorsa-core and updates git imports to the pushed dependency commits
  • Patch: cache retention now prioritizes peer-id keyspace spread ahead of recency while still enforcing IP diversity limits
  • Patch: cache promotion now records live authenticated connected peers rather than requiring DHT Direct-tagged routing-table entries

Git Imports

  • saorsa-core: ac285f212185486b1d1ee6eee33932865413f42f
  • saorsa-transport: 00447926f8847d5de99c271fb689740f749177f6
  • ant-protocol: 6bc35372986474fa9f31844b034790d0b84ffb97
  • ant-node: 265d6a8fad1d16a540f8bf66f319ac9afc97a4ed

Related PRs

Live Cache Checks

  • download-126.log: cache promotion saw connected_peers=543, cacheable_peers=543, cacheable_addresses=552, normalized to cached_peers=50, direct_addresses=50
  • download-127.log: loaded cached_peers=50, reached bootstrap target before fallback pressure, then refreshed from connected_peers=536, cacheable_peers=536, cacheable_addresses=544, normalized to cached_peers=50, direct_addresses=50
  • current cache has 50 peers, 50 addresses, no empty-address peers, matching /p2p/<peer_id> suffixes, all 16 peer-id sectors represented, exact IP max 2, and subnet counts within the configured diversity limit

Verification

  • cargo check --locked -p ant-core --features devnet
  • cargo check --locked -p ant-cli
  • cargo fmt --all -- --check
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked -p ant-core peer_cache --lib
  • git diff --check
  • cargo fmt --all -- --check in ../saorsa-core
  • cargo check in ../saorsa-core
  • cargo clippy --all-targets --all-features -- -D warnings in ../saorsa-core
  • cargo check in ../ant-protocol
  • cargo check in ../saorsa-node

BREAKING CHANGE: removes ant-core bootstrap-cache recording hooks and the bootstrap-cache E2E/dev-dependency surface.

@mickvandijke mickvandijke force-pushed the codex/remove-bootstrap-cache branch 2 times, most recently from e13f00c to a0e319c Compare May 28, 2026 13:44
@mickvandijke mickvandijke marked this pull request as ready for review May 28, 2026 16:47
@mickvandijke mickvandijke changed the base branch from rc-2026.5.4 to main May 28, 2026 21:02
Use ant-protocol via git instead of the local checkout path.

BREAKING CHANGE: removes ant-core bootstrap-cache recording hooks and the bootstrap-cache E2E/dev-dependency surface.
Keep Client::connect exact to its supplied bootstrap peers while preserving CLI cache warm-start behavior. Filter cached bootstrap addresses for ipv4-only runs and update git dependency locks to the pushed timeout-removal branches.

SemVer: patch
@mickvandijke mickvandijke force-pushed the codex/remove-bootstrap-cache branch from d10b577 to b4d64de Compare May 28, 2026 21:19
Retain cached bootstrap peers by peer-id keyspace coverage before recency while still enforcing IP diversity limits. Recency remains the tie-breaker among equally diverse candidates.

SemVer: patch
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