net: onion AddrMan, --only-net, SOCKS dial of .onion - #645
Merged
Merged
Conversation
9 tasks
rearden-grok
Bot
force-pushed
the
net/onion-addrman
branch
from
September 20, 2026 02:03
fec1f84 to
e89beb5
Compare
rearden-grok
Bot
force-pushed
the
net/onion-addrman
branch
from
September 20, 2026 21:15
253418a to
b8d54f7
Compare
rearden-grok
Bot
force-pushed
the
net/onion-addrman
branch
from
September 20, 2026 21:37
b8d54f7 to
0bc2237
Compare
rearden-grok
Bot
force-pushed
the
net/onion-addrman
branch
from
September 20, 2026 22:09
0bc2237 to
17c0b60
Compare
AddrMan is still SocketAddr-keyed; onion rows need a stable pubkey+port identity with checksummed .onion display before they can be stored. Co-authored-by: Cursor <cursoragent@cursor.com>
learn_addrv2 dropped onion because AddrMan was SocketAddr-keyed. The book now stores NetAddr; clearnet dial and peers-v1 save still use the Ip arm so existing IBD paths stay unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
Onion rows were dropped on save because v1 tokens were SocketAddr-only. v2 writes .onion:port; v1 IPv4/IPv6 files still load. Co-authored-by: Cursor <cursoragent@cursor.com>
Onion outbound must not TcpStream::connect or local DNS. Dialer::connect_net sends ATYP=3 through --proxy/--onion SOCKS; Direct onion is an error. Co-authored-by: Cursor <cursoragent@cursor.com>
Operator-pinned peers are NetAddr so .onion:port is a start error when invalid, not a silent SocketAddr parse miss. Co-authored-by: Cursor <cursoragent@cursor.com>
Repeatable ipv4/ipv6/onion. i2p/cjdns stay unknown until later plans. only-net=onion without --proxy/--onion is a start error. Co-authored-by: Cursor <cursoragent@cursor.com>
NixOS onlyNet list emits --only-net per entry. OPERATOR documents peers v2, SOCKS required for onion, and kebab --only-net. Co-authored-by: Cursor <cursoragent@cursor.com>
`--all-targets` also needs the run_p2p integration connect list as NetAddr after ListenOpts.connect left SocketAddr. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PeerEvent::Addrs was Vec<SocketAddr>, so onion-only IBD dropped learned Tor v3 rows and could not redial from getaddr. Co-authored-by: Cursor <cursoragent@cursor.com>
Domain peers parsed back through 0.0.0.0, so VERSION/LivePeer lost the onion NetAddr. Name the dummy version_socket and parse Domain as onion. Co-authored-by: Cursor <cursoragent@cursor.com>
rearden-grok
Bot
force-pushed
the
net/onion-addrman
branch
from
September 21, 2026 03:01
17c0b60 to
d2332e0
Compare
reardencode
added this pull request to stack #669
September 21, 2026 03:40
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.
Plan
docs/personal-node-plans/02-onion-addrman.md: BIP155 Tor v3 rows stay in the peer book, persist asrbitcoin-peers-v2, and dial through the SOCKS client from #641.Stacked on #644 (
net/listen-off). NixOSonlyNetis eval-only argv; this PR does not change systemdAfter/Wantsand is not labelednixos-module-runtime.Summary
NetAddr::{Ip,Onion}with Tor v3 SHA3 checksum parse/display;learn_addrv2keepsAddrV2::TorV3..onion:port; v1 IPv4/IPv6 files still load.Dialer::connect_netSOCKS ATYP=3 for onion; Direct onion is an error.--only-net=onionwithout--proxy/--onionis a start error.--connect/--seed-nodeaccept….onion:port.--only-netis repeatableipv4/ipv6/onion(i2p/cjdnsstay unknown until 04/08).services.rbitcoin.onlyNetlist; eval asserts--only-net onionwhen set.Test plan
cargo test -p rbitcoin-net --lib netaddr_cargo test -p rbitcoin-net --lib learn_addrv2/addrman/peers_file_cargo test -p rbitcoin-net --lib dial_onion_cargo test -p rbitcoin-node --lib connect_onion/only_net_cargo clippy --workspace --all-targets -- -D warningscargo deny check/./scripts/ast-grep.sh/cargo fmt --all -- --checknix build .#checks.x86_64-linux.nixos-module-eval --no-linkfmt,deny,clippy,ast-grep,test,windows,macos,coverage,nixos-module-eval)Made with Cursor