Skip to content

Commit 22a7b74

Browse files
committed
Merge branch 'master' of github.com:libp2p/rust-libp2p into gossipsub-partial-messages
2 parents 19e359d + 0e52451 commit 22a7b74

File tree

12 files changed

+56
-78
lines changed

12 files changed

+56
-78
lines changed

.github/workflows/cache-factory.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: dtolnay/rust-toolchain@stable
2424

25-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
25+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
2626
with:
2727
shared-key: stable-cache
2828

.github/workflows/ci.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ env:
1818
jobs:
1919
test:
2020
name: Test ${{ matrix.crate }}
21-
runs-on: ${{ fromJSON(
22-
github.repository == 'libp2p/rust-libp2p' && (
23-
(contains(fromJSON('["libp2p-webrtc", "libp2p"]'), matrix.crate) && '["self-hosted", "linux", "x64", "2xlarge"]') ||
24-
(contains(fromJSON('["libp2p-quic", "libp2p-perf"]'), matrix.crate) && '["self-hosted", "linux", "x64", "xlarge"]') ||
25-
'["self-hosted", "linux", "x64", "large"]'
26-
) || '"ubuntu-latest"') }}
21+
runs-on: ubuntu-latest
2722
timeout-minutes: 10
2823
needs: gather_published_crates
2924
strategy:
@@ -41,7 +36,7 @@ jobs:
4136

4237
- uses: dtolnay/rust-toolchain@stable
4338

44-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
39+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
4540
with:
4641
shared-key: stable-cache
4742
save-if: false
@@ -150,7 +145,7 @@ jobs:
150145

151146
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
152147

153-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
148+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
154149
with:
155150
key: ${{ matrix.target }}
156151
save-if: ${{ github.ref == 'refs/heads/master' }}
@@ -175,7 +170,7 @@ jobs:
175170

176171
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
177172

178-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
173+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
179174
with:
180175
save-if: ${{ github.ref == 'refs/heads/master' }}
181176

@@ -195,7 +190,7 @@ jobs:
195190

196191
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
197192

198-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
193+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
199194
with:
200195
key: ${{ matrix.features }}
201196
save-if: ${{ github.ref == 'refs/heads/master' }}
@@ -212,7 +207,7 @@ jobs:
212207

213208
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
214209

215-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
210+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
216211
with:
217212
save-if: ${{ github.ref == 'refs/heads/master' }}
218213

@@ -238,7 +233,7 @@ jobs:
238233

239234
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
240235

241-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
236+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
242237
with:
243238
save-if: ${{ github.ref == 'refs/heads/master' }}
244239

@@ -254,7 +249,7 @@ jobs:
254249

255250
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
256251

257-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
252+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
258253
with:
259254
save-if: ${{ github.ref == 'refs/heads/master' }}
260255

@@ -273,7 +268,7 @@ jobs:
273268

274269
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
275270

276-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
271+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
277272
with:
278273
shared-key: stable-cache
279274
save-if: false
@@ -364,7 +359,7 @@ jobs:
364359
steps:
365360
- uses: actions/checkout@v5
366361

367-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
362+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
368363

369364
- run: cargo install --version 0.10.0 pb-rs --locked
370365

@@ -390,7 +385,7 @@ jobs:
390385
runs-on: ubuntu-latest
391386
steps:
392387
- uses: actions/checkout@v5
393-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
388+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
394389
- run: cargo metadata --locked --format-version=1 > /dev/null
395390

396391
cargo-deny:

.github/workflows/interop-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
run-transport-interop:
1414
name: Run transport interoperability tests
1515
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
16-
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
16+
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
1919
flavour: [chromium, native]

Cargo.lock

Lines changed: 15 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rust-version = "1.83.0"
7474
edition = "2021"
7575

7676
[workspace.dependencies]
77-
libp2p = { version = "0.56.0", path = "libp2p" }
77+
libp2p = { version = "0.56.1", path = "libp2p" }
7878
libp2p-allow-block-list = { version = "0.6.0", path = "misc/allow-block-list" }
7979
libp2p-autonat = { version = "0.15.0", path = "protocols/autonat" }
8080
libp2p-connection-limits = { version = "0.6.0", path = "misc/connection-limits" }

