Skip to content

Implement trimmed client bootstrap (registry read + retry/backoff + cached peers/channels) #1166

Closed

Description

@alpergundogdu

Disposition: IMPLEMENT (trimmed).

Client discovery does a single per-fetch registry read with no retry/backoff and no cache (crates/client-pull/src/discovery.rs:58).

Action: add paginated registry query with exponential backoff (1s/5s/30s), DNS-seed merge, and a cached ~/.decdn/peers.json/channel cache for reuse. Do NOT add gossip-leaf participation or eclipse mitigation (see ADR-012 cut issue).


Filed from the ADR→implementation gap analysis. ADR edits must be made in place with no historical/tombstone text (no "planned but cut" sentences) per repo ADR convention.

Activity

  1. added
    prio:medium
    rust
    area:cli
    on Jul 15, 2026
  2. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Triage note for a later run: automated dispatch skipped this, but it is the closest of the ADR-gap issues to ready. Three corrections before it goes out.

    1. The DNS-seed merge contradicts ADR 012. adr/012-client.md:61 states flatly that "The on-chain registry is the sole discovery source; a cached ~/.decdn/peers.json from the last successful query covers a transient RPC outage." The bootstrap sequence at :40-58 has no DNS step, and there is no dns_seed anywhere in crates/config-types/. So this half of the ask has to be either dropped from scope or justified by an ADR 012 amendment — and the repo's no-tombstone ADR convention makes that a real edit, not a footnote.

    2. The backoff schedule doesn't fit the shared type. The issue and adr/012-client.md:45 both specify 1s/5s/30s, roughly 5x growth. The existing RetryPolicy (crates/config-types/src/retry.rs:47, exported at lib.rs:34) is geometric doubling with a cap, which yields 1s/2s/4s. Reusing it verbatim silently gives the wrong schedule. Pick one: add a multiplier field, add an explicit-schedule variant, or hardcode [1, 5, 30] client-side and skip the shared type.

    3. The paginated registry query already exists. active_nodes() at crates/client-pull/src/discovery.rs:67-99 already does the offset/PAGE_SIZE=100 loop with short-page termination, matching adr/012-client.md:42-44 exactly. That part of the action item is done; only retry, cache, and refresh are missing.

    What is pinned and needs no decision: the cache location ~/.decdn/peers.json (adr/012-client.md:148, config key [cache] peer_cache_path at :167, with required ~ home expansion noted at :161). The serde shape isn't specified, but NodeCandidate (discovery.rs:26-37) is the obvious record and needs only a derive.

    One scope question the issue omits: adr/012-client.md:57 specifies a 10-minute periodic refresh ([bootstrap] registry_refresh_secs = 600 at :159). Decide whether that is in or out.

    Size: ~200-300 non-test LOC as written; ~200 with DNS-seed dropped. Resolve (1) and (2) and this is dispatchable.

  3. self-assigned this
    on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions