Skip to content

Commit

Permalink
Merge latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
AgeManning committed Dec 7, 2020
2 parents 82be02d + 505a17d commit d612712
Show file tree
Hide file tree
Showing 82 changed files with 1,582 additions and 911 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,45 @@ jobs:

- uses: actions/checkout@v2

- name: Install nightly Rust
# TODO: intra-doc links are available on nightly only
# see https://doc.rust-lang.org/nightly/rustdoc/lints.html#intra_doc_link_resolution_failure
run: rustup default nightly-2020-09-17

- name: Check rustdoc links
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items

check-clippy:
runs-on: ubuntu-latest
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy

- name: Cache CARGO_HOME
uses: actions/cache@v2
with:
path: ~/.cargo
key: cargo-home-${{ hashFiles('Cargo.toml') }}

- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -A clippy::mutable_key_type -A clippy::type_complexity

integration-test:
name: Integration tests
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@
- [`parity-multiaddr` CHANGELOG](misc/multiaddr/CHANGELOG.md)
- [`libp2p-core-derive` CHANGELOG](misc/core-derive/CHANGELOG.md)

# Version 0.32.0 [unreleased]

- Update to `libp2p-mdns-0.26`.

# Version 0.31.2 [2020-12-02]

- Bump minimum `libp2p-core` patch version.

# Version 0.31.1 [2020-11-26]

- Bump minimum `libp2p-tcp` patch version.

# Version 0.31.0 [2020-11-25]

- Update `multistream-select` and all dependent crates.

# Version 0.30.1 [2020-11-11]

- Update `libp2p-plaintext`.
Expand Down
19 changes: 9 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "libp2p"
edition = "2018"
description = "Peer-to-peer networking library"
version = "0.30.1"
version = "0.32.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -17,7 +17,7 @@ default = [
"identify",
"kad",
"gossipsub",
"mdns-async-std",
"mdns",
"mplex",
"noise",
"ping",
Expand All @@ -37,8 +37,7 @@ floodsub = ["libp2p-floodsub"]
identify = ["libp2p-identify"]
kad = ["libp2p-kad"]
gossipsub = ["libp2p-gossipsub"]
mdns-async-std = ["libp2p-mdns", "libp2p-mdns/async-std"]
mdns-tokio = ["libp2p-mdns", "libp2p-mdns/tokio"]
mdns = ["libp2p-mdns"]
mplex = ["libp2p-mplex"]
noise = ["libp2p-noise"]
ping = ["libp2p-ping"]
Expand All @@ -62,8 +61,8 @@ atomic = "0.5.0"
bytes = "0.5"
futures = "0.3.1"
lazy_static = "1.2"
libp2p-core = { version = "0.25.0", path = "core" }
libp2p-core-derive = { version = "0.20.2", path = "misc/core-derive" }
libp2p-core = { version = "0.25.2", path = "core" }
libp2p-core-derive = { version = "0.21.0", path = "misc/core-derive" }
libp2p-floodsub = { version = "0.25.0", path = "protocols/floodsub", optional = true }
libp2p-gossipsub = { version = "0.25.0", path = "./protocols/gossipsub", optional = true }
libp2p-identify = { version = "0.25.0", path = "protocols/identify", optional = true }
Expand All @@ -78,7 +77,7 @@ libp2p-swarm = { version = "0.25.0", path = "swarm" }
libp2p-uds = { version = "0.25.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.25.0", path = "transports/wasm-ext", optional = true }
libp2p-yamux = { version = "0.28.0", path = "muxers/yamux", optional = true }
multiaddr = { package = "parity-multiaddr", version = "0.9.4", path = "misc/multiaddr" }
multiaddr = { package = "parity-multiaddr", version = "0.10.0", path = "misc/multiaddr" }
parking_lot = "0.11.0"
pin-project = "1.0.0"
smallvec = "1.0"
Expand All @@ -87,8 +86,8 @@ wasm-timer = "0.2.4"
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
libp2p-deflate = { version = "0.25.0", path = "protocols/deflate", optional = true }
libp2p-dns = { version = "0.25.0", path = "transports/dns", optional = true }
libp2p-mdns = { version = "0.25.0", path = "protocols/mdns", optional = true }
libp2p-tcp = { version = "0.25.0", path = "transports/tcp", optional = true }
libp2p-mdns = { version = "0.26.0", path = "protocols/mdns", optional = true }
libp2p-tcp = { version = "0.25.1", path = "transports/tcp", optional = true }
libp2p-websocket = { version = "0.26.0", path = "transports/websocket", optional = true }

