Add sn-fair v0: weighted max-min fairness scheduler with leech policy

Two-class allocation engine: contributors (configurable weight) get
weighted max-min shares of the pooled capacity, leeches (receive-only,
explicitly allowed) share the leftover capacity. Deterministic u128
arithmetic, validated newtypes, demo CLI in Mbit/s for the pilot
Soll/Ist comparison. 19 tests, workspace clippy clean.
This commit is contained in:
2026-09-24 18:46:38 +02:00
parent afaeb76f6f
commit ecf8848ca4
8 changed files with 1028 additions and 1 deletions
+29
View File
@@ -1009,6 +1009,25 @@ version = "1.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891"
[[package]]
name = "sn-exit"
version = "0.1.0"
dependencies = [
"clap",
"thiserror",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "sn-fair"
version = "0.1.0"
dependencies = [
"clap",
"thiserror",
]
[[package]]
name = "sn-fetch"
version = "0.1.0"
@@ -1024,6 +1043,16 @@ dependencies = [
"tracing-subscriber",
]
[[package]]
name = "sn-node"
version = "0.1.0"
dependencies = [
"clap",
"serde_json",
"thiserror",
"tokio",
]
[[package]]
name = "socket2"
version = "0.6.5"