Merge branch 'rust_master' into fluence_master

# Conflicts:
#	protocols/secio/benches/bench.rs
This commit is contained in:
folex
2020-07-17 13:05:17 +03:00
58 changed files with 425 additions and 300 deletions

View File

@ -1,3 +1,7 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.2 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -2,7 +2,7 @@
name = "libp2p-deflate"
edition = "2018"
description = "Deflate encryption protocol for libp2p"
version = "0.19.2"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -11,7 +11,7 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
futures = "0.3.1"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-core = { version = "0.20.0", path = "../../core" }
flate2 = "1.0"
[dev-dependencies]

View File

@ -1,3 +1,7 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.1 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -2,7 +2,7 @@
name = "libp2p-floodsub"
edition = "2018"
description = "Floodsub protocol for libp2p"
version = "0.19.1"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -13,8 +13,8 @@ categories = ["network-programming", "asynchronous"]
cuckoofilter = "0.3.2"
fnv = "1.0"
futures = "0.3.1"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
prost = "0.6.1"
rand = "0.7"
smallvec = "1.0"

View File

@ -1,7 +1,11 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.3 [2020-06-23]
Maintenance release fixing linter warnings.
- Maintenance release fixing linter warnings.
# 0.19.2 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -2,7 +2,7 @@
name = "libp2p-gossipsub"
edition = "2018"
description = "Gossipsub protocol for libp2p"
version = "0.19.3"
version = "0.20.0"
authors = ["Age Manning <Age@AgeManning.com>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -10,8 +10,8 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]
[dependencies]
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
bytes = "0.5.4"
byteorder = "1.3.2"
fnv = "1.0.6"

View File

@ -1,3 +1,7 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.2 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -2,7 +2,7 @@
name = "libp2p-identify"
edition = "2018"
description = "Nodes identifcation protocol for libp2p"
version = "0.19.2"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -11,8 +11,8 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
futures = "0.3.1"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
log = "0.4.1"
prost = "0.6.1"
smallvec = "1.0"

View File

@ -1,4 +1,7 @@
# 0.21.0 [????-??-??]
# 0.21.0 [2020-07-01]
- Remove `KademliaEvent::Discovered`
([PR 1632](https://github.com/libp2p/rust-libp2p/pull/1632))
- More control and insight for k-buckets
([PR 1628](https://github.com/libp2p/rust-libp2p/pull/1628)).
@ -12,7 +15,7 @@
# 0.20.1 [2020-06-23]
Maintenance release ([PR 1623](https://github.com/libp2p/rust-libp2p/pull/1623)).
- Maintenance release ([PR 1623](https://github.com/libp2p/rust-libp2p/pull/1623)).
# 0.20.0 [2020-06-22]

View File

@ -2,7 +2,7 @@
name = "libp2p-kad"
edition = "2018"
description = "Kademlia protocol for libp2p"
version = "0.20.1"
version = "0.21.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -17,8 +17,8 @@ fnv = "1.0"
futures_codec = "0.4"
futures = "0.3.1"
log = "0.4"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
multihash = "0.11.0"
prost = "0.6.1"
rand = "0.7.2"

View File

@ -1,3 +1,7 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.2 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -1,7 +1,7 @@
[package]
name = "libp2p-mdns"
edition = "2018"
version = "0.19.2"
version = "0.20.0"
description = "Implementation of the libp2p mDNS discovery method"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
@ -16,8 +16,8 @@ dns-parser = "0.8"
either = "1.5.3"
futures = "0.3.1"
lazy_static = "1.2"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
log = "0.4"
net2 = "0.2"
rand = "0.7"

View File

@ -1,3 +1,9 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
- Conditional compilation fixes for the `wasm32-wasi` target
([PR 1633](https://github.com/libp2p/rust-libp2p/pull/1633)).
# 0.19.1 [2020-06-22]
- Re-add noise upgrades for IK and IX

View File

@ -1,7 +1,7 @@
[package]
name = "libp2p-noise"
description = "Cryptographic handshake protocol using the noise framework."
version = "0.19.1"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -11,7 +11,7 @@ edition = "2018"
curve25519-dalek = "2.0.0"
futures = "0.3.1"
lazy_static = "1.2"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-core = { version = "0.20.0", path = "../../core" }
log = "0.4"
prost = "0.6.1"
rand = "0.7.2"

View File

@ -1,6 +1,10 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.3 [2020-06-22]
Updated dependencies.
- Updated dependencies.
# 0.19.2 [2020-06-18]

View File

@ -2,7 +2,7 @@
name = "libp2p-ping"
edition = "2018"
description = "Ping protocol for libp2p"
version = "0.19.3"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -11,8 +11,8 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
futures = "0.3.1"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
log = "0.4.1"
rand = "0.7.2"
void = "1.0"

View File

@ -1,3 +1,7 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
# 0.19.1 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -2,7 +2,7 @@
name = "libp2p-plaintext"
edition = "2018"
description = "Plaintext encryption dummy protocol for libp2p"
version = "0.19.1"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"]
bytes = "0.5"
futures = "0.3.1"
futures_codec = "0.4.0"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-core = { version = "0.20.0", path = "../../core" }
log = "0.4.8"
prost = "0.6.1"
rw-stream-sink = "0.2.0"

View File

@ -1,4 +1,12 @@
# 0.1.1
- Always properly `close()` the substream after sending requests and
responses in the `InboundUpgrade` and `OutboundUpgrade`. Otherwise this is
left to `RequestResponseCodec::write_request` and `RequestResponseCodec::write_response`,
which can be a pitfall and lead to subtle problems (see e.g.
https://github.com/libp2p/rust-libp2p/pull/1606).
# 0.1.0
Initial release.
- Initial release.

View File

@ -2,7 +2,7 @@
name = "libp2p-request-response"
edition = "2018"
description = "Generic Request/Response Protocols"
version = "0.1.0"
version = "0.1.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -12,8 +12,8 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
async-trait = "0.1"
futures = "0.3.1"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-swarm = { version = "0.19.1", path = "../../swarm" }
libp2p-core = { version = "0.20.0", path = "../../core" }
libp2p-swarm = { version = "0.20.0", path = "../../swarm" }
smallvec = "1.4"
wasm-timer = "0.2"

View File

@ -113,6 +113,7 @@ where
write.await?;
}
}
io.close().await?;
Ok(())
}.boxed()
}
@ -156,10 +157,10 @@ where
async move {
let write = self.codec.write_request(&protocol, &mut io, self.request);
write.await?;
io.close().await?;
let read = self.codec.read_response(&protocol, &mut io);
let response = read.await?;
Ok(response)
}.boxed()
}
}

View File

@ -1,3 +1,9 @@
# 0.20.0 [2020-07-01]
- Updated dependencies.
- Conditional compilation fixes for the `wasm32-wasi` target
([PR 1633](https://github.com/libp2p/rust-libp2p/pull/1633)).
# 0.19.2 [2020-06-22]
Updated dependencies.
- Updated dependencies.

View File

@ -2,7 +2,7 @@
name = "libp2p-secio"
edition = "2018"
description = "Secio encryption protocol for libp2p"
version = "0.19.2"
version = "0.20.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
@ -16,7 +16,7 @@ ctr = "0.3"
futures = "0.3.1"
hmac = "0.7.0"
lazy_static = "1.2.0"
libp2p-core = { version = "0.19.2", path = "../../core" }
libp2p-core = { version = "0.20.0", path = "../../core" }
log = "0.4.6"
prost = "0.6.1"
pin-project = "0.4.17"
@ -50,7 +50,3 @@ async-std = "1.6.2"
criterion = "0.3"
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p-tcp = { path = "../../transports/tcp", features = ["async-std"] }
[[bench]]
name = "bench"
harness = false

View File

@ -1,126 +0,0 @@
// // Copyright 2019 Parity Technologies (UK) Ltd.
// //
// // Permission is hereby granted, free of charge, to any person obtaining a
// // copy of this software and associated documentation files (the "Software"),
// // to deal in the Software without restriction, including without limitation
// // the rights to use, copy, modify, merge, publish, distribute, sublicense,
// // and/or sell copies of the Software, and to permit persons to whom the
// // Software is furnished to do so, subject to the following conditions:
// //
// // The above copyright notice and this permission notice shall be included in
// // all copies or substantial portions of the Software.
// //
// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// // DEALINGS IN THE SOFTWARE.
//
// use criterion::{Bencher, Criterion, criterion_main, criterion_group};
// use futures::prelude::*;
// use libp2p_core::Transport;
// use tokio::{
// io,
// runtime::current_thread::Runtime
// };
//
// fn secio_and_send_data(bench: &mut Bencher, data: &[u8]) {
// let key = libp2p_secio::SecioKeyPair::ed25519_generated().unwrap();
// let transport =
// libp2p_tcp::TcpConfig::new().with_upgrade(libp2p_secio::SecioConfig::new(key));
//
// let data_vec = data.to_vec();
//
// bench.iter(move || {
// let (listener, addr) = transport
// .clone()
// .listen_on("/ip4/127.0.0.1/tcp/0".parse().unwrap())
// .unwrap();
//
// let listener_side = listener
// .into_future()
// .map_err(|(err, _)| err)
// .and_then(|(client, _)| client.unwrap().0)
// .map_err(|_| panic!())
// .and_then(|client| io::read_to_end(client.stream, Vec::new()))
// .and_then(|msg| {
// assert_eq!(msg.1, data);
// Ok(())
// });
//
// let dialer_side = transport
// .clone()
// .dial(addr)
// .unwrap()
// .map_err(|_| panic!())
// .and_then(|server| io::write_all(server.stream, data_vec.clone()))
// .map(|_| ());
//
// let combined = listener_side.select(dialer_side)
// .map_err(|(err, _)| panic!("{:?}", err))
// .map(|_| ());
// let mut rt = Runtime::new().unwrap();
// rt.block_on(combined).unwrap();
// })
// }
//
// fn raw_tcp_connect_and_send_data(bench: &mut Bencher, data: &[u8]) {
// let transport = libp2p_tcp::TcpConfig::new();
// let data_vec = data.to_vec();
//
// bench.iter(move || {
// let (listener, addr) = transport
// .clone()
// .listen_on("/ip4/127.0.0.1/tcp/0".parse().unwrap())
// .unwrap();
//
// let listener_side = listener
// .into_future()
// .map_err(|(err, _)| err)
// .and_then(|(client, _)| client.unwrap().0)
// .map_err(|_| panic!())
// .and_then(|client| io::read_to_end(client, Vec::new()))
// .and_then(|msg| {
// assert_eq!(msg.1, data);
// Ok(())
// });
//
// let dialer_side = transport
// .clone()
// .dial(addr)
// .unwrap()
// .map_err(|_| panic!())
// .and_then(|server| io::write_all(server, data_vec.clone()))
// .map(|_| ());
//
// let combined = listener_side.select(dialer_side)
// .map_err(|(err, _)| panic!("{:?}", err))
// .map(|_| ());
// let mut rt = Runtime::new().unwrap();
// rt.block_on(combined).unwrap();
// })
// }
//
// fn criterion_benchmarks(bench: &mut Criterion) {
// bench.bench_function("secio_connect_and_send_hello", move |b| secio_and_send_data(b, b"hello world"));
// bench.bench_function("raw_tcp_connect_and_send_hello", move |b| raw_tcp_connect_and_send_data(b, b"hello world"));
//
// let data = (0 .. 1024).map(|_| rand::random::<u8>()).collect::<Vec<_>>();
// bench.bench_function("secio_connect_and_send_one_kb", { let data = data.clone(); move |b| secio_and_send_data(b, &data) });
// bench.bench_function("raw_tcp_connect_and_send_one_kb", move |b| raw_tcp_connect_and_send_data(b, &data));
//
// let data = (0 .. 1024 * 1024).map(|_| rand::random::<u8>()).collect::<Vec<_>>();
// bench.bench_function("secio_connect_and_send_one_mb", { let data = data.clone(); move |b| secio_and_send_data(b, &data) });
// bench.bench_function("raw_tcp_connect_and_send_one_mb", move |b| raw_tcp_connect_and_send_data(b, &data));
//
// let data = (0 .. 2 * 1024 * 1024).map(|_| rand::random::<u8>()).collect::<Vec<_>>();
// bench.bench_function("secio_connect_and_send_two_mb", { let data = data.clone(); move |b| secio_and_send_data(b, &data) });
// bench.bench_function("raw_tcp_connect_and_send_two_mb", move |b| raw_tcp_connect_and_send_data(b, &data));
// }
//
// criterion_group!(benches, criterion_benchmarks);
// criterion_main!(benches);
fn main () {}