Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/cargo/webrtc-ae7b30d2f3
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs committed May 9, 2024
2 parents 0d68c3f + 0e11c61 commit f42f834
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit mesages, check out this blog post: https://cbea.ms/git-commit/
For a quick primer on good commit messages, check out this blog post: https://cbea.ms/git-commit/
Please include any relevant issues in here, for example:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
fetch-depth: 0

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: dtolnay/rust-toolchain@stable

Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
with:
target: ${{ matrix.target }}

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand All @@ -181,7 +181,7 @@ jobs:
with:
toolchain: ${{ env.MSRV }}

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand All @@ -202,7 +202,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand All @@ -219,7 +219,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand All @@ -234,7 +234,7 @@ jobs:
fail-fast: false
matrix:
rust-version: [
1.77.0, # current stable
1.78.0, # current stable
beta,
]
steps:
Expand All @@ -245,7 +245,7 @@ jobs:
toolchain: ${{ matrix.rust-version }}
components: clippy

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand All @@ -261,7 +261,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand All @@ -280,7 +280,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
Expand Down Expand Up @@ -330,7 +330,7 @@ jobs:
with:
components: rustfmt

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- name: Check formatting
run: cargo fmt -- --check
Expand All @@ -342,7 +342,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0

- name: Ensure `full` feature contains all features
run: |
Expand Down
46 changes: 22 additions & 24 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion hole-punching-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ libp2p = { path = "../libp2p", features = ["tokio", "dcutr", "identify", "macros
tracing = { workspace = true }
redis = { version = "0.23.0", default-features = false, features = ["tokio-comp"] }
tokio = { workspace = true, features = ["full"] }
serde = { version = "1.0.198", features = ["derive"] }
serde = { version = "1.0.199", features = ["derive"] }
serde_json = "1.0.116"
either = "1.11.0"
4 changes: 2 additions & 2 deletions identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ rand = ["dep:rand", "ed25519-dalek?/rand_core"]

[dev-dependencies]
quickcheck = { workspace = true }
base64 = "0.22.0"
base64 = "0.22.1"
serde_json = "1.0"
rmp-serde = "1.2"
rmp-serde = "1.3"
criterion = "0.5"
hex-literal = "0.4.1"

Expand Down
8 changes: 4 additions & 4 deletions libp2p/src/bandwidth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl<SMInner: AsyncRead> AsyncRead for InstrumentedStream<SMInner> {
let this = self.project();
let num_bytes = ready!(this.inner.poll_read(cx, buf))?;
this.sinks.inbound.fetch_add(
u64::try_from(num_bytes).unwrap_or(u64::max_value()),
u64::try_from(num_bytes).unwrap_or(u64::MAX),
Ordering::Relaxed,
);
Poll::Ready(Ok(num_bytes))
Expand All @@ -168,7 +168,7 @@ impl<SMInner: AsyncRead> AsyncRead for InstrumentedStream<SMInner> {
let this = self.project();
let num_bytes = ready!(this.inner.poll_read_vectored(cx, bufs))?;
this.sinks.inbound.fetch_add(
u64::try_from(num_bytes).unwrap_or(u64::max_value()),
u64::try_from(num_bytes).unwrap_or(u64::MAX),
Ordering::Relaxed,
);
Poll::Ready(Ok(num_bytes))
Expand All @@ -184,7 +184,7 @@ impl<SMInner: AsyncWrite> AsyncWrite for InstrumentedStream<SMInner> {
let this = self.project();
let num_bytes = ready!(this.inner.poll_write(cx, buf))?;
this.sinks.outbound.fetch_add(
u64::try_from(num_bytes).unwrap_or(u64::max_value()),
u64::try_from(num_bytes).unwrap_or(u64::MAX),
Ordering::Relaxed,
);
Poll::Ready(Ok(num_bytes))
Expand All @@ -198,7 +198,7 @@ impl<SMInner: AsyncWrite> AsyncWrite for InstrumentedStream<SMInner> {
let this = self.project();
let num_bytes = ready!(this.inner.poll_write_vectored(cx, bufs))?;
this.sinks.outbound.fetch_add(
u64::try_from(num_bytes).unwrap_or(u64::max_value()),
u64::try_from(num_bytes).unwrap_or(u64::MAX),
Ordering::Relaxed,
);
Poll::Ready(Ok(num_bytes))
Expand Down
4 changes: 2 additions & 2 deletions misc/keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ release = false
[dependencies]
clap = { version = "4.5.4", features = ["derive"] }
zeroize = "1"
serde = { version = "1.0.198", features = ["derive"] }
serde = { version = "1.0.199", features = ["derive"] }
serde_json = "1.0.116"
libp2p-core = { workspace = true }
base64 = "0.22.0"
base64 = "0.22.1"
libp2p-identity = { workspace = true }

[lints]
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions misc/metrics/src/bandwidth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl<SMInner: AsyncRead> AsyncRead for InstrumentedStream<SMInner> {
let num_bytes = ready!(this.inner.poll_read(cx, buf))?;
this.metrics
.inbound
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::max_value()));
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::MAX));
Poll::Ready(Ok(num_bytes))
}

Expand All @@ -268,7 +268,7 @@ impl<SMInner: AsyncRead> AsyncRead for InstrumentedStream<SMInner> {
let num_bytes = ready!(this.inner.poll_read_vectored(cx, bufs))?;
this.metrics
.inbound
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::max_value()));
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::MAX));
Poll::Ready(Ok(num_bytes))
}
}
Expand All @@ -283,7 +283,7 @@ impl<SMInner: AsyncWrite> AsyncWrite for InstrumentedStream<SMInner> {
let num_bytes = ready!(this.inner.poll_write(cx, buf))?;
this.metrics
.outbound
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::max_value()));
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::MAX));
Poll::Ready(Ok(num_bytes))
}

Expand All @@ -296,7 +296,7 @@ impl<SMInner: AsyncWrite> AsyncWrite for InstrumentedStream<SMInner> {
let num_bytes = ready!(this.inner.poll_write_vectored(cx, bufs))?;
this.metrics
.outbound
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::max_value()));
.inc_by(u64::try_from(num_bytes).unwrap_or(u64::MAX));
Poll::Ready(Ok(num_bytes))
}

Expand Down
1 change: 0 additions & 1 deletion misc/multistream-select/src/length_delimited.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use std::{
io,
pin::Pin,
task::{Context, Poll},
u16,
};

const MAX_LEN_BYTES: u16 = 2;
Expand Down
2 changes: 1 addition & 1 deletion misc/quickcheck-ext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub trait GenRange {
fn gen_range<T: Unsigned + Arbitrary + Copy>(&mut self, _range: Range<T>) -> T;

fn gen_index(&mut self, ubound: usize) -> usize {
if ubound <= (core::u32::MAX as usize) {
if ubound <= (u32::MAX as usize) {
self.gen_range(0..ubound as u32) as usize
} else {
self.gen_range(0..ubound)
Expand Down
Loading

0 comments on commit f42f834

Please sign in to comment.