Skip to content

feat(cli): proxy start --route pins explicit route(s) at session start - #4243

Merged
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/proxy-start-route-flag
Aug 27, 2026
Merged

feat(cli): proxy start --route pins explicit route(s) at session start#4243
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/proxy-start-route-flag

Conversation

@0pcom

@0pcom 0pcom commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Adds a --route flag to proxy start: give it a JSON file of {forward,reverse} hop pairs (the cli route calc <exit> --count N --json shape) 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 of proxy start then hand-driving proxy mux set.

skywire cli route calc <exit> --count 2 --min 2 --json > legs.json
skywire cli proxy start --pk <exit> --route legs.json --mux 2

It shares one reconcile engine with proxy mux set — the add/prune loop is factored out into reconcileLegs() 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 — so RemoveMuxRouteByTransport refuses 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 (pass ForwardHops to the primary dial, bypassing the finder) is the dial-level follow-up. Also: route calc --source tps avoids the occasional stale-transport install failure the default TPD source can hit.

Validated live against a running visor: proxy start --pk <exit> --route legs.json reached Running and reconciled (route pinned: N leg(s) added); proxy mux set output is unchanged after the refactor.

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.
@0pcom
0pcom merged commit dcdf0ed into skycoin:develop Aug 27, 2026
11 of 15 checks passed
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.

1 participant