Skip to content

Commit

Permalink
feat(gossipsub): introduce backpressure
Browse files Browse the repository at this point in the history
superseeds #4914 with some changes and improvements, namely:

- introduce a `Delay` for `Forward` and `Publish` messages, messages that take more than the configured delay to be sent are discarded
- introduce scoring and penalize slow peers
- remove control pool
- report slow peers with the number of failed messages

Pull-Request: #5595.
  • Loading branch information
jxs authored Nov 25, 2024
1 parent 00588a5 commit 2371922
Show file tree
Hide file tree
Showing 15 changed files with 2,201 additions and 1,058 deletions.
76 changes: 55 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions protocols/gossipsub/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
- Attempt to publish to at least mesh_n peers when flood publish is disabled.
See [PR 5578](https://github.com/libp2p/rust-libp2p/pull/5578).

- Introduce back pressure and penalize slow peers. Drop stale messages that timeout before being
delivered.
See [PR 5595](https://github.com/libp2p/rust-libp2p/pull/5595).
- Change `Behaviour::unsubscribe` and `Behaviour::report_message_validation_result`
to `bool` they don't need to be a `Result`.
See [PR 5595](https://github.com/libp2p/rust-libp2p/pull/5595).

## 0.47.0

<!-- Update to libp2p-swarm v0.45.0 -->
Expand Down
5 changes: 3 additions & 2 deletions protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ categories = ["network-programming", "asynchronous"]
wasm-bindgen = ["getrandom/js", "futures-timer/wasm-bindgen"]

[dependencies]
async-channel = "2.3.1"
asynchronous-codec = { workspace = true }
base64 = "0.22.1"
byteorder = "1.5.0"
bytes = "1.6"
either = "1.11"
fnv = "1.0.7"
futures = { workspace = true }
futures-timer = "3.0.2"
getrandom = "0.2.15"
hex_fmt = "0.3.0"
web-time = { workspace = true }
Expand All @@ -38,7 +40,6 @@ tracing = { workspace = true }

# Metrics dependencies
prometheus-client = { workspace = true }
futures-timer = "3.0.3"

[dev-dependencies]
hex = "0.4.2"
Expand All @@ -48,7 +49,7 @@ libp2p-noise = { workspace = true }
libp2p-swarm-test = { path = "../../swarm-test" }
quickcheck = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "time"] }
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "time", "macros"] }

# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
Expand Down
Loading

0 comments on commit 2371922

Please sign in to comment.