Skip to content

feat(#109): seed boot anchor from ChainExchange peers under --no-fallback-rpc#111

Open
Reiers wants to merge 2 commits into
feat/91-chainxchg-clientfrom
feat/109-chainxchg-anchor-seed
Open

feat(#109): seed boot anchor from ChainExchange peers under --no-fallback-rpc#111
Reiers wants to merge 2 commits into
feat/91-chainxchg-clientfrom
feat/109-chainxchg-anchor-seed

Conversation

@Reiers

@Reiers Reiers commented Jul 3, 2026

Copy link
Copy Markdown
Owner

What

Closes #109. Wires the #91 ChainExchange client (PR #110) into the bridge-off boot-anchor seed path so a --no-fallback-rpc node boots with zero gateway, zero Glif.

Why

The bridge-off seed previously fetched the anchor tipset via a bitswap-only source. On calibration (and any network without a same-network gateway) that deterministically fails:

  • bitswap has no peers serving that specific historical block;
  • gateway.lantern.reiers.io is mainnet-only (mainnet beacon + lantern-census --network mainnet upstreams) → every calibration CID returns MISS … not found in any upstream.

So a calibration --no-fallback-rpc cold boot could never seed the anchor (bridge-off seed: fetch anchor block … via bitswap) and fell over — the blocker behind the stalled #104 Phase 1.

How

  • construct the ChainExchange client on the libp2p host alongside the existing responder; trusted-floor peers tried first;
  • seed the anchor tipset via FetchTipsetChain(anchorCids, 1) — headers only, CID-verified against the multi-source quorum anchor. A peer can only refuse, never splice (client requires Chain[0] == anchor CIDs);
  • bounded wait (-seed-peer-wait, default 120s) for peers to connect + advertise /fil/chain/xchg/0.0.1; fail loud on timeout — never silently fall back to a gateway/RPC in bridge-off mode;
  • also SetChainFetcher on the gossip ingestor so runtime parent-walk gap backfill prefers peer-sourced headers over the per-CID bitswap walk.

Calibration/mainnet Lotus + Forest peers already serve the standard ChainExchange protocol, so this is a genuine gateway-free path — the whole point of the bridge-off thesis.

Test

Stacks on feat/91-chainxchg-client (#110).

Reiers added 2 commits July 3, 2026 12:57
…back-rpc

The bridge-off boot anchor seed previously fetched the anchor tipset via
a bitswap-only source. On calibration (and any network without a
same-network gateway) this fails: bitswap has no peers serving that
historical block and gateway.lantern.reiers.io is mainnet-only. So a
--no-fallback-rpc cold boot could never seed and fell over.

Wire the #91 ChainExchange client (PR #110) into the seed path:
- construct the client on the libp2p host alongside the responder
- seed the anchor tipset via FetchTipsetChain(anchorCids, 1): headers
  only, CID-verified against the multi-source quorum anchor (a peer can
  only refuse, never splice - verifyChain requires Chain[0]==anchor CIDs)
- bounded wait (-seed-peer-wait, default 120s) for peers to connect +
  advertise /fil/chain/xchg/0.0.1; fail loud on timeout, never silently
  fall back to a gateway/RPC in bridge-off mode
- also SetChainFetcher on the gossip ingestor so runtime parent-walk gap
  backfill prefers peer-sourced headers over the per-CID bitswap walk

Gateway-free, Glif-free boot: calibration/mainnet Lotus + Forest peers
already serve the standard ChainExchange protocol. Closes #109.

build+vet+gofmt clean; net/... + cmd/... suites green; linux/amd64 cross-build ok.
…>tip gaps

A single FetchTipsetChain is capped at MaxRequestLength (900) tipsets, so
the previous one-shot chainExchangeBackfill could not bridge a stale
quorum anchor thousands of epochs behind live head: it fetched only the
top 900, tried to install a non-contiguous chunk, and failed
(backfillFail). Snapshot-free boot inherently means bridging a large
anchor->tip gap, so loop the request in <=900 chunks, rooting each at the
previous batch's oldest tipset's parents, until the store head is reached;
then install the whole gap oldest-first so the head walks up contiguously.

Bounded by maxBackfillTipsets (20k) and a no-progress guard against a
misbehaving peer. Every level stays CID-verified by the client.

Validated live on calibration: bridge-off Light boot seeded the anchor
from chainxchg peers (gateway-free, Glif-free) then this closes the gap
to live head.

build+vet+gofmt clean; net/blockingest + net/chainxchg tests green; linux/amd64 cross-build ok.
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