libp2p/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.56.1
2+
3+
- Fix `metrics` delegation to gossipsub protocol.
4+
See [PR 6180](https://github.com/libp2p/rust-libp2p/pull/6180)
5+
16
## 0.56.0
27

38
- Remove `async-std` support.

libp2p/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p"
33
edition.workspace = true
44
rust-version = { workspace = true }
55
description = "Peer-to-peer networking library"
6-
version = "0.56.0"
6+
version = "0.56.1"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"
@@ -65,7 +65,7 @@ kad = ["dep:libp2p-kad", "libp2p-metrics?/kad"]
6565
macros = ["libp2p-swarm/macros"]
6666
mdns = ["dep:libp2p-mdns"]
6767
memory-connection-limits = ["dep:libp2p-memory-connection-limits"]
68-
metrics = ["dep:libp2p-metrics"]
68+
metrics = ["dep:libp2p-metrics", "libp2p-gossipsub?/metrics"]
6969
noise = ["dep:libp2p-noise"]
7070
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
7171
plaintext = ["dep:libp2p-plaintext"]

protocols/gossipsub/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717

1818
- Fix incorrect default values in ConfigBuilder
1919
See [PR 6113](https://github.com/libp2p/rust-libp2p/pull/6113)
20+
21+
- Remove duplicated config `set_topic_max_transmit_size` method, prefer `max_transmit_size_for_topic`.
22+
See [PR 6173](https://github.com/libp2p/rust-libp2p/pull/6173).
23+
24+
- Switch the internal `async-channel` used to dispatch messages from `NetworkBehaviour` to the `ConnectionHandler`
25+
with an internal priority queue. See [PR 6175](https://github.com/libp2p/rust-libp2p/pull/6175)
2026

2127
- Switch the internal `async-channel` used to dispatch messages from `NetworkBehaviour` to the `ConnectionHandler`
2228
with an internal priority queue. See [PR XXXX](https://github.com/libp2p/rust-libp2p/pull/XXXX)

protocols/gossipsub/src/behaviour/tests.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,7 +4272,7 @@ fn test_scoring_p6() {
42724272

42734273
// create 5 peers with the same ip
42744274
let addr = Multiaddr::from(Ipv4Addr::new(10, 1, 2, 3));
4275-
let peers = vec![
4275+
let peers = [
42764276
add_peer_with_addr(&mut gs, &[], false, false, addr.clone()).0,
42774277
add_peer_with_addr(&mut gs, &[], false, false, addr.clone()).0,
42784278
add_peer_with_addr(&mut gs, &[], true, false, addr.clone()).0,
@@ -4282,7 +4282,7 @@ fn test_scoring_p6() {
42824282

42834283
// create 4 other peers with other ip
42844284
let addr2 = Multiaddr::from(Ipv4Addr::new(10, 1, 2, 4));
4285-
let others = vec![
4285+
let others = [
42864286
add_peer_with_addr(&mut gs, &[], false, false, addr2.clone()).0,
42874287
add_peer_with_addr(&mut gs, &[], false, false, addr2.clone()).0,
42884288
add_peer_with_addr(&mut gs, &[], true, false, addr2.clone()).0,
@@ -6495,7 +6495,7 @@ fn test_publish_message_with_default_transmit_size_config() {
64956495
let topic_hash = topic.hash();
64966496

64976497
let config = ConfigBuilder::default()
6498-
.set_topic_max_transmit_size(topic_hash.clone(), Config::default_max_transmit_size())
6498+
.max_transmit_size_for_topic(Config::default_max_transmit_size(), topic_hash.clone())
64996499
.validation_mode(ValidationMode::Strict)
65006500
.build()
65016501
.unwrap();
@@ -6527,7 +6527,7 @@ fn test_publish_large_message_with_default_transmit_size_config() {
65276527
let topic_hash = topic.hash();
65286528

65296529
let config = ConfigBuilder::default()
6530-
.set_topic_max_transmit_size(topic_hash.clone(), Config::default_max_transmit_size())
6530+
.max_transmit_size_for_topic(Config::default_max_transmit_size(), topic_hash.clone())
65316531
.validation_mode(ValidationMode::Strict)
65326532
.build()
65336533
.unwrap();
@@ -6555,7 +6555,7 @@ fn test_publish_message_with_specific_transmit_size_config() {
65556555

65566556
let max_topic_transmit_size = 2000;
65576557
let config = ConfigBuilder::default()
6558-
.set_topic_max_transmit_size(topic_hash.clone(), max_topic_transmit_size)
6558+
.max_transmit_size_for_topic(max_topic_transmit_size, topic_hash.clone())
65596559
.validation_mode(ValidationMode::Strict)
65606560
.build()
65616561
.unwrap();
@@ -6588,7 +6588,7 @@ fn test_publish_large_message_with_specific_transmit_size_config() {
65886588

65896589
let max_topic_transmit_size = 2048;
65906590
let config = ConfigBuilder::default()
6591-
.set_topic_max_transmit_size(topic_hash.clone(), max_topic_transmit_size)
6591+
.max_transmit_size_for_topic(max_topic_transmit_size, topic_hash.clone())
65926592
.validation_mode(ValidationMode::Strict)
65936593
.build()
65946594
.unwrap();
@@ -6616,7 +6616,7 @@ fn test_validation_error_message_size_too_large_topic_specific() {
66166616
let max_size = 2048;
66176617

66186618
let config = ConfigBuilder::default()
6619-
.set_topic_max_transmit_size(topic_hash.clone(), max_size)
6619+
.max_transmit_size_for_topic(max_size, topic_hash.clone())
66206620
.validation_mode(ValidationMode::None)
66216621
.build()
66226622
.unwrap();
@@ -6725,7 +6725,7 @@ fn test_validation_message_size_within_topic_specific() {
67256725
let max_size = 2048;
67266726

67276727
let config = ConfigBuilder::default()
6728-
.set_topic_max_transmit_size(topic_hash.clone(), max_size)
6728+
.max_transmit_size_for_topic(max_size, topic_hash.clone())
67296729
.validation_mode(ValidationMode::None)
67306730
.build()
67316731
.unwrap();

protocols/gossipsub/src/config.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,15 +1075,6 @@ impl ConfigBuilder {
10751075
self
10761076
}
10771077

1078-
/// The topic max size sets message sizes for a given topic.
1079-
pub fn set_topic_max_transmit_size(&mut self, topic: TopicHash, max_size: usize) -> &mut Self {
1080-
self.config
1081-
.protocol
1082-
.max_transmit_sizes
1083-
.insert(topic, max_size);
1084-
self
1085-
}
1086-
10871078
/// Constructs a [`Config`] from the given configuration and validates the settings.
10881079
pub fn build(&self) -> Result<Config, ConfigBuilderError> {
10891080
// check all constraints on config

0 commit comments

Comments
 (0)