Skip to content

Make Tor connection opt-in; default to a direct connection#201

Open
pacu wants to merge 1 commit into
mainfrom
fix-tor-connection
Open

Make Tor connection opt-in; default to a direct connection#201
pacu wants to merge 1 commit into
mainfrom
fix-tor-connection

Conversation

@pacu

@pacu pacu commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Problem

--connection defaulted to tor, so every networked command (e.g. wallet init, wallet restore-mnemonic, sync) routed through the built-in Tor client by default. Tor bootstraps fine, but the actual connection intermittently fails because arti resolves the lightwalletd hostname at the exit relay:

Error: gRPC-over-Tor error: Tonic error: transport error:
Tor error: tor: remote hostname lookup failure: Protocol error while launching a data stream

This failure lives in arti/zcash_client_backend::tor and is exit-relay/network dependent, so it isn't something we can reliably fix in this repo. The result was that the tool could fail out of the box through no fault of the user.

Fix

Make Tor opt-in:

  • Default --connection is now direct.
  • Tor is available explicitly via --connection tor.
  • Help text and doc comments updated to reflect that Tor is opt-in.

Verification

Re-ran the previously failing flow (wallet init against testnet.zec.rocks:443) with the new default. It connects directly and completes wallet initialization (data.sqlite, keys.toml written). --connection tor still parses and routes over Tor for users who want it.

Closes #200

🤖 Generated with Claude Code

@pacu
pacu force-pushed the fix-tor-connection branch from 8ddea80 to a7f53bd Compare June 24, 2026 21:06
Connecting over the built-in Tor client is unreliable: arti performs the
lightwalletd hostname resolution at the exit relay, which intermittently
fails with:

    gRPC-over-Tor error: Tonic error: transport error:
    Tor error: tor: remote hostname lookup failure:
    Protocol error while launching a data stream

Because `--connection` defaulted to `tor`, every networked command
(including `wallet init`/`restore-mnemonic`) could fail out of the box
through no fault of the user.

Change the default connection mode to `direct`. Tor is now an explicit
opt-in via `--connection tor`, and the help text documents this.

Closes #200

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pacu
pacu force-pushed the fix-tor-connection branch from a7f53bd to e300cd5 Compare July 4, 2026 21:22
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.

Make Tor Opt-in to improve stability

1 participant