diff --git a/.github/mergify.yml b/.github/mergify.yml index 38f025c7814..316be305382 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,57 +1,17 @@ -defaults: - actions: - queue: - method: squash - commit_message_template: | - {{ title }} - - {{ body | get_section("## Description", "") }} - - Pull-Request: #{{ number }}. - - {{ body | get_section("## Attributions", "") }} - pull_request_rules: - name: Ask to resolve conflict conditions: - conflict - -author=dependabot[bot] - or: - - -draft # Don't report conflicts on regular draft. - - and: # Do report conflicts on draft that are scheduled for the next major release. - - draft - - milestone~=v[0-9]\.[0-9]{2} + - -draft # Don't report conflicts on regular draft. + - and: # Do report conflicts on draft that are scheduled for the next major release. + - draft + - milestone~=v[0-9]\.[0-9]{2} actions: comment: - message: This pull request has merge conflicts. Could you please resolve them @{{author}}? 🙏 - - - name: Add to merge queue - conditions: - # All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection - - label=send-it - - base=master - actions: - queue: - name: default - - # Adds the Pr to the batch queue, so that we can run the interop tests. See the `external_prs` queue for more info. - - name: Add to batch merge queue - conditions: - # All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection - - label=send-it-batch - - base=master - actions: - queue: - name: external_prs - - - name: Add approved dependabot PRs to merge queue - conditions: - # All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection - - author=dependabot[bot] - - base=master - actions: - queue: - name: default + message: This pull request has merge conflicts. Could you please resolve them + @{{author}}? 🙏 - name: Remove reviews on updates after PR is queued for merging conditions: @@ -61,7 +21,8 @@ pull_request_rules: - author!=dependabot[bot] actions: dismiss_reviews: - message: Approvals have been dismissed because the PR was updated after the `send-it` label was applied. + message: Approvals have been dismissed because the PR was updated after the + `send-it` label was applied. changes_requested: false - name: Approve trivial maintainer PRs @@ -83,11 +44,34 @@ pull_request_rules: review: type: APPROVE + - name: Add approved dependabot PRs to merge queue + conditions: + # All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection + - author=dependabot[bot] + - base=master + actions: + queue: + + - name: Add send-it labeled PRs to merge queue + conditions: + # All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection + - base=master + - label=send-it + actions: + queue: + queue_rules: - - name: default - conditions: [] - # External PR's don't have access to secrets and variables, therefore they don't run the interop tests. - # using a batch queue allows to circumvent that as mergify creates it from an internal branch. - - name: external_prs - conditions: [] - batch_size: 1 + - name: default merge queue + queue_conditions: + - label=send-it + - base=master + merge_conditions: [] + merge_method: squash + commit_message_template: | + {{ title }} + + {{ body | get_section("## Description", "") }} + + Pull-Request: #{{ number }}. + + {{ body | get_section("## Attributions", "") }} diff --git a/Cargo.lock b/Cargo.lock index 60724c1b855..bb8aa3c7f74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3359,7 +3359,7 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.42.0" +version = "0.42.1" dependencies = [ "async-io", "async-std", diff --git a/Cargo.toml b/Cargo.toml index e5d4b2353e1..253f2973b5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ libp2p-stream = { version = "0.2.0-alpha.1", path = "protocols/stream" } libp2p-swarm = { version = "0.45.2", path = "swarm" } libp2p-swarm-derive = { version = "=0.35.0", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required. libp2p-swarm-test = { version = "0.5.0", path = "swarm-test" } -libp2p-tcp = { version = "0.42.0", path = "transports/tcp" } +libp2p-tcp = { version = "0.42.1", path = "transports/tcp" } libp2p-tls = { version = "0.5.0", path = "transports/tls" } libp2p-uds = { version = "0.41.0", path = "transports/uds" } libp2p-upnp = { version = "0.3.1", path = "protocols/upnp" } @@ -124,6 +124,7 @@ futures = "0.3.30" futures-bounded = { version = "0.2.4" } futures-rustls = { version = "0.26.0", default-features = false } getrandom = "0.2" +if-watch = "3.2.1" hickory-proto = { version = "0.25.0-alpha.4", default-features = false } hickory-resolver = { version = "0.25.0-alpha.4", default-features = false } multiaddr = "0.18.1" diff --git a/interop-tests/Dockerfile.chromium b/interop-tests/Dockerfile.chromium index 4ccb142b4a3..73a9ab82ee7 100644 --- a/interop-tests/Dockerfile.chromium +++ b/interop-tests/Dockerfile.chromium @@ -14,7 +14,7 @@ FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json # Build dependencies - this is the caching Docker layer! RUN cargo chef cook --release --package interop-tests --target wasm32-unknown-unknown --recipe-path recipe.json -RUN RUSTFLAGS='-C target-feature=+crt-static' cargo chef cook --release --package interop-tests --target x86_64-unknown-linux-gnu --bin wasm_ping --recipe-path recipe.json +RUN cargo chef cook --release --package interop-tests --bin wasm_ping --recipe-path recipe.json # Build application COPY . . RUN wasm-pack build --target web interop-tests diff --git a/interop-tests/Dockerfile.native b/interop-tests/Dockerfile.native index f0b078d9492..fab50dc50ad 100644 --- a/interop-tests/Dockerfile.native +++ b/interop-tests/Dockerfile.native @@ -9,7 +9,7 @@ RUN cargo chef prepare --recipe-path recipe.json FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json # Build dependencies - this is the caching Docker layer! -RUN RUSTFLAGS='-C target-feature=+crt-static' cargo chef cook --release --package interop-tests --target $(rustc -vV | grep host | awk '{print $2}') --bin native_ping --recipe-path recipe.json +RUN cargo chef cook --release --package interop-tests --bin native_ping --recipe-path recipe.json # Build application COPY . . RUN RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --package interop-tests --target $(rustc -vV | grep host | awk '{print $2}') --bin native_ping diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index ba86a82d5bb..e8fee81e98d 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] async-std = { version = "1.12.0", optional = true } async-io = { version = "2.3.3", optional = true } futures = { workspace = true } -if-watch = "3.2.0" +if-watch = { workspace = true } libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 1c35b293049..c0d4f17a916 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT" async-std = { version = "1.12.0", optional = true } futures = { workspace = true } futures-timer = "3.0.3" -if-watch = "3.2.0" +if-watch = { workspace = true } libp2p-core = { workspace = true } libp2p-tls = { workspace = true } libp2p-identity = { workspace = true } diff --git a/transports/tcp/CHANGELOG.md b/transports/tcp/CHANGELOG.md index 107d0d13ece..6d9c51b45be 100644 --- a/transports/tcp/CHANGELOG.md +++ b/transports/tcp/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.42.1 + +- Fix the disabling of Nagle's algorithm, which requires setting `TCP_NODELAY` to _true_. + See [PR 5764](https://github.com/libp2p/rust-libp2p/pull/5764) + ## 0.42.0 - Implement refactored `Transport`. diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 61c31e49639..73c25d85d48 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-tcp" edition = "2021" rust-version = { workspace = true } description = "TCP/IP transport protocol for libp2p" -version = "0.42.0" +version = "0.42.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] async-io = { version = "2.3.3", optional = true } futures = { workspace = true } futures-timer = "3.0" -if-watch = "3.2.0" +if-watch = { workspace = true } libc = "0.2.155" libp2p-core = { workspace = true } socket2 = { version = "0.5.7", features = ["all"] } diff --git a/transports/tcp/src/lib.rs b/transports/tcp/src/lib.rs index 5d3e46bcb09..07250f75655 100644 --- a/transports/tcp/src/lib.rs +++ b/transports/tcp/src/lib.rs @@ -59,8 +59,8 @@ use socket2::{Domain, Socket, Type}; pub struct Config { /// TTL to set for opened sockets, or `None` to keep default. ttl: Option, - /// `TCP_NODELAY` to set for opened sockets, or `None` to keep default. - nodelay: Option, + /// `TCP_NODELAY` to set for opened sockets. + nodelay: bool, /// Size of the listen backlog for listen sockets. backlog: u32, } @@ -130,7 +130,7 @@ impl PortReuse { impl Config { /// Creates a new configuration for a TCP/IP transport: /// - /// * Nagle's algorithm, i.e. `TCP_NODELAY`, is _enabled_. See [`Config::nodelay`]. + /// * Nagle's algorithm is _disabled_, i.e. `TCP_NODELAY` _enabled_. See [`Config::nodelay`]. /// * Reuse of listening ports is _disabled_. See [`Config::port_reuse`]. /// * No custom `IP_TTL` is set. The default of the OS TCP stack applies. See [`Config::ttl`]. /// * The size of the listen backlog for new listening sockets is `1024`. See @@ -138,7 +138,7 @@ impl Config { pub fn new() -> Self { Self { ttl: None, - nodelay: Some(false), // Disable Nagle's algorithm by default + nodelay: true, // Disable Nagle's algorithm by default. backlog: 1024, } } @@ -151,7 +151,7 @@ impl Config { /// Configures the `TCP_NODELAY` option for new sockets. pub fn nodelay(mut self, value: bool) -> Self { - self.nodelay = Some(value); + self.nodelay = value; self } @@ -198,9 +198,7 @@ impl Config { if let Some(ttl) = self.ttl { socket.set_ttl(ttl)?; } - if let Some(nodelay) = self.nodelay { - socket.set_nodelay(nodelay)?; - } + socket.set_nodelay(self.nodelay)?; socket.set_reuse_address(true)?; #[cfg(all(unix, not(any(target_os = "solaris", target_os = "illumos"))))] if port_use == PortUse::Reuse { diff --git a/transports/webrtc/Cargo.toml b/transports/webrtc/Cargo.toml index d43be5720d4..41dec91ba43 100644 --- a/transports/webrtc/Cargo.toml +++ b/transports/webrtc/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1" futures = { workspace = true } futures-timer = "3" hex = "0.4" -if-watch = "3.2" +if-watch = { workspace = true } libp2p-core = { workspace = true } libp2p-noise = { workspace = true } libp2p-identity = { workspace = true }