wip#2
Closed
lorenzolfm wants to merge 1 commit into
Closed
Conversation
lorenzolfm
force-pushed
the
feat/wire-multiple-fixed-peers
branch
15 times, most recently
from
May 30, 2026 10:42
98efdac to
8a8d9b4
Compare
Previously `--connect` accepted a single peer and the node connected only to it. This generalizes it to a list: `--connect` may be passed multiple times, and the node connects exclusively to the given peers, mirroring Bitcoin Core's `-connect` behavior. - `UtreexoNodeConfig.fixed_peer: Option<String>` becomes `fixed_peers: Vec<String>`, and the resolved `NodeCommon.fixed_peer` becomes `fixed_peers: Vec<LocalAddress>`. - Resolved peers are deduplicated by (address, port) so passing the same host twice doesn't open duplicate connections. - `create_connection` picks the first not-yet-connected fixed peer; connection failures are logged and retried on the next maintenance tick instead of aborting the loop. - `can_start_headers_sync` starts once every fixed peer is connected, or after a grace period with at least one peer connected, so a single dead or unreachable fixed peer can't wedge the node in `CreatingConnections` forever. - `--connect` accepts an IPv4/IPv6/hostname address with an optional port. Closes getfloresta#861 BREAKING CHANGE: `UtreexoNodeConfig::fixed_peer` (`Option<String>`) is replaced by `fixed_peers` (`Vec<String>`). Callers building the config manually must update the field name and type.
lorenzolfm
force-pushed
the
feat/wire-multiple-fixed-peers
branch
from
May 30, 2026 10:48
8a8d9b4 to
a47476d
Compare
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.
Description and Notes
Generalizes
--connectfrom a single fixed peer to a list, so the node can be pinned to multiple peers at once, mirroring Bitcoin Core's-connect.--connectmay now be passed multiple times; when any value is present, the node connects exclusively to those peers and skips all peer-discovery paths.This closes getfloresta#861, picking up where the previous "Up for grabs" PR getfloresta#873.
Key points:
UtreexoNodeConfig.fixed_peer: Option<String>→fixed_peers: Vec<String>; resolvedNodeCommon.fixed_peer→fixed_peers: Vec<LocalAddress>.(address, port), so passing the same host twice doesn't open duplicate connections.create_connectionselects the first not-yet-connected fixed peer. A failed attempt is now logged atdebugand retried on the next maintenance tick rather than silently dropped or aborting the reconnect loop.can_start_headers_syncbegins sync once all fixed peers are connected, or after a grace period with at least one connected peer, so a single dead/unreachable fixed peer can't wedge the node inCreatingConnectionsforever.How to verify the changes you have done?
cargo test -p floresta-wire— 31 pass.cargo check -p floresta-wire -p floresta-node -p florestad— no warnings.florestad --connect 127.0.0.1:8333 --connect 10.0.0.1:8333connects only to those two peers; passing one of them twice opens a single connection.