feat(net)!: add cold route rank for pop skipping - #2894
Conversation
Co-Authored-By: GPT-5 <noreply@openai.com>
|
Superseded by #2925. The diagnosis here is right and I kept it: once two relays both carry a broadcast they both advertise 0, marginal cost ties, and the hash picks the aggregation root at random. The undiscounted path cost is the signal that breaks that tie, and no receiver can derive it locally, so it does have to go on the wire. What changed is the shape. #2925 makes the route cost a pair ( The One more difference worth flagging: the rank this PR advertises is a min over all announced routes, which is not necessarily the route the relay serves from, so it can advertise a cold cost it is not actually paying. #2925 ranks on the serving route's cold cost, which is what makes the descent argument hold — adopting a parent charges that link onto your own cold cost, so you can only ever rank above the relay you adopted. Closing in favor of #2925. (written by Opus 5) |
Summary
(cold cost, relay hash)rank is strictly lower, and compare warm rank before hop count when marginal costs tiejs/netand specify it in the moq-lite draftThis replaces the viable remaining rank slice from #2179. The old base/transit-cost prototype was superseded by cumulative Route Cost in #2424 and is now far behind
dev. The current design comes from the pop-skipping quest.Marginal warm discounts intentionally collapse to zero, but that erases the upstream path cost needed to select an aggregation root in asymmetric and simultaneous activation topologies. Cold Route Cost preserves that undiscounted path signal without changing marginal cost as the primary routing metric.
Public API changes
lite::AnnounceBroadcast::ActiveandRestartadd the requiredcold: RouteCostfield. This is why the PR targetsdev.AnnounceBroadcastvariants add optionalcold?: bigint.pub(crate); no second publicbroadcast::Routemetric is exposed.Test plan
nix develop --command just fixnix develop --command just checknix develop --command cargo test -p moq-net(864 unit tests plus integration and docs)nix develop --command bun test js/net/src/lite/announce.test.tsnix develop --command just test smoke-full(21 Rust/Python/JS/C/GStreamer combinations)Cross-package sync: updated
js/netanddrafts/draft-lcurley-moq-lite.md. There is no existingdoc/conceptroute-selection page to update. The IETF cluster wire is intentionally unchanged because the current quest rollout is Lite06-only.(Written by GPT-5)