#36177 net: fix startup failures from stale Tor examples

full analysis

https://github.com/bitcoin/bitcoin/pull/36177 · l0rinc · +43/-26 in 4 files, 4 commits · labels: P2P

Goal

  • Prevent node startup failures caused by following outdated Tor proxy configuration examples
  • Ensure proxy argument error handling correctly guides users to valid network names

Updates `-proxy` help text and `doc/tor.md` to reference `onion` instead of the removed `tor` network name, and refactors proxy argument parsing in `src/init.cpp` to use the shared `ParseNetwork` utility. Error messages now retain original argument casing when reporting unrecognized network names, and functional tests are added for proxy option error handling.

Problem: Pull request #34031 removed `tor` as an accepted network name in favor of `onion`, but documentation and help text still directed users to pass `-proxy=...=tor`, which causes an immediate node startup failure. In addition, proxy argument parsing maintained its own duplicate string-matching logic rather than sharing the parser used by other network options.

Category: P2P (#29 of 65)

P3 · bug fix

  • P3 because it fixes node startup failures for users following official Tor guides
  • Benefit is localized to nodes configuring proxy settings with the old network name

Fixes a startup crash when users configure proxies following stale Tor documentation, and cleans up duplicate network parsing logic in initialization.

Membership: Modifies SOCKS5 proxy configuration, network name parsing, and Tor connection documentation under the P2P area label.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 0

Reviewability: Ready

  • Ready for review with passing tests and all reviewer suggestions addressed

Clean diff with tests passing and all reviewer feedback addressed.

Author status: Active. Addressed review feedback from jeanpablojp and force-pushed on 2026-09-08.

Resolved concerns:

  • Clarified documentation wording in `doc/tor.md` regarding Tor v2 and Bitcoin Core 31 network naming
  • Added missing test coverage for clearing the IPv4 proxy also clearing the name proxy in `feature_proxy.py`
  • Cleaned up redundant test comments in `rpc_net.py`

Agreement: Strong

  • Concept approval verified by testing proxy feature behavior (jeanpablojp)
  • All requested documentation clarifications and test additions were incorporated

Strong: jeanpablojp Concept ACKed with testing; author addressed all feedback.

The only reviewer tested the changes, confirmed parser behavior against the base commit, and had their review suggestions incorporated by the author.

  • jeanpablojp gave Concept ACK with manual testing of feature_proxy.py and rpc_net.py
  • jeanpablojp suggested doc clarification and a test for IPv4/name proxy clearing
  • l0rinc implemented the suggestions and credited jeanpablojp as co-author on the test commit

Review verdicts (DrahtBot): 0

Files

37 lines under test/bench/ci.

  • test/functional/feature_proxy.py +21/-10
  • src/init.cpp +13/-11
  • doc/tor.md +6/-2
  • test/functional/rpc_net.py +3/-3

Card

PR #36177 fixes node startup failures caused by stale documentation and `-proxy` help text advertising `tor` instead of `onion` after `tor` was removed as a network specification in #34031. It refactors `-proxy` network argument parsing in `src/init.cpp` to share `ParseNetwork` with other options, preserves original casing in error diagnostics, and expands functional test coverage. jeanpablojp gave a tested Concept ACK and suggested minor adjustments that the author incorporated. The PR is self-contained, ready for review, and has no open dependencies.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:58, confidence high, input hash 308b5c005ab4738a