Skip to content

Commit

Permalink
Merge pull request #188 from nervosnetwork/bump-to-0.2.5
Browse files Browse the repository at this point in the history
chore: bump to 0.2.5
  • Loading branch information
driftluo authored Sep 23, 2019
2 parents ac641a0 + 62d0b78 commit f6cf320
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>", "Nervos Core Dev <[email protected]>"]
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions protocols/discovery/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle-discovery"
version = "0.2.6"
version = "0.2.7"
authors = ["Linfeng Qian <[email protected]>"]
license = "MIT"
description = "p2p discovery protocol main reference bitcoin"
Expand All @@ -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"
Expand Down
16 changes: 6 additions & 10 deletions protocols/discovery/src/substream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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::<usize>() % 1000;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions protocols/identify/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle-identify"
version = "0.2.7"
version = "0.2.8"
authors = ["Qian Linfeng <[email protected]>"]
license = "MIT"
description = "p2p identify protocol"
Expand All @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions protocols/ping/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle-ping"
version = "0.3.6"
version = "0.3.7"
authors = ["Nervos Core Dev <[email protected]>"]
license = "MIT"
keywords = ["network", "peer-to-peer", "p2p", "ping"]
Expand All @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion secio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>", "Nervos Core Dev <[email protected]>"]
Expand Down

0 comments on commit f6cf320

Please sign in to comment.