feat(netutils)!: GrpcIndexer chooses its transport at construction - #2602
Draft
zancas wants to merge 3 commits into
Draft
feat(netutils)!: GrpcIndexer chooses its transport at construction#2602zancas wants to merge 3 commits into
zancas wants to merge 3 commits into
Conversation
A GrpcIndexer holds one tonic channel and speaks the lightwallet gRPC
protocol over it; until now the only constructors dialed clearnet. The
new `new_via_socks5` constructor (behind `socks5-transmit`) builds the
channel through the local SOCKS5 proxy — the mixnet tunnel — so every
Indexer and TransparentIndexer RPC on that instance travels over the
mixnet, with no per-method routing flag. This is the shape the 5.0.1
CHANGELOG promised ("nym enabled clients ... will also be held by
GrpcIndexer"), and it deliberately avoids the proof-of-concept's
cfg-forked trait (PRs #2335/#2338), whose `proxied: bool` on every
method churned every caller.
Because construction now decides the transport, the private channel
field's old name became untrue; it is renamed `clear_net_client` →
`client`. The public `get_clear_net_client` accessor is removed: it has
no callers in this workspace, zingo-mobile, or zingo-pc, and its name
promises a clearnet channel the type no longer guarantees. The endpoint
scaffolding that `new`, `new_lazy`, and the SOCKS5 dial each rebuilt is
collapsed into the shared `channel_endpoint` / `clearnet_endpoint`
helpers, and `connect_via_socks5` opens to the crate so the constructor
reuses the tunnel dial, its phase-typed errors included.
Verified in the standalone netutils workspace with rustfmt, clippy -D
warnings on the default, socks5-transmit, and
globally-public-transparent + ping-very-insecure configurations, and
the 32-test suite; the main workspace's zingolib checks clean against
the removal under --features nym.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The wholesale `pub use lightwallet_protocol` made the generated client stub reachable from every dependent, inviting transport decisions outside the constructors. A facade module of the same path now carries the protocol message types and the generated server trait pair (mock indexers implement the service), but not the client stub: consumers hold a GrpcIndexer, whose transport is chosen at construction, and speak through the Indexer trait. Every existing message-type import path is unchanged, verified by checking pepper-sync, zingolib with nym and testutils, and the libtonode test imports against the facade; the netutils feature matrix stays clippy-clean and its suite 32/32. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The grilling ruling on the generated client stub was to hide it rather than rename it, and the glossary records the concept that makes the hiding coherent: one protocol, spoken by every Indexer, with Sync Indexer and Broadcast Indexer as policy roles above it rather than wire dialects. The Indexer entry now points at the ratified term. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zancas
marked this pull request as ready for review
July 30, 2026 04:39
zancas
marked this pull request as draft
July 30, 2026 04:54
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.
Three commits, all in zingo-netutils except one glossary entry.
GrpcIndexerchooses its transport at construction (408efaa). New constructornew_via_socks5(uri, socks5_addr, timeout), behindsocks5-transmit, builds the channel through the existing SOCKS5 dial (connect_via_socks5, opened topub(crate)): https-only, webpki TLS over the tunnel, phase-typedSocks5TransmitError. EveryIndexerandTransparentIndexerRPC on such an instance travels the mixnet; there is no per-method routing flag. The private field is renamedclear_net_client→clientto match, andget_clear_net_clientis deleted — it had no callers in this workspace, zingo-mobile, or zingo-pc. The endpoint scaffolding thatnew,new_lazy, and the SOCKS5 dial each rebuilt collapses into sharedchannel_endpoint/clearnet_endpointhelpers (scheme and authority validation included); the SOCKS5 path keeps itsconnect_timeoutand its deliberate no-RPC-bound policy.The protocol re-export is curated (4cedf4e). The wholesale
pub use lightwallet_protocolis replaced by a facade module at the same path carrying the message types plus the generated server trait pair (CompactTxStreamer/CompactTxStreamerServer, which mock indexers implement) — but not the generated client stub, so consumers cannot construct a transport outside the constructors above. Every existing consumer import path is unchanged.Glossary (c1490aa).
zingolib/CONTEXT.mdgains a Lightwallet Protocol entry — the one protocol every Indexer speaks, with Sync Indexer and Broadcast Indexer as policy roles above it — and the Indexer entry now uses the term.Verification. Standalone netutils workspace: rustfmt;
clippy -D warningson the default,socks5-transmit, andglobally-public-transparent,ping-very-insecureconfigurations; 32/32 tests. Main workspace:cargo checkclean for pepper-sync, zingolib (nymandnym,testutils), and the libtonode-tests test targets.🤖 Generated with Claude Code