Skip to content

network-mux weighted fair queueing and token bucket for burst support#5322

Open
crocodile-dentist wants to merge 17 commits intomainfrom
mw/mux-single-peer-performance
Open

network-mux weighted fair queueing and token bucket for burst support#5322
crocodile-dentist wants to merge 17 commits intomainfrom
mw/mux-single-peer-performance

Conversation

@crocodile-dentist
Copy link
Copy Markdown
Contributor

@crocodile-dentist crocodile-dentist commented Feb 24, 2026

Description

  • Implements a token bucket to allow a protocol to burst a bounded number of sdu's back to back.
  • Implements a weighted queuing scheme

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

@crocodile-dentist crocodile-dentist self-assigned this Feb 24, 2026
@crocodile-dentist crocodile-dentist requested a review from a team as a code owner February 24, 2026 12:13
@github-project-automation github-project-automation Bot moved this to In Progress in Ouroboros Network Feb 24, 2026
@coot coot added the leios Issues / PRs related to Leios label Feb 24, 2026
@crocodile-dentist crocodile-dentist force-pushed the mw/mux-single-peer-performance branch from 42d7b13 to 6174c55 Compare March 12, 2026 09:35
@crocodile-dentist crocodile-dentist force-pushed the mw/mux-single-peer-performance branch 5 times, most recently from 5d5b414 to 8910846 Compare March 30, 2026 11:44
@crocodile-dentist crocodile-dentist changed the title network-mux token bucket burst performance improvement network-mux weighted fair queueing and token bucket for burst support Mar 30, 2026
@crocodile-dentist crocodile-dentist force-pushed the mw/mux-single-peer-performance branch from 8910846 to c5cdc95 Compare March 30, 2026 11:50
@crocodile-dentist crocodile-dentist force-pushed the mw/mux-single-peer-performance branch 2 times, most recently from 70c7a0b to b264c3a Compare March 31, 2026 08:29
The test has been enhanced to cover biased queuing
@crocodile-dentist crocodile-dentist force-pushed the mw/mux-single-peer-performance branch from b264c3a to f20cd81 Compare March 31, 2026 08:37
@coot coot mentioned this pull request Apr 8, 2026
7 tasks
coot added 6 commits April 8, 2026 12:42
* added type signatures
* change argument order of `processSingleWanton`
* added `SDUWithWantonState`
* added bangs to all `go` definitions
Added dedicated API:
* `NextSDUSize`, `nextSDUSizeToSDUSize`
* `TokenSize` (type alias), `consumedTokens`
An explicit loop is easier to follow.  We also avoid calling `error
"impossible"`.
Replaced a custom `allM` with `foldMap All . traverse`.  In the future
we can fuse `foldMap` with `traverse`.
Move constants to top level bindings:
* `maxSDUsPerBatch`
* `burstMinSdu`
Replaced `Bool` with:
* `CanBatch` - can we batch more SDUs from different mini-protocols.
* `CanBurst` - can we burst more SDUs from a single mini-protocol.
coot and others added 4 commits April 8, 2026 12:43
Use an explicit loop in `muxer`, as a result `transformers` dependency
is gone.
Refactor `muxerLoop`

It's easier to read `[(EgressQueue m, [(Word8, Egress m)])]`, than the
other way around, since then it's the `EgressQueue` we read and its tail
much like `x : xs`.  This also avoids using `traverse` over tuple which
is a bit surprising.
Use DuplicateRecordFields for:
* `Wanton`
* `TranslocationServiceRequest`
* `ProtocolBurst`

These are all internal data types, so we won't force it on `network-mux`
user.
@coot coot added the mux issues related to network-mux label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

leios Issues / PRs related to Leios mux issues related to network-mux

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants