Skip to content

Commit 5c9f947

Browse files
authored
Merge branch 'libp2p:master' into master
2 parents a1f791f + b185946 commit 5c9f947

File tree

241 files changed

+16835
-5976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+16835
-5976
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
steps:
2121

2222
- name: Cancel Previous Runs
23-
uses: styfle/[email protected]
23+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # 0.9.1
2424
with:
2525
access_token: ${{ github.token }}
2626

2727
- uses: actions/[email protected]
2828

29-
- uses: Swatinem/[email protected]
29+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # v1.3.0
3030
with:
3131
key: ${{ matrix.args }}
3232

@@ -44,35 +44,38 @@ jobs:
4444
include:
4545
- toolchain: wasm32-unknown-unknown
4646
args: "--features wasm-bindgen"
47-
container:
48-
image: rust
49-
env:
50-
CC: clang-11
47+
env:
48+
CC: clang-11
49+
defaults:
50+
run:
51+
shell: bash
5152
steps:
5253

5354
- name: Cancel Previous Runs
54-
uses: styfle/[email protected]
55+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # 0.9.1
5556
with:
5657
access_token: ${{ github.token }}
5758

5859
- uses: actions/[email protected]
5960

6061
- name: Install Rust ${{ matrix.toolchain }}
61-
uses: actions-rs/[email protected]
62+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
6263
with:
6364
toolchain: stable
6465
target: ${{ matrix.toolchain }}
6566
override: true
6667

6768
- name: Install a recent version of clang
6869
run: |
69-
apt-get update
70-
apt-get install -y clang-11
70+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
71+
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main"
72+
sudo apt-get update
73+
sudo apt-get install -y clang-11
7174
7275
- name: Install CMake
73-
run: apt-get install -y cmake
76+
run: sudo apt-get install -y cmake
7477

75-
- uses: Swatinem/[email protected]
78+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # v1.3.0
7679
with:
7780
key: ${{ matrix.toolchain }}
7881

@@ -89,39 +92,39 @@ jobs:
8992
steps:
9093

9194
- name: Cancel Previous Runs
92-
uses: styfle/[email protected]
95+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # 0.9.1
9396
with:
9497
access_token: ${{ github.token }}
9598

9699
- uses: actions/[email protected]
97100

98-
- uses: Swatinem/[email protected]
101+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # v1.3.0
99102

100103
- name: Check rustdoc links
101-
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items
104+
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items --all-features
102105

103106
check-clippy:
104107
runs-on: ubuntu-18.04
105108
steps:
106109

107110
- name: Cancel Previous Runs
108-
uses: styfle/[email protected]
111+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # 0.9.1
109112
with:
110113
access_token: ${{ github.token }}
111114

112115
- uses: actions/[email protected]
113116

114-
- uses: actions-rs/[email protected]
117+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
115118
with:
116119
profile: minimal
117120
toolchain: stable
118121
override: true
119122
components: clippy
120123

121-
- uses: Swatinem/[email protected]
124+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # v1.3.0
122125

123126
- name: Run cargo clippy
124-
uses: actions-rs/[email protected]
127+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
125128
with:
126129
command: custom-clippy # cargo alias to allow reuse of config locally
127130

@@ -133,13 +136,13 @@ jobs:
133136
steps:
134137

135138
- name: Cancel Previous Runs
136-
uses: styfle/[email protected]
139+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # 0.9.1
137140
with:
138141
access_token: ${{ github.token }}
139142

140143
- uses: actions/[email protected]
141144

142-
- uses: Swatinem/[email protected]
145+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # v1.3.0
143146

144147
- name: Run ipfs-kad example
145148
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad
@@ -149,13 +152,13 @@ jobs:
149152
steps:
150153

151154
- name: Cancel Previous Runs
152-
uses: styfle/[email protected].0
155+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # 0.9.1
153156
with:
154157
access_token: ${{ github.token }}
155158

156159
- uses: actions/[email protected]
157160

158-
- uses: actions-rs/[email protected]
161+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
159162
with:
160163
profile: minimal
161164
toolchain: stable

CHANGELOG.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,100 @@
4242

4343
# `libp2p` facade crate
4444

45-
## Version 0.42.0 [unreleased]
45+
## Version 0.43.0 [2022-02-22]
4646

4747
- Update individual crates.
48+
- Update to `libp2p-autonat` [`v0.2.0`](protocols/autonat/CHANGELOG.md#020-2022-02-22).
49+
- Update to `libp2p-core` [`v0.32.0`](core/CHANGELOG.md#0320-2022-02-22).
50+
- Update to `libp2p-deflate` [`v0.32.0`](transports/deflate/CHANGELOG.md#0320-2022-02-22).
51+
- Update to `libp2p-dns` [`v0.32.0`](transports/dns/CHANGELOG.md#0320-2022-02-22).
52+
- Update to `libp2p-floodsub` [`v0.34.0`](protocols/floodsub/CHANGELOG.md#0340-2022-02-22).
53+
- Update to `libp2p-gossipsub` [`v0.36.0`](protocols/gossipsub/CHANGELOG.md#0360-2022-02-22).
54+
- Update to `libp2p-identify` [`v0.34.0`](protocols/identify/CHANGELOG.md#0340-2022-02-22).
55+
- Update to `libp2p-kad` [`v0.35.0`](protocols/kad/CHANGELOG.md#0350-2022-02-22).
56+
- Update to `libp2p-mdns` [`v0.35.0`](protocols/mdns/CHANGELOG.md#0350-2022-02-22).
57+
- Update to `libp2p-metrics` [`v0.4.0`](misc/metrics/CHANGELOG.md#040-2022-02-22).
58+
- Update to `libp2p-mplex` [`v0.32.0`](muxers/mplex/CHANGELOG.md#0320-2022-02-22).
59+
- Update to `libp2p-noise` [`v0.35.0`](transports/noise/CHANGELOG.md#0350-2022-02-22).
60+
- Update to `libp2p-ping` [`v0.34.0`](protocols/ping/CHANGELOG.md#0340-2022-02-22).
61+
- Update to `libp2p-plaintext` [`v0.32.0`](transports/plaintext/CHANGELOG.md#0320-2022-02-22).
62+
- Update to `libp2p-relay` [`v0.7.0`](protocols/relay/CHANGELOG.md#070-2022-02-22).
63+
- Update to `libp2p-rendezvous` [`v0.4.0`](protocols/rendezvous/CHANGELOG.md#040-2022-02-22).
64+
- Update to `libp2p-request-response` [`v0.16.0`](protocols/request-response/CHANGELOG.md#0160-2022-02-22).
65+
- Update to `libp2p-swarm` [`v0.34.0`](swarm/CHANGELOG.md#0340-2022-02-22).
66+
- Update to `libp2p-derive` [`v0.27.0`](swarm-derive/CHANGELOG.md#0270-2022-02-22).
67+
- Update to `libp2p-tcp` [`v0.32.0`](transports/tcp/CHANGELOG.md#0320-2022-02-22).
68+
- Update to `libp2p-uds` [`v0.32.0`](transports/uds/CHANGELOG.md#0320-2022-02-22).
69+
- Update to `libp2p-wasm-ext` [`v0.32.0`](transports/wasm-ext/CHANGELOG.md#0320-2022-02-22).
70+
- Update to `libp2p-websocket` [`v0.34.0`](transports/websocket/CHANGELOG.md#0340-2022-02-22).
71+
- Update to `libp2p-yamux` [`v0.36.0`](muxers/yamux/CHANGELOG.md#0360-2022-02-22).
72+
73+
- Update to `parking_lot` `v0.12.0`. See [PR 2463].
74+
75+
- Drop support for gossipsub in the wasm32-unknown-unknown target (see [PR 2506]).
76+
77+
[PR 2506]: https://github.com/libp2p/rust-libp2p/pull/2506
78+
[PR 2463]: https://github.com/libp2p/rust-libp2p/pull/2463/
79+
80+
## Version 0.42.1 [2022-02-02]
81+
82+
- Update individual crates.
83+
- `libp2p-relay`
84+
- [v0.6.1](protocols/relay/CHANGELOG.md#061-2022-02-02)
85+
- `libp2p-tcp`
86+
- [v0.31.1](transports/tcp/CHANGELOG.md#0311-2022-02-02)
87+
88+
## Version 0.42.0 [2022-01-27]
89+
90+
- Update individual crates.
91+
- `libp2p-autonat`
92+
- [v0.1.0](protocols/autonat/CHANGELOG.md#010-2022-01-27)
4893
- `libp2p-core`
94+
- [v0.31.0](core/CHANGELOG.md#0310-2022-01-27)
4995
- `libp2p-deflate`
96+
- [v0.31.0](transports/deflate/CHANGELOG.md#0310-2022-01-27)
5097
- `libp2p-dns`
98+
- [v0.31.0](transports/dns/CHANGELOG.md#0310-2022-01-27)
5199
- `libp2p-floodsub`
100+
- [v0.33.0](protocols/floodsub/CHANGELOG.md#0330-2022-01-27)
52101
- `libp2p-gossipsub`
102+
- [v0.35.0](protocols/gossipsub/CHANGELOG.md#0350-2022-01-27)
53103
- `libp2p-identify`
104+
- [v0.33.0](protocols/identify/CHANGELOG.md#0330-2022-01-27)
54105
- `libp2p-kad`
55-
- `libp2p-mdns`
106+
- [v0.34.0](protocols/kad/CHANGELOG.md#0340-2022-01-27)
107+
- `libp2p-mdns` (breaking compatibility with previous versions)
108+
- [v0.34.0](protocols/mdns/CHANGELOG.md#0340-2022-01-27)
56109
- `libp2p-metrics`
110+
- [v0.3.0](misc/metrics/CHANGELOG.md#030-2022-01-27)
57111
- `libp2p-mplex`
112+
- [v0.31.0](muxers/mplex/CHANGELOG.md#0310-2022-01-27)
58113
- `libp2p-noise`
114+
- [v0.34.0](transports/noise/CHANGELOG.md#0340-2022-01-27)
59115
- `libp2p-ping`
116+
- [v0.33.0](protocols/ping/CHANGELOG.md#0330-2022-01-27)
60117
- `libp2p-plaintext`
118+
- [v0.31.0](transports/plaintext/CHANGELOG.md#0310-2022-01-27)
61119
- `libp2p-relay`
120+
- [v0.6.0](protocols/relay/CHANGELOG.md#060-2022-01-27)
62121
- `libp2p-rendezvous`
122+
- [v0.3.0](protocols/rendezvous/CHANGELOG.md#030-2022-01-27)
63123
- `libp2p-request-response`
124+
- [v0.15.0](protocols/request-response/CHANGELOG.md#0150-2022-01-27)
64125
- `libp2p-swarm-derive`
126+
- [v0.26.1](swarm-derive/CHANGELOG.md#0261-2022-01-27)
65127
- `libp2p-swarm`
128+
- [v0.33.0](swarm/CHANGELOG.md#0330-2022-01-27)
66129
- `libp2p-tcp`
130+
- [v0.31.0](transports/tcp/CHANGELOG.md#0310-2022-01-27)
67131
- `libp2p-uds`
132+
- [v0.31.0](transports/uds/CHANGELOG.md#0310-2022-01-27)
68133
- `libp2p-wasm-ext`
134+
- [v0.31.0](transports/wasm-ext/CHANGELOG.md#0310-2022-01-27)
69135
- `libp2p-websocket`
136+
- [v0.33.0](transports/websocket/CHANGELOG.md#0330-2022-01-27)
70137
- `libp2p-yamux`
71-
- `libp2p-mdns` (breaking compatibility with previous versions)
138+
- [v0.35.0](muxers/yamux/CHANGELOG.md#0350-2022-01-27)
72139

73140
- Migrate to Rust edition 2021 (see [PR 2339]).
74141

Cargo.toml

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p"
33
edition = "2021"
44
rust-version = "1.56.1"
55
description = "Peer-to-peer networking library"
6-
version = "0.42.0"
6+
version = "0.43.0"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"
@@ -12,6 +12,7 @@ categories = ["network-programming", "asynchronous"]
1212

1313
[features]
1414
default = [
15+
"autonat",
1516
"deflate",
1617
"dns-async-std",
1718
"floodsub",
@@ -34,6 +35,8 @@ default = [
3435
"websocket",
3536
"yamux",
3637
]
38+
autonat = ["libp2p-autonat"]
39+
dcutr = ["libp2p-dcutr", "libp2p-metrics/dcutr"]
3740
deflate = ["libp2p-deflate"]
3841
dns-async-std = ["libp2p-dns", "libp2p-dns/async-std"]
3942
dns-tokio = ["libp2p-dns", "libp2p-dns/tokio"]
@@ -48,18 +51,19 @@ noise = ["libp2p-noise"]
4851
ping = ["libp2p-ping", "libp2p-metrics/ping"]
4952
plaintext = ["libp2p-plaintext"]
5053
pnet = ["libp2p-pnet"]
51-
relay = ["libp2p-relay"]
54+
relay = ["libp2p-relay", "libp2p-metrics/relay"]
5255
request-response = ["libp2p-request-response"]
5356
rendezvous = ["libp2p-rendezvous"]
5457
tcp-async-io = ["libp2p-tcp", "libp2p-tcp/async-io"]
5558
tcp-tokio = ["libp2p-tcp", "libp2p-tcp/tokio"]
5659
uds = ["libp2p-uds"]
57-
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "parking_lot/wasm-bindgen", "getrandom/js", "rand/wasm-bindgen"]
60+
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "rand/wasm-bindgen"]
5861
wasm-ext = ["libp2p-wasm-ext"]
5962
wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext/websocket"]
6063
websocket = ["libp2p-websocket"]
6164
yamux = ["libp2p-yamux"]
6265
secp256k1 = ["libp2p-core/secp256k1"]
66+
serde = ["libp2p-core/serde", "libp2p-kad/serde", "libp2p-gossipsub/serde"]
6367

6468
[package.metadata.docs.rs]
6569
all-features = true
@@ -72,44 +76,49 @@ futures-timer = "3.0.2" # Explicit dependency to be used in `wasm-bindgen` featu
7276
getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature
7377
instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature
7478
lazy_static = "1.2"
75-
libp2p-core = { version = "0.31.0", path = "core", default-features = false }
76-
libp2p-floodsub = { version = "0.33.0", path = "protocols/floodsub", optional = true }
77-
libp2p-gossipsub = { version = "0.35.0", path = "./protocols/gossipsub", optional = true }
78-
libp2p-identify = { version = "0.33.0", path = "protocols/identify", optional = true }
79-
libp2p-kad = { version = "0.34.0", path = "protocols/kad", optional = true }
80-
libp2p-metrics = { version = "0.3.0", path = "misc/metrics", optional = true }
81-
libp2p-mplex = { version = "0.31.0", path = "muxers/mplex", optional = true }
82-
libp2p-noise = { version = "0.34.0", path = "transports/noise", optional = true }
83-
libp2p-ping = { version = "0.33.0", path = "protocols/ping", optional = true }
84-
libp2p-plaintext = { version = "0.31.0", path = "transports/plaintext", optional = true }
79+
80+
libp2p-autonat = { version = "0.2.0", path = "protocols/autonat", optional = true }
81+
libp2p-core = { version = "0.32.0", path = "core", default-features = false }
82+
libp2p-dcutr = { version = "0.1.0", path = "protocols/dcutr", optional = true }
83+
libp2p-floodsub = { version = "0.34.0", path = "protocols/floodsub", optional = true }
84+
libp2p-identify = { version = "0.34.0", path = "protocols/identify", optional = true }
85+
libp2p-kad = { version = "0.35.0", path = "protocols/kad", optional = true }
86+
libp2p-metrics = { version = "0.4.0", path = "misc/metrics", optional = true }
87+
libp2p-mplex = { version = "0.32.0", path = "muxers/mplex", optional = true }
88+
libp2p-noise = { version = "0.35.0", path = "transports/noise", optional = true }
89+
libp2p-ping = { version = "0.34.0", path = "protocols/ping", optional = true }
90+
libp2p-plaintext = { version = "0.32.0", path = "transports/plaintext", optional = true }
8591
libp2p-pnet = { version = "0.22.0", path = "transports/pnet", optional = true }
86-
libp2p-relay = { version = "0.6.0", path = "protocols/relay", optional = true }
87-
libp2p-rendezvous = { version = "0.3.0", path = "protocols/rendezvous", optional = true }
88-
libp2p-request-response = { version = "0.15.0", path = "protocols/request-response", optional = true }
89-
libp2p-swarm = { version = "0.33.0", path = "swarm" }
90-
libp2p-swarm-derive = { version = "0.26.1", path = "swarm-derive" }
91-
libp2p-uds = { version = "0.31.0", path = "transports/uds", optional = true }
92-
libp2p-wasm-ext = { version = "0.31.0", path = "transports/wasm-ext", default-features = false, optional = true }
93-
libp2p-yamux = { version = "0.35.0", path = "muxers/yamux", optional = true }
94-
multiaddr = { version = "0.13.0" }
95-
parking_lot = "0.11.0"
92+
libp2p-relay = { version = "0.7.0", path = "protocols/relay", optional = true }
93+
libp2p-rendezvous = { version = "0.4.0", path = "protocols/rendezvous", optional = true }
94+
libp2p-request-response = { version = "0.16.0", path = "protocols/request-response", optional = true }
95+
libp2p-swarm = { version = "0.34.0", path = "swarm" }
96+
libp2p-swarm-derive = { version = "0.27.0", path = "swarm-derive" }
97+
libp2p-uds = { version = "0.32.0", path = "transports/uds", optional = true }
98+
libp2p-wasm-ext = { version = "0.32.0", path = "transports/wasm-ext", default-features = false, optional = true }
99+
libp2p-yamux = { version = "0.36.0", path = "muxers/yamux", optional = true }
100+
multiaddr = { version = "0.14.0" }
101+
parking_lot = "0.12.0"
96102
pin-project = "1.0.0"
97103
rand = "0.7.3" # Explicit dependency to be used in `wasm-bindgen` feature
98104
smallvec = "1.6.1"
99105

100106
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
101-
libp2p-deflate = { version = "0.31.0", path = "transports/deflate", optional = true }
102-
libp2p-dns = { version = "0.31.0", path = "transports/dns", optional = true, default-features = false }
103-
libp2p-mdns = { version = "0.34.0", path = "protocols/mdns", optional = true }
104-
libp2p-tcp = { version = "0.31.0", path = "transports/tcp", default-features = false, optional = true }
105-
libp2p-websocket = { version = "0.33.0", path = "transports/websocket", optional = true }
107+
libp2p-deflate = { version = "0.32.0", path = "transports/deflate", optional = true }
108+
libp2p-dns = { version = "0.32.0", path = "transports/dns", optional = true, default-features = false }
109+
libp2p-mdns = { version = "0.35.0", path = "protocols/mdns", optional = true }
110+
libp2p-tcp = { version = "0.32.0", path = "transports/tcp", default-features = false, optional = true }
111+
libp2p-websocket = { version = "0.34.0", path = "transports/websocket", optional = true }
112+
113+
[target.'cfg(not(target_os = "unknown"))'.dependencies]
114+
libp2p-gossipsub = { version = "0.36.0", path = "protocols/gossipsub", optional = true }
106115

107116
[dev-dependencies]
108117
async-std = { version = "1.6.2", features = ["attributes"] }
109118
async-trait = "0.1"
110119
env_logger = "0.9.0"
111120
structopt = "0.3.21"
112-
tokio = { version = "1.0.1", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }
121+
tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }
113122

114123
[workspace]
115124
members = [
@@ -119,6 +128,8 @@ members = [
119128
"misc/peer-id-generator",
120129
"muxers/mplex",
121130
"muxers/yamux",
131+
"protocols/dcutr",
132+
"protocols/autonat",
122133
"protocols/floodsub",
123134
"protocols/gossipsub",
124135
"protocols/rendezvous",

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ This repository is the central place for Rust development of the [libp2p](https:
2424
- For **discussions and questions related to multiple libp2p implementations**
2525
please use the libp2p _Discourse_ forum https://discuss.libp2p.io.
2626

27+
- For general project updates and discussions join the [biweekly libp2p Community
28+
Calls](https://discuss.libp2p.io/t/libp2p-community-calls/1157).
29+
2730
## Repository Structure
2831

2932
The main components of this repository are structured as follows:
@@ -40,7 +43,7 @@ The main components of this repository are structured as follows:
4043
Multiplexing protocols are (mandatory) `Transport` upgrades.
4144

4245
* `swarm/`: The implementation of `libp2p-swarm` building on `libp2p-core`
43-
with the central interfaces `NetworkBehaviour` and `ProtocolsHandler` used
46+
with the central interfaces `NetworkBehaviour` and `ConnectionHandler` used
4447
to implement application protocols (see `protocols/`).
4548

4649
* `protocols/`: Implementations of application protocols based on the

0 commit comments

Comments
 (0)