Skip to content

feat(router): allow removing the primary mux leg (re-home) for exact route control - #4244

Merged
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/mux-primary-leg-control
Aug 27, 2026
Merged

feat(router): allow removing the primary mux leg (re-home) for exact route control#4244
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/mux-primary-leg-control

Conversation

@0pcom

@0pcom 0pcom commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Removing a mux leg via RemoveMuxRouteByTransport refused index 0 (the primary), on the belief it is too privileged to drop. But ping/pong/SACK and latency attribution read rg.tps[0] live on each call (no cached leg reference), and the mux selector is rebuilt on removal — so the survivor compacted into index 0 transparently takes over. This is the exact same re-home pruneDeadTransports (index-0 death) and pruneLegByConsumeRule (remote leg retire) already perform in production; the last-leg guard is the only real floor.

That refusal was the single thing blocking full manual route control. With it relaxed:

RemoveMuxRouteByTransport has no automatic caller — only the explicit RemoveMuxRoute RPC (CLI mux rm / mux set / --route) — so this is dormant until an operator asks for it. Unit tests cover the re-home and the surviving last-leg floor; the full pkg/router suite passes.

…route control

RemoveMuxRouteByTransport refused to remove leg index 0, on the belief that
the primary leg is too privileged to drop. But ping/pong/SACK and latency
attribution read rg.tps[0] LIVE on each call (no cached leg reference) and the
mux selector is rebuilt on removal, so the survivor compacted into index 0
transparently takes over — the exact re-home pruneDeadTransports (index-0
death) and pruneLegByConsumeRule (remote leg retire) already perform in
production. The last-leg guard is the only real floor.

That refusal was the one thing blocking full manual route control: with it
gone, `proxy start --route` prunes the auto primary (so the leg-set is EXACTLY
the pinned routes), `proxy mux set --legs <new> --prune` performs a live
direct<->multihop route switch on a running app, and a single pinned route
yields a genuine single-leg session. RemoveMuxRouteByTransport has no automatic
caller — only the explicit RemoveMuxRoute RPC — so this is dormant until an
operator asks for it.

Tests: removing the primary re-homes to the promoted leg; the last-leg floor
still refuses removing the sole leg.
@0pcom
0pcom merged commit a28cb15 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