fix(bootstrap): skip backup peer list when no bootstrap peers configured - #1213
Open
karawitan wants to merge 1 commit into
Open
fix(bootstrap): skip backup peer list when no bootstrap peers configured#1213karawitan wants to merge 1 commit into
karawitan wants to merge 1 commit into
Conversation
bootstrapRound no longer consults the backup peer list when cfg.BootstrapPeers() returns empty. The backup list exists only as a recovery mechanism for when configured bootstrap peers are down (#8856); with no configured peers there is nothing to recover from, so dialing stale backup peers persisted from previous runs is skipped. This lets a caller fully disable bootstrap dialing by setting an empty peer list (for example a local-only/offline node with Routing.Type=none), and works with runtime overrides such as `ipfs daemon --routing=none` that do not change the config file. Nodes that configure explicit Bootstrap peers are unaffected. Closes kubo issue #11452 (companion kubo PR to follow). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
karawitan
force-pushed
the
fix/bootstrap-skip-backup-when-no-peers
branch
from
September 7, 2026 07:12
fc791c5 to
76cf61a
Compare
karawitan
pushed a commit
to karawitan/kubo
that referenced
this pull request
Sep 7, 2026
Rework of ipfs#11453 per maintainer review (lidel): the fix belongs in boxo (bootstrap.bootstrapRound skips the backup list when no bootstrap peers are configured), not behind a Routing.Type=none guard in kubo. This PR is now the companion to ipfs/boxo#1213: - Pin the boxo fix via a temporary replace directive pointing at the boxo PR branch. Once ipfs/boxo#1213 merges, repoint at boxo main and convert to a pseudo-version pin. - Add a kubo-level regression test (TestBootstrapWithEmptyPeerListAndStaleBackupPeers) verifying IpfsNode.Bootstrap runs with an empty Bootstrap config and a populated TempBootstrapPeersKey without error. - Document under Bootstrap in docs/config.md that an empty list disables all bootstrap dialing, including saved backup peers. - Add a v0.44 changelog highlight. Drop the v0.43 entry and the broken emoji from the original PR. Closes ipfs#11452 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a node has no bootstrap peers configured (for example
Routing.Type=nonewith an emptyBootstraplist, oripfs daemon --routing=none),bootstrapRoundstill loads and dials backup peers persisted from previous runs (stored underTempBootstrapPeersKeyin the datastore). This causes unwanted external DNS resolution and connection attempts to stale addresses every 30 seconds, even though the operator explicitly disabled routing/bootstrap. Reported in kubo#11452.The backup peer list exists as a recovery mechanism for when configured bootstrap peers are down (#8856). With no configured bootstrap peers, there is nothing to recover from, so consulting the backup list is the wrong behavior.
Fix
In
bootstrapRound, return early whencfg.BootstrapPeers()returns an empty list, before consulting the backup peer list. This:Bootstrap: null/ empty list (becomes an empty[]peer.AddrInfo)ipfs daemon --routing=none(runtime override that does not change the config file)Routing.Type=none+ explicitBootstrappeers working (those nodes still dial their configured peers)Nodes that configure explicit
Bootstrappeers are unaffected: the backup-list fallback still runs when those peers fail to connect.Behavior change
Previously, a node with default routing and an empty
Bootstraplist would still dial backup peers. After this change it does not. This aligns behavior with operator intent: an emptyBootstraplist now means "no bootstrap dialing at all, including saved backup peers." This is a fix, directed by @lidel in kubo#11453 (review): "The simplest fix is in boxo, inbootstrap.bootstrapRound: whencfg.BootstrapPeers()returns nothing, stop there instead of trying the backup list."Testing
go build ./bootstrap/...passesgo test ./bootstrap/... -count=1passes (all existing tests green)go vet ./bootstrap/...passesgofmt -l bootstrap/cleanTestBootstrapRoundSkipsBackupWhenNoBootstrapPeers: verifiesbootstrapRounddoes not callloadBackupBootstrapPeerswhenBootstrapPeers()is emptyTestBootstrapRoundDialsBackupWhenBootstrapPeersPresent: verifies the backup list is still consulted when configured bootstrap peers fail to connect, preserving the #8856 recovery mechanismCompanion kubo PR
REQUIRED companion kubo PR: ipfs/kubo#11453 (reworked to pin this boxo branch, fix docs, and add a kubo-level regression test). It is a draft while this boxo PR is unmerged; kubo CI status will be reported there.
Generated with Devin