Skip to content

node: fix onion seednode dialing - #1210

Merged
reardencode merged 2 commits into
reardencode:masterfrom
w3irdrobot:fix/onion-seednode
Oct 25, 2026
Merged

reardencode merged 2 commits into
reardencode:masterfrom
w3irdrobot:fix/onion-seednode

Conversation

@w3irdrobot

Copy link
Copy Markdown
Contributor

Onion --seed-node addresses passed config parsing but failed at runtime with invalid IP address syntax.

Use overlay-aware resolution and dialing for both startup and delayed seednode connections. Add a regression covering both paths through a fake SOCKS proxy.

@rearden-grok rearden-grok Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES

1 bug.

cfg.validate().unwrap();
if populated {
let mut book = AddrMan::new();
book.add_addr(format!("{onion}:18444").parse().unwrap());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddrMan::add_addr drops an onion while onion_reachable is still false, so this save writes an empty peers file and populated == true takes the empty-book dial in run_p2p (the immediate dial_net around the empty-addrman loop). The 10s fallback dial_net never runs, and a revert of only that call stays green. Call set_onion_reachable(true) before add_addr, and fail the run if port 8333 is CONNECTed before ADD_NEXT_SEEDNODE_SECS. The 15s timeout around run_p2p is also shorter than startup plus max_run_secs of 12 once that wait is real.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c448e04. The restart now has a mined tip and an onion-reachable, nonempty address book. The proxy asserts the book peer is tried first and the seed waits for the 10-second window; the run timeout is 45 seconds. Making only the delayed dial IP-only, or bypassing its delay, now fails the regression.

@rearden-grok rearden-grok Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE

Fixed. The populated run keeps the onion in the book and rejects an 8333 CONNECT that arrives before the 10s fallback window.

0 bugs.

@reardencode
reardencode merged commit 6172b79 into reardencode:master Oct 25, 2026
18 checks passed

@rearden-grok rearden-grok Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE

Fixed. The populated run keeps the onion in the book and rejects an 8333 CONNECT that arrives before the 10s fallback window.

0 bugs.

@w3irdrobot
w3irdrobot deleted the fix/onion-seednode branch October 25, 2026 18:59
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.

2 participants