Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kpp committed Jul 19, 2021
2 parents 0aa008f + 20183c1 commit 1c0faa8
Show file tree
Hide file tree
Showing 41 changed files with 61 additions and 51 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@

# `libp2p` facade crate

## Version 0.39.0 [unreleased]
## Version 0.39.1 [2021-07-12]

- Update individual crates.
- `libp2p-swarm-derive`

## Version 0.39.0 [2021-07-12]

- Update individual crates.
- `libp2p-core`
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p"
edition = "2018"
description = "Peer-to-peer networking library"
version = "0.39.0"
version = "0.39.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down Expand Up @@ -79,7 +79,7 @@ libp2p-pnet = { version = "0.21.0", path = "transports/pnet", optional = true }
libp2p-relay = { version = "0.3.0", path = "protocols/relay", optional = true }
libp2p-request-response = { version = "0.12.0", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.30.0", path = "swarm" }
libp2p-swarm-derive = { version = "0.23.0", path = "swarm-derive" }
libp2p-swarm-derive = { version = "0.24.0", path = "swarm-derive" }
libp2p-uds = { version = "0.29.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.29.0", path = "transports/wasm-ext", default-features = false, optional = true }
libp2p-yamux = { version = "0.33.0", path = "muxers/yamux", optional = true }
Expand All @@ -99,7 +99,7 @@ libp2p-websocket = { version = "0.30.0", path = "transports/websocket", optional

[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
env_logger = "0.8.1"
env_logger = "0.9.0"
tokio = { version = "1.0.1", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }

[workspace]
Expand Down
2 changes: 1 addition & 1 deletion core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Switch from `parity-multiaddr` to upstream `multiaddr`.

Expand Down
4 changes: 2 additions & 2 deletions core/src/peer_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ impl PeerId {

/// Parses a `PeerId` from bytes.
pub fn from_bytes(data: &[u8]) -> Result<PeerId, Error> {
Ok(PeerId::from_multihash(Multihash::from_bytes(&data)?)
.map_err(|mh| Error::UnsupportedCode(mh.code()))?)
PeerId::from_multihash(Multihash::from_bytes(&data)?)
.map_err(|mh| Error::UnsupportedCode(mh.code()))
}

/// Tries to turn a `Multihash` into a `PeerId`.
Expand Down
2 changes: 1 addition & 1 deletion misc/multistream-select/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ unsigned-varint = "0.7"

[dev-dependencies]
async-std = "1.6.2"
env_logger = "0.8"
env_logger = "0.9"
libp2p-core = { path = "../../core" }
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p-plaintext = { path = "../../transports/plaintext" }
Expand Down
2 changes: 1 addition & 1 deletion muxers/mplex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion muxers/mplex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
[dev-dependencies]
async-std = "1.7.0"
criterion = "0.3"
env_logger = "0.8"
env_logger = "0.9"
futures = "0.3"
libp2p-tcp = { path = "../../transports/tcp" }
libp2p-plaintext = { path = "../../transports/plaintext" }
Expand Down
14 changes: 7 additions & 7 deletions muxers/mplex/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,25 @@ impl Encoder for Codec {
fn encode(&mut self, item: Self::Item, dst: &mut BytesMut) -> Result<(), Self::Error> {
let (header, data) = match item {
Frame::Open { stream_id } => {
(u64::from(stream_id.num) << 3, Bytes::new())
(stream_id.num << 3, Bytes::new())
},
Frame::Data { stream_id: LocalStreamId { num, role: Endpoint::Listener }, data } => {
(u64::from(num) << 3 | 1, data)
(num << 3 | 1, data)
},
Frame::Data { stream_id: LocalStreamId { num, role: Endpoint::Dialer }, data } => {
(u64::from(num) << 3 | 2, data)
(num << 3 | 2, data)
},
Frame::Close { stream_id: LocalStreamId { num, role: Endpoint::Listener } } => {
(u64::from(num) << 3 | 3, Bytes::new())
(num << 3 | 3, Bytes::new())
},
Frame::Close { stream_id: LocalStreamId { num, role: Endpoint::Dialer } } => {
(u64::from(num) << 3 | 4, Bytes::new())
(num << 3 | 4, Bytes::new())
},
Frame::Reset { stream_id: LocalStreamId { num, role: Endpoint::Listener } } => {
(u64::from(num) << 3 | 5, Bytes::new())
(num << 3 | 5, Bytes::new())
},
Frame::Reset { stream_id: LocalStreamId { num, role: Endpoint::Dialer } } => {
(u64::from(num) << 3 | 6, Bytes::new())
(num << 3 | 6, Bytes::new())
},
};

Expand Down
2 changes: 1 addition & 1 deletion muxers/yamux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.33.0 [unreleased]
# 0.33.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/floodsub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.30.0 [unreleased]
# 0.30.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.32.0 [unreleased]
# 0.32.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ regex = "1.4.0"

[dev-dependencies]
async-std = "1.6.3"
env_logger = "0.8.1"
env_logger = "0.9.0"
libp2p-plaintext = { path = "../../transports/plaintext" }
libp2p-yamux = { path = "../../muxers/yamux" }
libp2p-mplex = { path = "../../muxers/mplex" }
Expand Down
2 changes: 1 addition & 1 deletion protocols/identify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.30.0 [unreleased]
# 0.30.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/identify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ wasm-timer = "0.2"

[dev-dependencies]
async-std = "1.6.2"
env_logger = "0.8"
env_logger = "0.9"
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p-noise = { path = "../../transports/noise" }
libp2p-tcp = { path = "../../transports/tcp" }
Expand Down
2 changes: 1 addition & 1 deletion protocols/identify/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl ProtocolsHandler for IdentifyHandler {
};
Poll::Ready(ev)
}
Poll::Ready(Err(err)) => Poll::Ready(ProtocolsHandlerEvent::Close(err.into()))
Poll::Ready(Err(err)) => Poll::Ready(ProtocolsHandlerEvent::Close(err))
}
}
}
2 changes: 1 addition & 1 deletion protocols/identify/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ where
Ok(v) => v,
Err(err) => {
debug!("Invalid message: {:?}", err);
return Err(err.into())
return Err(err)
}
};

Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.31.0 [unreleased]
# 0.31.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/kbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ where
///
/// The buckets are ordered by proximity to the `local_key`, i.e. the first
/// bucket is the closest bucket (containing at most one key).
pub fn iter<'a>(&'a mut self) -> impl Iterator<Item = KBucketRef<'a, TKey, TVal>> + 'a {
pub fn iter(&mut self) -> impl Iterator<Item = KBucketRef<'_, TKey, TVal>> + '_ {
let applied_pending = &mut self.applied_pending;
self.buckets.iter_mut().enumerate().map(move |(i, b)| {
if let Some(applied) = b.apply_pending() {
Expand Down
2 changes: 1 addition & 1 deletion protocols/mdns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.31.0 [unreleased]
# 0.31.0 [2021-07-12]

- Update dependencies.

Expand Down
3 changes: 1 addition & 2 deletions protocols/mdns/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,7 @@ fn append_txt_record(
if value.len() > MAX_TXT_VALUE_LENGTH {
return Err(MdnsResponseError::TxtRecordTooLong);
}
let mut buffer = Vec::new();
buffer.push(value.len() as u8);
let mut buffer = vec![value.len() as u8];
append_character_string(&mut buffer, value)?;

append_u16(out, buffer.len() as u16);
Expand Down
2 changes: 1 addition & 1 deletion protocols/ping/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.30.0 [unreleased]
# 0.30.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/relay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.3.0 [unreleased]
# 0.3.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion protocols/relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ wasm-timer = "0.2"
prost-build = "0.8"

[dev-dependencies]
env_logger = "0.8.3"
env_logger = "0.9.0"
structopt = "0.3.21"
libp2p = { path = "../.." }
libp2p-kad = { path = "../kad" }
Expand Down
2 changes: 1 addition & 1 deletion protocols/request-response/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.12.0 [unreleased]
# 0.12.0 [2021-07-12]

- Update dependencies.

Expand Down
6 changes: 6 additions & 0 deletions swarm-derive/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.24.0 [2021-07-12]

- Handle `NetworkBehaviourAction::CloseConnection`. See [PR 2110] for details.

[PR 2110]: https://github.com/libp2p/rust-libp2p/pull/2110/

# 0.23.0 [2021-04-14]

- Extend `NetworkBehaviour` callbacks, more concretely introducing new `fn
Expand Down
2 changes: 1 addition & 1 deletion swarm-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p-swarm-derive"
edition = "2018"
description = "Procedural macros of libp2p-core"
version = "0.23.0"
version = "0.24.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
4 changes: 2 additions & 2 deletions swarm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.30.0 [unreleased]
# 0.30.0 [2021-07-12]

- Update dependencies.

Expand All @@ -20,7 +20,7 @@
peer via an `ExpandedSwarm` or `NetworkBehaviour`. See [PR 2110] for details.

- Expose the `ListenerId` in `SwarmEvent`s that are associated with a listener.

See [PR 2123] for details.

[PR 2100]: https://github.com/libp2p/rust-libp2p/pull/2100
Expand Down
2 changes: 1 addition & 1 deletion transports/deflate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/dns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async-std-resolver = { version = "0.20", optional = true }
smallvec = "1.6.1"

[dev-dependencies]
env_logger = "0.8"
env_logger = "0.9"
tokio-crate = { package = "tokio", version = "1.0", default-features = false, features = ["rt", "time"] }
async-std-crate = { package = "async-std", version = "1.6" }

Expand Down
2 changes: 1 addition & 1 deletion transports/noise/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.32.0 [unreleased]
# 0.32.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/noise/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ snow = { version = "0.8.0", features = ["default-resolver"], default-features =

[dev-dependencies]
async-io = "1.2.0"
env_logger = "0.8.1"
env_logger = "0.9.0"
libp2p-tcp = { path = "../../transports/tcp" }
quickcheck = "0.9.0"
sodiumoxide = "0.2.5"
Expand Down
2 changes: 1 addition & 1 deletion transports/noise/src/protocol/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl snow::types::Dh for Keypair<X25519> {

fn set(&mut self, sk: &[u8]) {
let mut secret = [0u8; 32];
secret.copy_from_slice(&sk[..]);
secret.copy_from_slice(&sk);
self.secret = SecretKey(X25519(secret)); // Copy
self.public = PublicKey(X25519(x25519(secret, X25519_BASEPOINT_BYTES)));
secret.zeroize();
Expand Down
2 changes: 1 addition & 1 deletion transports/noise/src/protocol/x25519_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl snow::types::Dh for Keypair<X25519Spec> {

fn set(&mut self, sk: &[u8]) {
let mut secret = [0u8; 32];
secret.copy_from_slice(&sk[..]);
secret.copy_from_slice(&sk);
self.secret = SecretKey(X25519Spec(secret)); // Copy
self.public = PublicKey(X25519Spec(x25519(secret, X25519_BASEPOINT_BYTES)));
secret.zeroize();
Expand Down
2 changes: 1 addition & 1 deletion transports/plaintext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/plaintext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
void = "1.0.2"

[dev-dependencies]
env_logger = "0.8.1"
env_logger = "0.9.0"
quickcheck = "0.9.0"
rand = "0.7"

Expand Down
2 changes: 1 addition & 1 deletion transports/tcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ async-io = ["async-io-crate", "if-watch"]
[dev-dependencies]
async-std = { version = "1.6.5", features = ["attributes"] }
tokio-crate = { package = "tokio", version = "1.0.1", default-features = false, features = ["net", "rt"] }
env_logger = "0.8.2"
env_logger = "0.9.0"
2 changes: 1 addition & 1 deletion transports/uds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/wasm-ext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.29.0 [unreleased]
# 0.29.0 [2021-07-12]

- Update dependencies.

Expand Down
2 changes: 1 addition & 1 deletion transports/websocket/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.30.0 [unreleased]
# 0.30.0 [2021-07-12]

- Update dependencies.

Expand Down

0 comments on commit 1c0faa8

Please sign in to comment.