Skip to content

Commit

Permalink
Update unsigned-varint and asynchronous-codec (#1946)
Browse files Browse the repository at this point in the history
* Update unsigned-varint requirement from 0.6 to 0.7

Updates the requirements on [unsigned-varint](https://github.com/paritytech/unsigned-varint) to permit the latest version.
- [Release notes](https://github.com/paritytech/unsigned-varint/releases)
- [Changelog](https://github.com/paritytech/unsigned-varint/blob/master/CHANGELOG.md)
- [Commits](paritytech/unsigned-varint@v0.6.0...v0.7.0)

Signed-off-by: dependabot[bot] <[email protected]>

* *: Update to asynchronous-codec v0.6

* transports/plaintext: Use Framed::into_parts

* *: Update cargo tomls and changelogs

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <[email protected]>
  • Loading branch information
dependabot[bot] and mxinden authored Feb 13, 2021
1 parent 5ddc8d4 commit 639e5c6
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 27 deletions.
4 changes: 4 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.27.1 [unreleased]

- Update dependencies.

# 0.27.0 [2021-01-12]

- (Re)add `Transport::address_translation` to permit transport-specific
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p-core"
edition = "2018"
description = "Core traits and structs of libp2p"
version = "0.27.0"
version = "0.27.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down Expand Up @@ -31,7 +31,7 @@ rw-stream-sink = "0.2.0"
sha2 = "0.9.1"
smallvec = "1.0"
thiserror = "1.0"
unsigned-varint = "0.6"
unsigned-varint = "0.7"
void = "1"
zeroize = "1"

Expand Down
4 changes: 4 additions & 0 deletions misc/multiaddr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.11.1 [unreleased]

- Update dependencies

# 0.11.0 [2021-01-12]

- Update dependencies
Expand Down
4 changes: 2 additions & 2 deletions misc/multiaddr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Implementation of the multiaddr format"
homepage = "https://github.com/libp2p/rust-libp2p"
keywords = ["multiaddr", "ipfs"]
license = "MIT"
version = "0.11.0"
version = "0.11.1"

[features]
default = ["url"]
Expand All @@ -20,7 +20,7 @@ multihash = { version = "0.13", default-features = false, features = ["std", "mu
percent-encoding = "2.1.0"
serde = "1.0.70"
static_assertions = "1.1"
unsigned-varint = "0.6"
unsigned-varint = "0.7"
url = { version = "2.1.0", optional = true, default-features = false }

[dev-dependencies]
Expand Down
4 changes: 4 additions & 0 deletions misc/multistream-select/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.10.1 [unreleased]

- Update dependencies.

# 0.10.0 [2021-01-12]

- Update dependencies.
Expand Down
4 changes: 2 additions & 2 deletions misc/multistream-select/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "multistream-select"
description = "Multistream-select negotiation protocol for libp2p"
version = "0.10.0"
version = "0.10.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -15,7 +15,7 @@ futures = "0.3"
log = "0.4"
pin-project = "1.0.0"
smallvec = "1.0"
unsigned-varint = "0.6"
unsigned-varint = "0.7"

[dev-dependencies]
async-std = "1.6.2"
Expand Down
4 changes: 4 additions & 0 deletions muxers/mplex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.27.1 [unreleased]

- Update dependencies.

# 0.27.0 [2021-01-12]

- Update dependencies.
Expand Down
6 changes: 3 additions & 3 deletions muxers/mplex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p-mplex"
edition = "2018"
description = "Mplex multiplexing protocol for libp2p"
version = "0.27.0"
version = "0.27.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -12,14 +12,14 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
bytes = "1"
futures = "0.3.1"
asynchronous-codec = "0.5.0"
asynchronous-codec = "0.6"
libp2p-core = { version = "0.27.0", path = "../../core" }
log = "0.4"
nohash-hasher = "0.2"
parking_lot = "0.11"
rand = "0.7"
smallvec = "1.4"
unsigned-varint = { version = "0.6", features = ["asynchronous_codec"] }
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }

[dev-dependencies]
async-std = "1.7.0"
Expand Down
2 changes: 2 additions & 0 deletions protocols/gossipsub/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- Prevent non-published messages being added to caches.
[PR 1930](https://github.com/libp2p/rust-libp2p/pull/1930)

- Update dependencies.

# 0.27.0 [2021-01-12]

- Update dependencies.
Expand Down
4 changes: 2 additions & 2 deletions protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ byteorder = "1.3.4"
fnv = "1.0.7"
futures = "0.3.5"
rand = "0.7.3"
asynchronous-codec = "0.5"
asynchronous-codec = "0.6"
wasm-timer = "0.2.4"
unsigned-varint = { version = "0.6.0", features = ["asynchronous_codec"] }
unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] }
log = "0.4.11"
sha2 = "0.9.1"
base64 = "0.13.0"
Expand Down
4 changes: 4 additions & 0 deletions protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.28.1 [unreleased]

- Update dependencies.

# 0.28.0 [2021-01-12]

- Update dependencies.
Expand Down
6 changes: 3 additions & 3 deletions protocols/kad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p-kad"
edition = "2018"
description = "Kademlia protocol for libp2p"
version = "0.28.0"
version = "0.28.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -14,7 +14,7 @@ arrayvec = "0.5.1"
bytes = "1"
either = "1.5"
fnv = "1.0"
asynchronous-codec = "0.5"
asynchronous-codec = "0.6"
futures = "0.3.1"
log = "0.4"
libp2p-core = { version = "0.27.0", path = "../../core" }
Expand All @@ -25,7 +25,7 @@ sha2 = "0.9.1"
smallvec = "1.0"
wasm-timer = "0.2"
uint = "0.9"
unsigned-varint = { version = "0.6", features = ["asynchronous_codec"] }
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
void = "1.0"

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion protocols/request-response/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- Make `is_pending_outbound` return true on pending connection.
[PR 1928](https://github.com/libp2p/rust-libp2p/pull/1928).

- Update dependencies.

# 0.9.0 [2021-01-12]

- Update dependencies.
Expand Down Expand Up @@ -66,4 +68,3 @@ https://github.com/libp2p/rust-libp2p/pull/1606).
# 0.1.0

- Initial release.

2 changes: 1 addition & 1 deletion protocols/request-response/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lru = "0.6"
minicbor = { version = "0.7", features = ["std", "derive"] }
rand = "0.7"
smallvec = "1.4"
unsigned-varint = { version = "0.6", features = ["std", "futures"] }
unsigned-varint = { version = "0.7", features = ["std", "futures"] }
wasm-timer = "0.2"

[dev-dependencies]
Expand Down
4 changes: 4 additions & 0 deletions transports/plaintext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.27.1 [unreleased]

- Update dependencies.

# 0.27.0 [2021-01-12]

- Update dependencies.
Expand Down
6 changes: 3 additions & 3 deletions transports/plaintext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p-plaintext"
edition = "2018"
description = "Plaintext encryption dummy protocol for libp2p"
version = "0.27.0"
version = "0.27.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -12,11 +12,11 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
bytes = "1"
futures = "0.3.1"
asynchronous-codec = "0.5.0"
asynchronous-codec = "0.6"
libp2p-core = { version = "0.27.0", path = "../../core" }
log = "0.4.8"
prost = "0.7"
unsigned-varint = { version = "0.6", features = ["asynchronous_codec"] }
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
void = "1.0.2"

[dev-dependencies]
Expand Down
13 changes: 5 additions & 8 deletions transports/plaintext/src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::structs_proto::Exchange;

use bytes::{Bytes, BytesMut};
use futures::prelude::*;
use asynchronous_codec::Framed;
use asynchronous_codec::{Framed, FramedParts};
use libp2p_core::{PublicKey, PeerId};
use log::{debug, trace};
use prost::Message;
Expand Down Expand Up @@ -134,12 +134,9 @@ where
}
};

// The `Framed` wrapper may have buffered additional data that
// was already received but is no longer part of the plaintext
// handshake. We need to capture that data before dropping
// the `Framed` wrapper via `Framed::into_inner()`.
let read_buffer = framed_socket.read_buffer().clone().freeze();

trace!("received exchange from remote; pubkey = {:?}", context.state.public_key);
Ok((framed_socket.into_inner(), context.state, read_buffer))

let FramedParts { io, read_buffer, write_buffer, .. } = framed_socket.into_parts();
assert!(write_buffer.is_empty());
Ok((io, context.state, read_buffer.freeze()))
}

0 comments on commit 639e5c6

Please sign in to comment.