From 62d0b78293efc4c99e711d2324f9b6d32c84594d Mon Sep 17 00:00:00 2001 From: driftluo Date: Mon, 23 Sep 2019 11:10:55 +0800 Subject: [PATCH] chore: bump to 0.2.5 --- CHANGELOG.md | 13 +++++++++++++ Cargo.toml | 4 ++-- protocols/discovery/Cargo.toml | 4 ++-- protocols/discovery/src/substream.rs | 16 ++++++---------- protocols/identify/Cargo.toml | 4 ++-- protocols/ping/Cargo.toml | 4 ++-- secio/Cargo.toml | 2 +- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f6e764c..890398a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 0.2.5 + +### Features + +- Upgrade molecule, use compatible mode +- Add `global_ip_only` to identify/discovery +- Add Readme to identify/discovery + +### Bug fix + +- Fix substream cache processing is not timely +- Fix session `set_delay` status setting error,may cause an invalid call + ## 0.2.4 ### Features diff --git a/Cargo.toml b/Cargo.toml index 9f923561..ec13fcb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tentacle" -version = "0.2.4" +version = "0.2.5" license = "MIT" description = "Minimal implementation for a multiplexed p2p network framework." authors = ["piaoliu <441594700@qq.com>", "Nervos Core Dev "] @@ -18,7 +18,7 @@ no-default-features = true [dependencies] yamux = { path = "yamux", version = "0.1.13", package = "tokio-yamux" } -secio = { path = "secio", version = "0.1.10", package = "tentacle-secio" } +secio = { path = "secio", version = "0.1.11", package = "tentacle-secio" } futures = "0.1" tokio = "0.1" diff --git a/protocols/discovery/Cargo.toml b/protocols/discovery/Cargo.toml index 710953e9..c365b10e 100644 --- a/protocols/discovery/Cargo.toml +++ b/protocols/discovery/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tentacle-discovery" -version = "0.2.6" +version = "0.2.7" authors = ["Linfeng Qian "] license = "MIT" description = "p2p discovery protocol main reference bitcoin" @@ -15,7 +15,7 @@ all-features = false no-default-features = true [dependencies] -p2p = { path = "../..", version = "0.2.4", package = "tentacle" } +p2p = { path = "../..", version = "0.2.5", package = "tentacle" } bytes = "0.4" byteorder = "1.2" futures = "0.1" diff --git a/protocols/discovery/src/substream.rs b/protocols/discovery/src/substream.rs index fee0c469..f9b63ae6 100644 --- a/protocols/discovery/src/substream.rs +++ b/protocols/discovery/src/substream.rs @@ -214,6 +214,11 @@ impl SubstreamValue { return Err(io::ErrorKind::Other.into()); } } else { + // TODO: magic number + // must get the item first, otherwise it is possible to load + // the address of peer listen. + let mut items = addr_mgr.get_random(2500); + // change client random outbound port to client listen port debug!("listen port: {:?}", listen_port); if let Some(port) = listen_port { @@ -227,8 +232,6 @@ impl SubstreamValue { } } - // TODO: magic number - let mut items = addr_mgr.get_random(2500); while items.len() > 1000 { if let Some(last_item) = items.pop() { let idx = rand::random::() % 1000; @@ -377,14 +380,7 @@ impl Substream { context .listens() .iter() - .map(|address| multiaddr_to_socketaddr(address).unwrap()) - .filter_map(|address| { - if RawAddr::from(address).is_reachable() || address.ip().is_unspecified() { - Some(address.port()) - } else { - None - } - }) + .map(|address| multiaddr_to_socketaddr(address).unwrap().port()) .nth(0) } else { None diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index ce4f27b6..2d314f05 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tentacle-identify" -version = "0.2.7" +version = "0.2.8" authors = ["Qian Linfeng "] license = "MIT" description = "p2p identify protocol" @@ -15,7 +15,7 @@ all-features = false no-default-features = true [dependencies] -p2p = { path = "../..", version = "0.2.4", package = "tentacle" } +p2p = { path = "../..", version = "0.2.5", package = "tentacle" } bytes = "0.4" flatbuffers = { version = "0.6.0", optional = true } flatbuffers-verifier = { version = "0.2.0", optional = true } diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 097e32ac..79e503ba 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tentacle-ping" -version = "0.3.6" +version = "0.3.7" authors = ["Nervos Core Dev "] license = "MIT" keywords = ["network", "peer-to-peer", "p2p", "ping"] @@ -15,7 +15,7 @@ all-features = false no-default-features = true [dependencies] -p2p = { path = "../..", version = "0.2.4", package = "tentacle" } +p2p = { path = "../..", version = "0.2.5", package = "tentacle" } log = "0.4" flatbuffers = { version = "0.6.0", optional = true } flatbuffers-verifier = { version = "0.2.0", optional = true } diff --git a/secio/Cargo.toml b/secio/Cargo.toml index 874064ae..d64ed1be 100644 --- a/secio/Cargo.toml +++ b/secio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tentacle-secio" -version = "0.1.10" +version = "0.1.11" license = "MIT" description = "Secio encryption protocol for p2p" authors = ["piaoliu <441594700@qq.com>", "Nervos Core Dev "]