Skip to content

Commit

Permalink
Merge branch 'master' into prepare-libp2p-webrtc-websys-non-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 authored Jan 12, 2025
2 parents 2398847 + 1442ca0 commit 3342adc
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 71 deletions.
92 changes: 38 additions & 54 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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", "") }}
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion interop-tests/Dockerfile.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion interop-tests/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion protocols/mdns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion transports/quic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
5 changes: 5 additions & 0 deletions transports/tcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions transports/tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -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"] }
Expand Down
14 changes: 6 additions & 8 deletions transports/tcp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>,
/// `TCP_NODELAY` to set for opened sockets, or `None` to keep default.
nodelay: Option<bool>,
/// `TCP_NODELAY` to set for opened sockets.
nodelay: bool,
/// Size of the listen backlog for listen sockets.
backlog: u32,
}
Expand Down Expand Up @@ -130,15 +130,15 @@ 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
/// [`Config::listen_backlog`].
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,
}
}
Expand All @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion transports/webrtc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 3342adc

Please sign in to comment.