feat(cli): proxy start --route pins explicit route(s) at session start - #4243
Merged
Conversation
Add a --route flag to `proxy start` that takes a JSON file of {forward,
reverse} hop pairs (the `cli route calc <exit> --count N --json` shape)
and, once the proxy is up, reconciles its mux legs to those routes —
each pinned route added as a leg, aux auto legs pruned. This is manual
override of intermediate selection at start time, instead of starting
then hand-driving `proxy mux set`.
Shares one reconcile engine with `proxy mux set`: the add/prune loop is
factored out of that command into reconcileLegs() and both call it (the
command's behavior is unchanged).
Known boundary: the auto PRIMARY leg (index 0) is privileged
(ping/SACK/latency attribution hardcode tps[0]) and cannot yet be
pruned, so it remains alongside the pinned legs. Full primary override —
so the working route set is EXACTLY the pinned routes with no auto
leg — is the dial-level follow-up (pass ForwardHops to the primary dial,
bypassing the finder). Also note `route calc --source tps` avoids the
occasional stale-transport install failure the TPD source can hit.
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.
Adds a
--routeflag toproxy start: give it a JSON file of{forward,reverse}hop pairs (thecli route calc <exit> --count N --jsonshape) and, once the proxy is up, its mux legs are reconciled to those routes — each pinned route added as a leg, aux auto legs pruned. Manual override of intermediate selection at start, instead ofproxy startthen hand-drivingproxy mux set.It shares one reconcile engine with
proxy mux set— the add/prune loop is factored out intoreconcileLegs()and both call it; the command’s behavior is unchanged.Known boundary (documented in the flag help): the auto primary leg (index 0) is privileged — ping/SACK and latency attribution hardcode
tps[0], and the selector treats leg 0 as always-ready — soRemoveMuxRouteByTransportrefuses to remove it. Thus the pinned legs sit alongside the surviving auto primary; the working set is not yet EXACTLY the pinned routes. Full primary override (passForwardHopsto the primary dial, bypassing the finder) is the dial-level follow-up. Also:route calc --source tpsavoids the occasional stale-transport install failure the default TPD source can hit.Validated live against a running visor:
proxy start --pk <exit> --route legs.jsonreached Running and reconciled (route pinned: N leg(s) added);proxy mux setoutput is unchanged after the refactor.