[dev-dependencies]
Expand Down Expand Up @@ -125,4 +124,4 @@ members = [

[[example]]
name = "chat-tokio"
required-features = ["tcp-tokio", "mdns-tokio"]
required-features = ["tcp-tokio", "mdns"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2017 Parity Technologies (UK) Ltd.
Copyright 2017-2020 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
Expand Down
21 changes: 20 additions & 1 deletion core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# 0.25.0 [unreleased]
# 0.25.2 [2020-12-02]

- Require `multistream-select-0.9.1`.

# 0.25.1 [2020-11-25]

- Add missing multiaddr upgrade.

# 0.25.0 [2020-11-25]

- The `NetworkConfig` API is now a builder that moves `self`.
[PR 1848](https://github.com/libp2p/rust-libp2p/pull/1848/).

- New configurable connection limits for established connections and
dedicated connection counters. Removed the connection limit dedicated
to outgoing pending connection _per peer_. Connection limits are now
represented by `u32` intead of `usize` types.
[PR 1848](https://github.com/libp2p/rust-libp2p/pull/1848/).

- Update `multihash`.

- Update `multistream-select`.

# 0.24.0 [2020-11-09]

- Remove `ConnectionInfo` trait and replace it with `PeerId`
Expand Down
6 changes: 3 additions & 3 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.25.0"
version = "0.25.2"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -21,9 +21,9 @@ futures-timer = "3"
lazy_static = "1.2"
libsecp256k1 = { version = "0.3.1", optional = true }
log = "0.4"
multiaddr = { package = "parity-multiaddr", version = "0.9.4", path = "../misc/multiaddr" }
multiaddr = { package = "parity-multiaddr", version = "0.10.0", path = "../misc/multiaddr" }
multihash = { version = "0.13", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] }
multistream-select = { version = "0.8.5", path = "../misc/multistream-select" }
multistream-select = { version = "0.9.1", path = "../misc/multistream-select" }
parking_lot = "0.11.0"
pin-project = "1.0.0"
prost = "0.6.1"
Expand Down
17 changes: 5 additions & 12 deletions core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub use listeners::{ListenerId, ListenersStream, ListenersEvent};
pub use manager::ConnectionId;
pub use substream::{Substream, SubstreamEndpoint, Close};
pub use pool::{EstablishedConnection, EstablishedConnectionIter, PendingConnection};
pub use pool::{ConnectionLimits, ConnectionCounters};

use crate::muxing::StreamMuxer;
use crate::{Multiaddr, PeerId};
Expand Down Expand Up @@ -62,20 +63,12 @@ impl std::ops::Not for Endpoint {
impl Endpoint {
/// Is this endpoint a dialer?
pub fn is_dialer(self) -> bool {
if let Endpoint::Dialer = self {
true
} else {
false
}
matches!(self, Endpoint::Dialer)
}

/// Is this endpoint a listener?
pub fn is_listener(self) -> bool {
if let Endpoint::Listener = self {
true
} else {
false
}
matches!(self, Endpoint::Listener)
}
}

Expand Down Expand Up @@ -326,9 +319,9 @@ impl<'a> OutgoingInfo<'a> {
#[derive(Debug, Clone)]
pub struct ConnectionLimit {
/// The maximum number of connections.
pub limit: usize,
pub limit: u32,
/// The current number of connections.
pub current: usize,
pub current: u32,
}

impl fmt::Display for ConnectionLimit {
Expand Down
2 changes: 0 additions & 2 deletions core/src/connection/listeners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ use std::{collections::VecDeque, fmt, pin::Pin};
/// # Example
///
/// ```no_run
/// # fn main() {
/// use futures::prelude::*;
/// use libp2p_core::connection::{ListenersEvent, ListenersStream};
///
Expand Down Expand Up @@ -75,7 +74,6 @@ use std::{collections::VecDeque, fmt, pin::Pin};
/// }
/// }
/// })
/// # }
/// ```
pub struct ListenersStream<TTrans>
where
Expand Down
6 changes: 1 addition & 5 deletions core/src/connection/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,7 @@ impl<I, O, H, TE, HE> Manager<I, O, H, TE, HE> {

/// Checks whether an established connection with the given ID is currently managed.
pub fn is_established(&self, id: &ConnectionId) -> bool {
match self.tasks.get(&id.0) {
Some(TaskInfo { state: TaskState::Established(..), .. }) => true,
_ => false
}
matches!(self.tasks.get(&id.0), Some(TaskInfo { state: TaskState::Established(..), .. }))
}

/// Polls the manager for events relating to the managed connections.
Expand Down Expand Up @@ -528,4 +525,3 @@ impl<'a, I> PendingEntry<'a, I> {
self.task.remove();
}
}

Loading

0 comments on commit d612712

Please sign in to comment.