Skip to content

Peer-table eclipse hardening for the head path: pin anchor peers + head-source diversity #80

Description

@Reiers

Problem

The running-head fork-choice hardening in #79 raises the cost of a peer-table eclipse, but it's only as good as the diversity of the peer set feeding the head. If an attacker can fully capture the gossip peer table (the "get into your peer table 5 times" attack, zenground0 / fil-curio-dev 2026-06-30), they control every candidate the fork-choice rule sees.

Lantern already has the primitives: net/bitswap PreferredPeers (warm-pinned), gossipsub peer-scoring (net/blockpub, net/hello), and MinPeers/MaxPeers connection-manager bounds (net/libp2p/host.go). They are not yet wired into a deliberate anti-eclipse posture for the head path.

Proposed fix (pure-Go)

  1. Pin trusted anchor/beacon peers as an un-evictable floor. The trusted beacon floor already exists for cert-exchange (cmd/lantern/beacon_peer_provider.go, security Security: bootstrap/beacon peer trust — operator-pinned + DHT-discovered peers feed cert-exchange without an authenticity floor #59). Ensure the head-following peer set always retains those pinned peers so the table can't be fully replaced by attacker-dialed peers.
  2. Diversity requirement on head-bearing peers. Don't let a single peer (or single ASN/IP prefix, best-effort) be the sole source of a head advance. Require head candidates from a minimum number of distinct, scored peers before adopting.
  3. Lean on existing gossipsub peer-score so peers that forward non-canonical / non-advancing blocks decay out of the mesh.

What this does NOT do

Same boundary as #79: hardening, not a finality guarantee. Closing the unfinalized-tip fork against a powerful adversary is F3's job. This is eclipse-resistance hygiene, pure-Go, no ffi.

Acceptance

  • Trusted anchor/beacon peers are an un-evictable floor in the head-following peer set
  • Head advance requires corroboration from >=N distinct scored peers (config, sane default)
  • Tests: single-peer-only head advance is held; pinned floor survives a flood of attacker dials

Context: fil-curio-dev thread w/ zenground0, 2026-06-30. Pairs with #79.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureTrust model / swarm designp2Medium prioritysecuritySecurity finding or hardening

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions