pub(crate) async fn crawl_once<S>(
crawl_service: &mut RateLimitBySkipping<CrawlFanout<S>>,
fanout_limit: Option<usize>,
) -> Result<Option<MorePeers>, BoxError>Expand description
Crawl the network for more peer addresses, limiting the fanout to
fanout_limit if it is Some.
- Ask a few live
Respondedpeers to send us more peers. - Process all completed peer responses, adding new peers in the
NeverAttemptedGossipedstate.
Returns Some(MorePeers) if the crawl was successful and the crawler
should ask for more peers. Returns None if there are no new peers.
§Correctness
Pass the initial peer set size as fanout_limit during initialization,
so that Zebra does not send duplicate requests to the same peer.
The crawler exits when a crawl returns an error, so errors are only returned on permanent failures.
The handshaker sets up the peer message receiver so it also sends a
Responded peer address update.
next_reconnect_peer puts peers into the AttemptPending state.
§Security
This call is rate-limited to prevent sending a burst of repeated requests for new peer
addresses. Each call will only crawl the network if more time
than MIN_PEER_GET_ADDR_INTERVAL has passed since
the last crawl. Otherwise, the crawl is skipped.