diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb906c8967..ad4aa543a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# Version 0.13.0 (2019-11-05) + +- Reworked the transport upgrade API. See https://github.com/libp2p/rust-libp2p/pull/1240 for more information. +- Added a parameter allowing to choose the protocol negotiation protocol when upgrading a connection or a substream. See https://github.com/libp2p/rust-libp2p/pull/1245 for more information. +- Added an alternative `multistream-select` protocol called `V1Lazy`. +- Added `PlainText2Config` that implements the `/plaintext/2.0.0` protocol. +- Refactored `libp2p-identify`. Some items have been renamed. +- Now accepting `PeerId`s using the `identity` hashing algorithm as valid. +- Removed `libp2p-observed` and `libp2p-ratelimit`. +- Fixed mDNS long peer IDs not being transmitted properly. +- Added some `Debug` trait implementations. +- Fixed potential arithmetic overflows in `libp2p-kad` and `multistream-select`. + # Version 0.12.0 (2019-08-15) - In some situations, `multistream-select` will now assume that protocol negotiation immediately succeeds. If it turns out that it failed, an error is generated when reading or writing from/to the stream. diff --git a/Cargo.toml b/Cargo.toml index bdfd739bb2d..2eed7f101f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p" edition = "2018" description = "Peer-to-peer networking library" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -16,23 +16,23 @@ secp256k1 = ["libp2p-core/secp256k1", "libp2p-secio/secp256k1"] [dependencies] bytes = "0.4" futures = "0.1" -multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "misc/multiaddr" } -multihash = { package = "parity-multihash", version = "0.1.0", path = "misc/multihash" } +multiaddr = { package = "parity-multiaddr", version = "0.5.1", path = "misc/multiaddr" } +multihash = { package = "parity-multihash", version = "0.1.4", path = "misc/multihash" } lazy_static = "1.2" -libp2p-mplex = { version = "0.12.0", path = "muxers/mplex" } -libp2p-identify = { version = "0.12.0", path = "protocols/identify" } -libp2p-kad = { version = "0.12.0", path = "protocols/kad" } -libp2p-floodsub = { version = "0.12.0", path = "protocols/floodsub" } -libp2p-ping = { version = "0.12.0", path = "protocols/ping" } -libp2p-plaintext = { version = "0.12.0", path = "protocols/plaintext" } -libp2p-core = { version = "0.12.0", path = "core" } -libp2p-core-derive = { version = "0.12.0", path = "misc/core-derive" } -libp2p-secio = { version = "0.12.0", path = "protocols/secio", default-features = false } -libp2p-swarm = { version = "0.2.0", path = "swarm" } -libp2p-uds = { version = "0.12.0", path = "transports/uds" } -libp2p-wasm-ext = { version = "0.5.0", path = "transports/wasm-ext" } -libp2p-yamux = { version = "0.12.0", path = "muxers/yamux" } -parking_lot = "0.8" +libp2p-mplex = { version = "0.13.0", path = "muxers/mplex" } +libp2p-identify = { version = "0.13.0", path = "protocols/identify" } +libp2p-kad = { version = "0.13.0", path = "protocols/kad" } +libp2p-floodsub = { version = "0.13.0", path = "protocols/floodsub" } +libp2p-ping = { version = "0.13.0", path = "protocols/ping" } +libp2p-plaintext = { version = "0.13.0", path = "protocols/plaintext" } +libp2p-core = { version = "0.13.0", path = "core" } +libp2p-core-derive = { version = "0.13.0", path = "misc/core-derive" } +libp2p-secio = { version = "0.13.0", path = "protocols/secio", default-features = false } +libp2p-swarm = { version = "0.3.0", path = "swarm" } +libp2p-uds = { version = "0.13.0", path = "transports/uds" } +libp2p-wasm-ext = { version = "0.6.0", path = "transports/wasm-ext" } +libp2p-yamux = { version = "0.13.0", path = "muxers/yamux" } +parking_lot = "0.9.0" smallvec = "0.6" tokio-codec = "0.1" tokio-executor = "0.1" @@ -40,15 +40,15 @@ tokio-io = "0.1" wasm-timer = "0.1" [target.'cfg(not(any(target_os = "emscripten", target_os = "unknown")))'.dependencies] -libp2p-deflate = { version = "0.4.0", path = "protocols/deflate" } -libp2p-dns = { version = "0.12.0", path = "transports/dns" } -libp2p-mdns = { version = "0.12.0", path = "misc/mdns" } -libp2p-noise = { version = "0.10.0", path = "protocols/noise" } -libp2p-tcp = { version = "0.12.0", path = "transports/tcp" } -libp2p-websocket = { version = "0.12.0", path = "transports/websocket", optional = true } +libp2p-deflate = { version = "0.5.0", path = "protocols/deflate" } +libp2p-dns = { version = "0.13.0", path = "transports/dns" } +libp2p-mdns = { version = "0.13.0", path = "misc/mdns" } +libp2p-noise = { version = "0.11.0", path = "protocols/noise" } +libp2p-tcp = { version = "0.13.0", path = "transports/tcp" } +libp2p-websocket = { version = "0.13.0", path = "transports/websocket", optional = true } [dev-dependencies] -env_logger = "0.6.0" +env_logger = "0.7.1" tokio = "0.1" tokio-stdin-stdout = "0.1" diff --git a/core/Cargo.toml b/core/Cargo.toml index 77fecdc486c..d54066321c8 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-core" edition = "2018" description = "Core traits and structs of libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,22 +11,22 @@ categories = ["network-programming", "asynchronous"] [dependencies] asn1_der = "0.6.1" -bs58 = "0.2.0" +bs58 = "0.3.0" bytes = "0.4" -ed25519-dalek = "1.0.0-pre.1" +ed25519-dalek = "1.0.0-pre.2" failure = "0.1" fnv = "1.0" futures-timer = "0.3" lazy_static = "1.2" log = "0.4" multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../misc/multiaddr" } -multihash = { package = "parity-multihash", version = "0.1.0", path = "../misc/multihash" } -multistream-select = { version = "0.5.0", path = "../misc/multistream-select" } +multihash = { package = "parity-multihash", version = "0.1.4", path = "../misc/multihash" } +multistream-select = { version = "0.6.0", path = "../misc/multistream-select" } futures-preview = { version = "0.3.0-alpha.18", features = ["compat", "io-compat"] } -parking_lot = "0.8" +parking_lot = "0.9.0" protobuf = "2.8" quick-error = "1.2" -rand = "0.6" +rand = "0.7" rw-stream-sink = { version = "0.1.1", path = "../misc/rw-stream-sink" } libsecp256k1 = { version = "0.3.1", optional = true } sha2 = "0.8.0" @@ -37,17 +37,17 @@ void = "1" zeroize = "1" [target.'cfg(not(any(target_os = "emscripten", target_os = "unknown")))'.dependencies] -ring = { version = "^0.16", features = ["alloc", "std"], default-features = false } -untrusted = { version = "0.6" } +ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false } +untrusted = "0.7.0" [dev-dependencies] async-std = "0.99" -libp2p-swarm = { version = "0.2.0", path = "../swarm" } -libp2p-tcp = { version = "0.12.0", path = "../transports/tcp" } -libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" } -libp2p-secio = { version = "0.12.0", path = "../protocols/secio" } -rand = "0.6" -quickcheck = "0.8" +libp2p-swarm = { version = "0.3.0", path = "../swarm" } +libp2p-tcp = { version = "0.13.0", path = "../transports/tcp" } +libp2p-mplex = { version = "0.13.0", path = "../muxers/mplex" } +libp2p-secio = { version = "0.13.0", path = "../protocols/secio" } +rand = "0.7.2" +quickcheck = "0.9.0" wasm-timer = "0.2" assert_matches = "1.3" diff --git a/core/src/identity/ed25519.rs b/core/src/identity/ed25519.rs index 1c6662c2aec..17b1dc27066 100644 --- a/core/src/identity/ed25519.rs +++ b/core/src/identity/ed25519.rs @@ -22,8 +22,10 @@ use ed25519_dalek as ed25519; use failure::Fail; +use rand::RngCore; use super::error::DecodingError; use zeroize::Zeroize; +use core::fmt; /// An Ed25519 keypair. pub struct Keypair(ed25519::Keypair); @@ -31,7 +33,7 @@ pub struct Keypair(ed25519::Keypair); impl Keypair { /// Generate a new Ed25519 keypair. pub fn generate() -> Keypair { - Keypair(ed25519::Keypair::generate(&mut rand::thread_rng())) + Keypair::from(SecretKey::generate()) } /// Encode the keypair into a byte array by concatenating the bytes @@ -66,6 +68,12 @@ impl Keypair { } } +impl fmt::Debug for Keypair { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Keypair").field("public", &self.0.public).finish() + } +} + impl Clone for Keypair { fn clone(&self) -> Keypair { let mut sk_bytes = self.0.secret.to_bytes(); @@ -87,9 +95,9 @@ impl From for SecretKey { /// Promote an Ed25519 secret key into a keypair. impl From for Keypair { fn from(sk: SecretKey) -> Keypair { - let secret = sk.0; + let secret: ed25519::ExpandedSecretKey = (&sk.0).into(); let public = ed25519::PublicKey::from(&secret); - Keypair(ed25519::Keypair { secret, public }) + Keypair(ed25519::Keypair { secret: sk.0, public }) } } @@ -135,10 +143,19 @@ impl Clone for SecretKey { } } +impl fmt::Debug for SecretKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "SecretKey") + } +} + impl SecretKey { /// Generate a new Ed25519 secret key. pub fn generate() -> SecretKey { - SecretKey(ed25519::SecretKey::generate(&mut rand::thread_rng())) + let mut bytes = [0u8; 32]; + rand::thread_rng().fill_bytes(&mut bytes); + SecretKey(ed25519::SecretKey::from_bytes(&bytes) + .expect("this returns `Err` only if the length is wrong; the length is correct; qed")) } /// Create an Ed25519 secret key from a byte slice, zeroing the input on success. diff --git a/core/src/identity/secp256k1.rs b/core/src/identity/secp256k1.rs index 5b6ef6b5bc6..686aedbe960 100644 --- a/core/src/identity/secp256k1.rs +++ b/core/src/identity/secp256k1.rs @@ -26,6 +26,7 @@ use sha2::{Digest as ShaDigestTrait, Sha256}; use secp256k1::{Message, Signature}; use super::error::{DecodingError, SigningError}; use zeroize::Zeroize; +use core::fmt; /// A Secp256k1 keypair. #[derive(Clone)] @@ -51,6 +52,12 @@ impl Keypair { } } +impl fmt::Debug for Keypair { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Keypair").field("public", &self.public).finish() + } +} + /// Promote a Secp256k1 secret key into a keypair. impl From for Keypair { fn from(secret: SecretKey) -> Keypair { @@ -70,6 +77,12 @@ impl From for SecretKey { #[derive(Clone)] pub struct SecretKey(secp256k1::SecretKey); +impl fmt::Debug for SecretKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "SecretKey") + } +} + impl SecretKey { /// Generate a new Secp256k1 secret key. pub fn generate() -> SecretKey { diff --git a/core/src/peer_id.rs b/core/src/peer_id.rs index d9dc34e1be7..9ebb68299a7 100644 --- a/core/src/peer_id.rs +++ b/core/src/peer_id.rs @@ -26,6 +26,8 @@ use std::{convert::TryFrom, fmt, str::FromStr}; /// Public keys with byte-lengths smaller than `MAX_INLINE_KEY_LENGTH` will be /// automatically used as the peer id using an identity multihash. +// +// Note: see `from_public_key` for how this value will be used in the future. const MAX_INLINE_KEY_LENGTH: usize = 42; /// Identifier of a peer of the network. @@ -98,7 +100,7 @@ impl PeerId { /// returns back the data as an error. #[inline] pub fn from_multihash(data: multihash::Multihash) -> Result { - if data.algorithm() == multihash::Hash::SHA2256 { + if data.algorithm() == multihash::Hash::SHA2256 || data.algorithm() == multihash::Hash::Identity { Ok(PeerId { multihash: data }) } else { Err(data) diff --git a/misc/core-derive/Cargo.toml b/misc/core-derive/Cargo.toml index c4fa5a8be0d..da21dab1818 100644 --- a/misc/core-derive/Cargo.toml +++ b/misc/core-derive/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-core-derive" edition = "2018" description = "Procedural macros of libp2p-core" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -17,4 +17,4 @@ syn = { version = "0.15.22", default-features = false, features = ["clone-impls" quote = "0.6" [dev-dependencies] -libp2p = { version = "0.12.0", path = "../.." } +libp2p = { version = "0.13.0", path = "../.." } diff --git a/misc/mdns/Cargo.toml b/misc/mdns/Cargo.toml index 03c2a09f6c1..26f69ab6b28 100644 --- a/misc/mdns/Cargo.toml +++ b/misc/mdns/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-mdns" edition = "2018" -version = "0.12.0" +version = "0.13.0" description = "Implementation of the libp2p mDNS discovery method" authors = ["Parity Technologies "] license = "MIT" @@ -14,8 +14,8 @@ async-std = "0.99" data-encoding = "2.0" dns-parser = "0.8" futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../../core" } -libp2p-swarm = { version = "0.2.0", path = "../../swarm" } +libp2p-core = { version = "0.13.0", path = "../../core" } +libp2p-swarm = { version = "0.3.0", path = "../../swarm" } log = "0.4" multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../multiaddr" } net2 = "0.2" diff --git a/misc/mdns/src/dns.rs b/misc/mdns/src/dns.rs index b65d996e3c7..4ac965843cc 100644 --- a/misc/mdns/src/dns.rs +++ b/misc/mdns/src/dns.rs @@ -27,6 +27,9 @@ use libp2p_core::{Multiaddr, PeerId}; use rand; use std::{borrow::Cow, cmp, error, fmt, str, time::Duration}; +/// Maximum size of a DNS label as per RFC1035 +const MAX_LABEL_LENGTH: usize = 63; + /// Decodes a `` (as defined by RFC1035) into a `Vec` of ASCII characters. // TODO: better error type? pub fn decode_character_string(mut from: &[u8]) -> Result, ()> { @@ -117,23 +120,15 @@ pub fn build_query_response( // TTL for the answer append_u32(&mut out, ttl); - let peer_id_base58 = peer_id.to_base58(); - // Peer Id. - let peer_name = format!( - "{}.{}", - data_encoding::BASE32_DNSCURVE.encode(&peer_id.into_bytes()), - str::from_utf8(SERVICE_NAME).expect("SERVICE_NAME is always ASCII") - ); - let mut peer_id_bytes = Vec::with_capacity(64); - append_qname(&mut peer_id_bytes, peer_name.as_bytes()); + let peer_id_bytes = encode_peer_id(&peer_id); debug_assert!(peer_id_bytes.len() <= 0xffff); append_u16(&mut out, peer_id_bytes.len() as u16); out.extend_from_slice(&peer_id_bytes); // The TXT records for answers. for addr in addresses { - let txt_to_send = format!("dnsaddr={}/p2p/{}", addr.to_string(), peer_id_base58); + let txt_to_send = format!("dnsaddr={}/p2p/{}", addr.to_string(), peer_id.to_base58()); let mut txt_to_send_bytes = Vec::with_capacity(txt_to_send.len()); append_character_string(&mut txt_to_send_bytes, txt_to_send.as_bytes())?; append_txt_record(&mut out, &peer_id_bytes, ttl, Some(&txt_to_send_bytes[..]))?; @@ -177,7 +172,7 @@ pub fn build_service_discovery_response(id: u16, ttl: Duration) -> Vec { // Service name. { - let mut name = Vec::new(); + let mut name = Vec::with_capacity(SERVICE_NAME.len() + 2); append_qname(&mut name, SERVICE_NAME); append_u16(&mut out, name.len() as u16); out.extend_from_slice(&name); @@ -211,6 +206,40 @@ fn append_u16(out: &mut Vec, value: u16) { out.push((value & 0xff) as u8); } +/// If a peer ID is longer than 63 characters, split it into segments to +/// be compatible with RFC 1035. +fn segment_peer_id(peer_id: String) -> String { + // Guard for the most common case + if peer_id.len() <= MAX_LABEL_LENGTH { return peer_id } + + // This will only perform one allocation except in extreme circumstances. + let mut out = String::with_capacity(peer_id.len() + 8); + + for (idx, chr) in peer_id.chars().enumerate() { + if idx > 0 && idx % MAX_LABEL_LENGTH == 0 { + out.push('.'); + } + out.push(chr); + } + out +} + +/// Combines and encodes a `PeerId` and service name for a DNS query. +fn encode_peer_id(peer_id: &PeerId) -> Vec { + // DNS-safe encoding for the Peer ID + let raw_peer_id = data_encoding::BASE32_DNSCURVE.encode(&peer_id.as_bytes()); + // ensure we don't have any labels over 63 bytes long + let encoded_peer_id = segment_peer_id(raw_peer_id); + let service_name = str::from_utf8(SERVICE_NAME).expect("SERVICE_NAME is always ASCII"); + let peer_name = [&encoded_peer_id, service_name].join("."); + + // allocate with a little extra padding for QNAME encoding + let mut peer_id_bytes = Vec::with_capacity(peer_name.len() + 32); + append_qname(&mut peer_id_bytes, peer_name.as_bytes()); + + peer_id_bytes +} + /// Appends a `QNAME` (as defined by RFC1035) to the `Vec`. /// /// # Panic @@ -223,7 +252,7 @@ fn append_qname(out: &mut Vec, name: &[u8]) { debug_assert!(name.is_ascii()); for element in name.split(|&c| c == b'.') { - assert!(element.len() < 256, "Service name has a label too long"); + assert!(element.len() < 64, "Service name has a label too long"); assert_ne!(element.len(), 0, "Service name contains zero length label"); out.push(element.len() as u8); for chr in element.iter() { @@ -367,5 +396,21 @@ mod tests { assert!(Packet::parse(&query).is_ok()); } + #[test] + fn test_segment_peer_id() { + let str_32 = String::from_utf8(vec![b'x'; 32]).unwrap(); + let str_63 = String::from_utf8(vec![b'x'; 63]).unwrap(); + let str_64 = String::from_utf8(vec![b'x'; 64]).unwrap(); + let str_126 = String::from_utf8(vec![b'x'; 126]).unwrap(); + let str_127 = String::from_utf8(vec![b'x'; 127]).unwrap(); + + assert_eq!(segment_peer_id(str_32.clone()), str_32); + assert_eq!(segment_peer_id(str_63.clone()), str_63); + + assert_eq!(segment_peer_id(str_64), [&str_63, "x"].join(".")); + assert_eq!(segment_peer_id(str_126), [&str_63, str_63.as_str()].join(".")); + assert_eq!(segment_peer_id(str_127), [&str_63, &str_63, "x"].join(".")); + } + // TODO: test limits and errors } diff --git a/misc/mdns/src/service.rs b/misc/mdns/src/service.rs index f3e2ba3fd0b..ca7856fcf9d 100644 --- a/misc/mdns/src/service.rs +++ b/misc/mdns/src/service.rs @@ -394,18 +394,14 @@ impl<'a> MdnsResponse<'a> { _ => return None, }; - let peer_name = { - let mut iter = record_value.splitn(2, |c| c == '.'); - let name = match iter.next() { - Some(n) => n.to_owned(), - None => return None, - }; - if iter.next().map(|v| v.as_bytes()) != Some(SERVICE_NAME) { - return None; - } - name + let mut peer_name = match record_value.rsplitn(4, |c| c == '.').last() { + Some(n) => n.to_owned(), + None => return None, }; + // if we have a segmented name, remove the '.' + peer_name.retain(|c| c != '.'); + let peer_id = match data_encoding::BASE32_DNSCURVE.decode(peer_name.as_bytes()) { Ok(bytes) => match PeerId::from_bytes(bytes) { Ok(id) => id, @@ -524,11 +520,10 @@ mod tests { use libp2p_core::PeerId; use std::{io, task::Poll, time::Duration}; use crate::service::{MdnsPacket, MdnsService}; + use multiaddr::multihash::*; - #[test] - fn discover_ourselves() { + fn discover(peer_id: PeerId) { let mut service = MdnsService::new().unwrap(); - let peer_id = PeerId::random(); let stream = stream::poll_fn(move |cx| -> Poll>> { loop { let packet = match service.poll(cx) { @@ -558,4 +553,16 @@ mod tests { .for_each(|_| future::ready(())), ); } + + #[test] + fn discover_normal_peer_id() { + discover(PeerId::random()) + } + + #[test] + fn discover_long_peer_id() { + let max_value = String::from_utf8(vec![b'f'; 42]).unwrap(); + let hash = encode(Hash::Identity, max_value.as_ref()).unwrap(); + discover(PeerId::from_multihash(hash).unwrap()) + } } diff --git a/misc/multiaddr/Cargo.toml b/misc/multiaddr/Cargo.toml index 3d14f53481d..20529c1d309 100644 --- a/misc/multiaddr/Cargo.toml +++ b/misc/multiaddr/Cargo.toml @@ -6,15 +6,15 @@ description = "Implementation of the multiaddr format" homepage = "https://github.com/libp2p/rust-libp2p" keywords = ["multiaddr", "ipfs"] license = "MIT" -version = "0.5.0" +version = "0.5.1" [dependencies] arrayref = "0.3" -bs58 = "0.2.0" +bs58 = "0.3.0" byteorder = "1.3.1" bytes = "0.4.12" data-encoding = "2.1" -multihash = { package = "parity-multihash", version = "0.1.0", path = "../multihash" } +multihash = { package = "parity-multihash", version = "0.1.4", path = "../multihash" } percent-encoding = "2.1.0" serde = "1.0.70" unsigned-varint = "0.2" @@ -22,8 +22,8 @@ url = { version = "2.1.0", default-features = false } [dev-dependencies] bincode = "1" -bs58 = "0.2.0" +bs58 = "0.3.0" data-encoding = "2" -quickcheck = "0.8.1" -rand = "0.6.5" +quickcheck = "0.9.0" +rand = "0.7.2" serde_json = "1.0" diff --git a/misc/multihash/Cargo.toml b/misc/multihash/Cargo.toml index 0a6ad5229bc..bfff681e434 100644 --- a/misc/multihash/Cargo.toml +++ b/misc/multihash/Cargo.toml @@ -4,7 +4,7 @@ edition = "2018" description = "Implementation of the multihash format" repository = "https://github.com/libp2p/rust-libp2p" keywords = ["multihash", "ipfs"] -version = "0.1.3" +version = "0.1.4" authors = ["dignifiedquire ", "Parity Technologies "] license = "MIT" documentation = "https://docs.rs/parity-multihash/" diff --git a/misc/multistream-select/Cargo.toml b/misc/multistream-select/Cargo.toml index 0a5fce0be6d..7e30a382e88 100644 --- a/misc/multistream-select/Cargo.toml +++ b/misc/multistream-select/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "multistream-select" description = "Multistream-select negotiation protocol for libp2p" -version = "0.5.1" +version = "0.6.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,14 +11,14 @@ edition = "2018" [dependencies] bytes = "0.4" -futures = { version = "0.1" } +futures = "0.1" log = "0.4" smallvec = "0.6" tokio-io = "0.1" -unsigned-varint = { version = "0.2.2" } +unsigned-varint = "0.2.2" [dev-dependencies] tokio = "0.1" tokio-tcp = "0.1" -quickcheck = "0.8" -rand = "0.6" +quickcheck = "0.9.0" +rand = "0.7.2" diff --git a/misc/peer-id-generator/Cargo.toml b/misc/peer-id-generator/Cargo.toml index 17888569ec7..c6f2cad4496 100644 --- a/misc/peer-id-generator/Cargo.toml +++ b/misc/peer-id-generator/Cargo.toml @@ -11,5 +11,5 @@ categories = ["network-programming", "asynchronous"] publish = false [dependencies] -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } num_cpus = "1.8" diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index de4739ed688..29c2bb24fcb 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-mplex" edition = "2018" description = "Mplex multiplexing protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,10 +14,10 @@ bytes = "0.4.5" fnv = "1.0" futures_codec = "0.3.0" futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4" parking_lot = "0.8" unsigned-varint = { version = "0.2.3", features = ["futures-codec"] } [dev-dependencies] -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index 7720722b41c..6410e21f55a 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-yamux" edition = "2018" description = "Yamux multiplexing protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,7 +11,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.1" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4" tokio-io = "0.1" yamux = "0.2.1" diff --git a/protocols/deflate/Cargo.toml b/protocols/deflate/Cargo.toml index f8c07e86c9a..c81c6fade80 100644 --- a/protocols/deflate/Cargo.toml +++ b/protocols/deflate/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-deflate" edition = "2018" description = "Deflate encryption protocol for libp2p" -version = "0.4.0" +version = "0.5.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,12 +11,12 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } flate2 = "1.0" [dev-dependencies] async-std = "0.99" -env_logger = "0.6" -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } +env_logger = "0.7.1" +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } rand = "0.7" -quickcheck = "0.8" +quickcheck = "0.9.0" diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index 230eca2724b..ec87c35cb03 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-floodsub" edition = "2018" description = "Floodsub protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -10,13 +10,13 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -bs58 = "0.2.0" +bs58 = "0.3.0" bytes = "0.4" cuckoofilter = "0.3.2" fnv = "1.0" futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../../core" } -libp2p-swarm = { version = "0.2.0", path = "../../swarm" } +libp2p-core = { version = "0.13.0", path = "../../core" } +libp2p-swarm = { version = "0.3.0", path = "../../swarm" } protobuf = "2.8" rand = "0.6" smallvec = "0.6.5" diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index ee220264136..d4ff6339b58 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-identify" edition = "2018" description = "Nodes identifcation protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,18 +13,17 @@ categories = ["network-programming", "asynchronous"] bytes = "0.4" futures_codec = "0.3.0" futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../../core" } -libp2p-swarm = { version = "0.2.0", path = "../../swarm" } +libp2p-core = { version = "0.13.0", path = "../../core" } +libp2p-swarm = { version = "0.3.0", path = "../../swarm" } log = "0.4.1" multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" } protobuf = "2.8" smallvec = "0.6" wasm-timer = "0.2" unsigned-varint = { version = "0.2.3", features = ["futures-codec"] } -void = "1.0" [dev-dependencies] -libp2p-mplex = { version = "0.12.0", path = "../../muxers/mplex" } -libp2p-secio = { version = "0.12.0", path = "../../protocols/secio" } -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } +libp2p-mplex = { version = "0.13.0", path = "../../muxers/mplex" } +libp2p-secio = { version = "0.13.0", path = "../../protocols/secio" } +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } rand = "0.6" diff --git a/protocols/identify/src/handler.rs b/protocols/identify/src/handler.rs index 90eb056d8cc..72ddc8f8078 100644 --- a/protocols/identify/src/handler.rs +++ b/protocols/identify/src/handler.rs @@ -36,7 +36,6 @@ use libp2p_swarm::{ use smallvec::SmallVec; use std::{marker::PhantomData, pin::Pin, task::Context, task::Poll, time::Duration}; use wasm_timer::Delay; -use void::Void; /// Delay between the moment we connect and the first time we identify. const DELAY_TO_FIRST_ID: Duration = Duration::from_millis(500); @@ -95,7 +94,7 @@ impl ProtocolsHandler for IdentifyHandler where TSubstream: AsyncRead + AsyncWrite + Unpin + 'static, { - type InEvent = Void; + type InEvent = (); type OutEvent = IdentifyHandlerEvent; type Error = ReadOneError; type Substream = TSubstream; diff --git a/protocols/identify/src/identify.rs b/protocols/identify/src/identify.rs index 93f3bbb8bac..c764da9a475 100644 --- a/protocols/identify/src/identify.rs +++ b/protocols/identify/src/identify.rs @@ -36,7 +36,6 @@ use libp2p_swarm::{ ProtocolsHandlerUpgrErr }; use std::{collections::HashMap, collections::VecDeque, io, pin::Pin, task::Context, task::Poll}; -use void::Void; /// Network behaviour that automatically identifies nodes periodically, returns information /// about them, and answers identify queries from other nodes. @@ -52,7 +51,7 @@ pub struct Identify { /// Pending replies to send. pending_replies: VecDeque>, /// Pending events to be emitted when polled. - events: VecDeque>, + events: VecDeque>, } /// A pending reply to an inbound identification request. diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 4e5baca3b01..f81f8757c31 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-kad" edition = "2018" description = "Kademlia protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -10,19 +10,19 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -arrayvec = "0.4.7" +arrayvec = "0.5.1" bytes = "0.4" either = "1.5" fnv = "1.0" futures_codec = "0.3.0" futures-preview = "0.3.0-alpha.18" log = "0.4" -libp2p-core = { version = "0.12.0", path = "../../core" } -libp2p-swarm = { version = "0.2.0", path = "../../swarm" } +libp2p-core = { version = "0.13.0", path = "../../core" } +libp2p-swarm = { version = "0.3.0", path = "../../swarm" } multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" } -multihash = { package = "parity-multihash", version = "0.1.0", path = "../../misc/multihash" } +multihash = { package = "parity-multihash", version = "0.1.4", path = "../../misc/multihash" } protobuf = "2.8" -rand = "0.6.0" +rand = "0.7.2" sha2 = "0.8.0" smallvec = "0.6" wasm-timer = "0.2" @@ -31,8 +31,8 @@ unsigned-varint = { version = "0.2.3", features = ["futures-codec"] } void = "1.0" [dev-dependencies] -libp2p-secio = { version = "0.12.0", path = "../secio" } -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } -libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" } -quickcheck = "0.8" -rand = "0.6.0" +libp2p-secio = { version = "0.13.0", path = "../secio" } +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } +libp2p-yamux = { version = "0.13.0", path = "../../muxers/yamux" } +quickcheck = "0.9.0" +rand = "0.7.2" diff --git a/protocols/kad/src/behaviour.rs b/protocols/kad/src/behaviour.rs index db9363643a3..588bdd8aca2 100644 --- a/protocols/kad/src/behaviour.rs +++ b/protocols/kad/src/behaviour.rs @@ -1313,7 +1313,7 @@ where let now = Instant::now(); // Calculate the available capacity for queries triggered by background jobs. - let mut jobs_query_capacity = JOBS_MAX_QUERIES - self.queries.size(); + let mut jobs_query_capacity = JOBS_MAX_QUERIES.saturating_sub(self.queries.size()); // Run the periodic provider announcement job. if let Some(mut job) = self.add_provider_job.take() { diff --git a/protocols/kad/src/behaviour/test.rs b/protocols/kad/src/behaviour/test.rs index 5bf8db1ba0b..7786762dda2 100644 --- a/protocols/kad/src/behaviour/test.rs +++ b/protocols/kad/src/behaviour/test.rs @@ -623,3 +623,34 @@ fn add_provider() { QuickCheck::new().tests(3).quickcheck(prop as fn(_,_)) } +/// User code should be able to start queries beyond the internal +/// query limit for background jobs. Originally this even produced an +/// arithmetic overflow, see https://github.com/libp2p/rust-libp2p/issues/1290. +#[test] +fn exceed_jobs_max_queries() { + let (_, mut swarms) = build_nodes(1); + let num = JOBS_MAX_QUERIES + 1; + for _ in 0 .. num { + swarms[0].bootstrap(); + } + + assert_eq!(swarms[0].queries.size(), num); + + current_thread::run( + future::poll_fn(move || { + for _ in 0 .. num { + // There are no other nodes, so the queries finish instantly. + if let Ok(Async::Ready(Some(e))) = swarms[0].poll() { + if let KademliaEvent::BootstrapResult(r) = e { + assert!(r.is_ok(), "Unexpected error") + } else { + panic!("Unexpected event: {:?}", e) + } + } else { + panic!("Expected event") + } + } + Ok(Async::Ready(())) + })) +} + diff --git a/protocols/noise/Cargo.toml b/protocols/noise/Cargo.toml index 86ee6442edb..051dadb26ed 100644 --- a/protocols/noise/Cargo.toml +++ b/protocols/noise/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-noise" description = "Cryptographic handshake protocol using the noise framework." -version = "0.10.0" +version = "0.11.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -12,19 +12,19 @@ bytes = "0.4" curve25519-dalek = "1" futures-preview = "0.3.0-alpha.18" lazy_static = "1.2" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4" protobuf = "2.8" -rand = "^0.7" -ring = { version = "^0.16", features = ["alloc"], default-features = false } +rand = "^0.7.2" +ring = { version = "0.16.9", features = ["alloc"], default-features = false } snow = { version = "0.6.1", features = ["ring-resolver"], default-features = false } tokio-io = "0.1" x25519-dalek = "0.5" zeroize = "1" [dev-dependencies] -env_logger = "0.6" -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } -quickcheck = "0.8" +env_logger = "0.7.1" +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } +quickcheck = "0.9.0" tokio = "0.1" sodiumoxide = "^0.2.5" diff --git a/protocols/noise/src/protocol.rs b/protocols/noise/src/protocol.rs index 4908c6be0d9..60124f86b01 100644 --- a/protocols/noise/src/protocol.rs +++ b/protocols/noise/src/protocol.rs @@ -252,4 +252,3 @@ impl rand::RngCore for Rng { impl rand::CryptoRng for Rng {} impl snow::types::Random for Rng {} - diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 7e2d5ec9d95..83b5f12917e 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-ping" edition = "2018" description = "Ping protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,19 +11,19 @@ categories = ["network-programming", "asynchronous"] [dependencies] bytes = "0.4" -libp2p-core = { version = "0.12.0", path = "../../core" } -libp2p-swarm = { version = "0.2.0", path = "../../swarm" } +libp2p-core = { version = "0.13.0", path = "../../core" } +libp2p-swarm = { version = "0.3.0", path = "../../swarm" } log = "0.4.1" multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" } futures-preview = "0.3.0-alpha.18" -rand = "0.6" +rand = "0.7.2" wasm-timer = "0.2" void = "1.0" [dev-dependencies] -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } -libp2p-secio = { version = "0.12.0", path = "../../protocols/secio" } -libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" } -quickcheck = "0.8" +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } +libp2p-secio = { version = "0.13.0", path = "../../protocols/secio" } +libp2p-yamux = { version = "0.13.0", path = "../../muxers/yamux" } +quickcheck = "0.9.0" tokio = "0.1" tokio-tcp = "0.1" diff --git a/protocols/plaintext/Cargo.toml b/protocols/plaintext/Cargo.toml index f3e58f65216..c6db29d8bac 100644 --- a/protocols/plaintext/Cargo.toml +++ b/protocols/plaintext/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-plaintext" edition = "2018" description = "Plaintext encryption dummy protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -10,11 +10,11 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -bytes = "0.4" futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../../core" } -log = "0.4.6" -void = "1" +libp2p-core = { version = "0.13.0", path = "../../core" } +bytes = "0.4.12" +log = "0.4.8" +void = "1.0.2" tokio-io = "0.1.12" -protobuf = "2.3" +protobuf = "2.8.1" rw-stream-sink = { version = "0.1.1", path = "../../misc/rw-stream-sink" } diff --git a/protocols/plaintext/src/lib.rs b/protocols/plaintext/src/lib.rs index e5605e119f5..8013e199f68 100644 --- a/protocols/plaintext/src/lib.rs +++ b/protocols/plaintext/src/lib.rs @@ -32,6 +32,32 @@ mod error; mod handshake; mod pb; +/// `PlainText1Config` is an insecure connection handshake for testing purposes only. +/// +/// > **Note**: Given that `PlainText1Config` has no notion of exchanging peer identity information it is not compatible +/// > with the `libp2p_core::transport::upgrade::Builder` pattern. See +/// > [`PlainText2Config`](struct.PlainText2Config.html) if compatibility is needed. Even though not compatible with the +/// > Builder pattern one can still do an upgrade *manually*: +/// +/// ``` +/// # use libp2p_core::transport::{ Transport, memory::MemoryTransport }; +/// # use libp2p_plaintext::PlainText1Config; +/// # +/// MemoryTransport::default() +/// .and_then(move |io, endpoint| { +/// libp2p_core::upgrade::apply( +/// io, +/// PlainText1Config{}, +/// endpoint, +/// libp2p_core::transport::upgrade::Version::V1, +/// ) +/// }) +/// .map(|plaintext, _endpoint| { +/// unimplemented!(); +/// // let peer_id = somehow_derive_peer_id(); +/// // return (peer_id, plaintext); +/// }); +/// ``` #[derive(Debug, Copy, Clone)] pub struct PlainText1Config; @@ -64,6 +90,8 @@ impl OutboundUpgrade for PlainText1Config { } } +/// `PlainText2Config` is an insecure connection handshake for testing purposes only, implementing +/// the libp2p plaintext connection handshake specification. #[derive(Clone)] pub struct PlainText2Config { pub local_public_key: identity::PublicKey, diff --git a/protocols/secio/Cargo.toml b/protocols/secio/Cargo.toml index 0e90678956d..a06495ea4fb 100644 --- a/protocols/secio/Cargo.toml +++ b/protocols/secio/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-secio" edition = "2018" description = "Secio encryption protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] bytes = "0.4" futures-preview = "0.3.0-alpha.18" futures_codec = "0.3.0" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4.6" protobuf = "2.8" rand = "0.6.5" @@ -28,8 +28,8 @@ hmac = "0.7.0" unsigned-varint = { version = "0.2.3", features = ["futures-codec"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -ring = { version = "^0.16", features = ["alloc"], default-features = false } -untrusted = { version = "0.6" } +ring = { version = "0.16.9", features = ["alloc"], default-features = false } +untrusted = "0.7.0" [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = "0.3.10" @@ -45,9 +45,9 @@ aes-all = ["aesni"] [dev-dependencies] async-std = "0.99" -criterion = "0.2" -libp2p-mplex = { version = "0.12.0", path = "../../muxers/mplex" } -libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } +criterion = "0.3.0" +libp2p-mplex = { version = "0.13.0", path = "../../muxers/mplex" } +libp2p-tcp = { version = "0.13.0", path = "../../transports/tcp" } [[bench]] name = "bench" diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index ddb6cb3b2b4..131c46bedbb 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-swarm" edition = "2018" description = "The libp2p swarm" -version = "0.2.0" +version = "0.3.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -11,12 +11,12 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures-preview = "0.3.0-alpha.18" -libp2p-core = { version = "0.12.0", path = "../core" } +libp2p-core = { version = "0.13.0", path = "../core" } smallvec = "0.6" wasm-timer = "0.2" void = "1" [dev-dependencies] -libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" } -quickcheck = "0.8" -rand = "0.6" +libp2p-mplex = { version = "0.13.0", path = "../muxers/mplex" } +quickcheck = "0.9.0" +rand = "0.7.2" diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index f9bc8de22fb..62f8251fb58 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-dns" edition = "2018" description = "DNS transport implementation for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -10,6 +10,6 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4.1" futures-preview = "0.3.0-alpha.18" diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index b683d9f0dc9..b3e7aac3fe3 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-tcp" edition = "2018" description = "TCP/IP transport protocol for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,7 +14,7 @@ async-std = "0.99" bytes = "0.4" get_if_addrs = "0.5.3" ipnet = "2.0.0" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4.1" futures-preview = "0.3.0-alpha.18" futures-timer = "0.3" diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index 0355e94ec2f..5b759dee560 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-uds" edition = "2018" description = "Unix domain sockets transport for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -10,7 +10,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [target.'cfg(all(unix, not(any(target_os = "emscripten", target_os = "unknown"))))'.dependencies] -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4.1" futures-preview = "0.3.0-alpha.18" romio = "0.3.0-alpha.9" diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml index 3c9610cdc4c..41606b40236 100644 --- a/transports/wasm-ext/Cargo.toml +++ b/transports/wasm-ext/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-wasm-ext" -version = "0.5.0" +version = "0.6.0" authors = ["Pierre Krieger "] edition = "2018" description = "Allows passing in an external transport in a WASM environment" @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures-preview = "0.3.0-alpha.18" js-sys = "0.3.19" -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } parity-send-wrapper = "0.1.0" wasm-bindgen = "0.2.42" wasm-bindgen-futures = { version = "0.3.25", features = ["futures_0_3"] } diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 517a45bff23..463c6264002 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-websocket" edition = "2018" description = "WebSocket transport for libp2p" -version = "0.12.0" +version = "0.13.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -14,12 +14,12 @@ bytes = "0.4.12" either = "1.5.3" futures-preview = "0.3.0-alpha.18" #futures-rustls = "0.12.0-alpha" # TODO: https://github.com/quininer/tokio-rustls/issues/51 -libp2p-core = { version = "0.12.0", path = "../../core" } +libp2p-core = { version = "0.13.0", path = "../../core" } log = "0.4.8" rw-stream-sink = { version = "0.1.1", path = "../../misc/rw-stream-sink" } soketto = { git = "https://github.com/paritytech/soketto.git", branch = "develop", features = ["deflate"] } url = "2.1.0" -webpki-roots = "0.17.0" +webpki-roots = "0.18.0" [dev-dependencies] -libp2p-tcp = { version = "0.12.0", path = "../tcp" } +libp2p-tcp = { version = "0.13.0", path = "../tcp" }