Skip to content

net: outbound-only --listen=0 / --max-inbound 0 - #644

Open
rearden-grok[bot] wants to merge 5 commits into
net/socks-proxyfrom
net/listen-off
Open

rearden-grok[bot] wants to merge 5 commits into
net/socks-proxyfrom
net/listen-off

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Plan docs/personal-node-plans/01-listen-off.md: a home node can start with no clearnet P2P bind, no inbound slots, and no self-announce.

Stacked on #641 (net/socks-proxy). Default NixOS ExecStart still passes --listen, so this PR does not change the runtime VM argv and is not labeled nixos-module-runtime.

Summary

  • --max-inbound 0 is valid config (max_outbound still >= 1).
  • --listen=0 / --no-listen (and conf listen=0) skip the P2P TCP bind; omitted --listen still defaults to loopback.
  • P2PNode::start_outbound_only handshakes outbound without a listener; inbound addconnection stays refused. local_addr is 127.0.0.1:0.
  • --no-discover suppresses addr self-announce and getnetworkinfo.localaddresses even when --external-ip is set.
  • NixOS first-class p2p.listen (default true), p2p.maxInbound (default 125), p2p.discover (default true). listen = false emits --no-listen and does not open the P2P firewall port.

Test plan

  • cargo test -p rbitcoin-node --lib max_inbound_
  • cargo test -p rbitcoin-node --lib listen_zero_
  • cargo test -p rbitcoin-net --lib p2p_outbound_only_
  • cargo test -p rbitcoin-net --lib externalip_ / cargo test -p rbitcoin-rpc --lib getnetworkinfo_localaddresses
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo deny check / ./scripts/ast-grep.sh / cargo fmt --all -- --check
  • nix build .#checks.x86_64-linux.nixos-module-eval --no-link
  • required GitHub checks green (fmt, deny, clippy, ast-grep, test, windows, macos, coverage, nixos-module-eval)

Made with Cursor

rearden-grok Bot and others added 5 commits September 19, 2026 18:58
Home nodes with no inbound slots are a valid start posture. Outbound
still requires max_outbound >= 1.

Co-authored-by: Cursor <cursoragent@cursor.com>
Distinguish omitted listen (loopback default) from explicit off so a
home node can start without a clearnet P2P socket.

Co-authored-by: Cursor <cursoragent@cursor.com>
Home nodes skip TcpListener bind. Outbound follow still handshakes;
addconnection inbound stays refused. local_addr is 127.0.0.1:0.

Co-authored-by: Cursor <cursoragent@cursor.com>
Outbound-only home nodes must not leak a LAN or ISP address via addr
messages or getnetworkinfo.localaddresses, even when --external-ip is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
Outbound-only NixOS units skip the P2P bind, inbound cap, self-announce,
and firewall hole. Default ExecStart still passes --listen.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

0 participants