Skip to content

Closed - opened in error - #1295

Closed
nymd wants to merge 1 commit into
libp2p:masterfrom
ipni:feat/fullrt-route-table-filter
Closed

nymd wants to merge 1 commit into
libp2p:masterfrom
ipni:feat/fullrt-route-table-filter

Conversation

@nymd

@nymd nymd commented Sep 17, 2026

Copy link
Copy Markdown

Opened against the wrong repository in error and closed. Please disregard.

fullrt builds its entire routing table from what the crawler reports, and
filters every reported peer through kaddht.PublicRoutingTableFilter before
keeping it. That filter starts by requiring an open connection to the peer:

	conns := d.Host().Network().ConnsToPeer(p)
	if len(conns) == 0 {
		return false
	}

which holds for DefaultCrawler, because it has just dialled the peer and the
connection is still open when handleSuccess runs. It cannot hold for a crawler
that reports peers it did not dial. The motivating case is a crawler that
replays a routing table persisted from a previous run, so a restart is warm in
seconds rather than after a full crawl: it dials nothing by design, so every
peer it reports is dropped, the table stays empty, Ready() never becomes true,
and the next refresh crawl - which is seeded from the peers the last one found -
degrades to a cold crawl from the bootstrap peers.

No existing option reaches this, so add one. WithRouteTableFilter takes the
existing kaddht.RouteTableFilterFunc and defaults to
kaddht.PublicRoutingTableFilter, so behaviour is unchanged unless a caller asks
for something else. The filter is handed the *FullRT, which is what the default
already expects, so a caller can delegate to PublicRoutingTableFilter and widen
it rather than reimplement the public and relay checks it still wants.

PublicRoutingTableFilter itself is untouched. The standard DHT's routing table
uses it too, and that is where the connection requirement earns its keep.

Tests cover the default still dropping a reported peer with no connection (the
regression guard), a supplied filter admitting them and making Ready() true, a
supplied filter rejecting everything, and the option rejecting nil.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeQZdq8YRVNZqwcFvJ9hrj
@nymd nymd closed this Sep 17, 2026
@nymd
nymd deleted the feat/fullrt-route-table-filter branch September 17, 2026 22:19
@nymd nymd changed the title fullrt: let callers supply the routing table filter Closed - opened in error Sep 17, 2026
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