Skip to content

Commit

Permalink
Merge branch 'master' of github.com:libp2p/rust-libp2p into behaviour…
Browse files Browse the repository at this point in the history
…-on-event
  • Loading branch information
jxs committed Oct 11, 2022
2 parents 09ca723 + 31a45f2 commit af7cf9b
Show file tree
Hide file tree
Showing 180 changed files with 8,322 additions and 7,751 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[alias]
# Temporary solution to have clippy config in a single place until https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md#lintstoml-configuration is shipped.
custom-clippy = "clippy --all-features --all-targets -- -A clippy::type_complexity -A clippy::pedantic -D warnings"
custom-clippy = "clippy --workspace --all-features --all-targets -- -A clippy::type_complexity -A clippy::pedantic -D warnings"
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0

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

check-clippy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0

- name: Run ipfs-kad example
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad --features full

rustfmt:
runs-on: ubuntu-latest
Expand All @@ -187,3 +187,30 @@ jobs:

- name: Check formatting
run: cargo fmt -- --check

manifest_lint:
runs-on: ubuntu-latest
steps:

- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3

- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true

- name: Ensure `full` feature contains all features
run: |
ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")')
FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")')
echo "$ALL_FEATURES";
echo "$FULL_FEATURE";
test "$ALL_FEATURES" = "$FULL_FEATURE"
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Close and mark stale issue

on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-issue-label: 'kind/stale'
any-of-labels: 'need/author-input'
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
days-before-issue-stale: 6
days-before-issue-close: 7
enable-statistics: true
47 changes: 41 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,48 @@

# 0.49.0 - [unreleased]

- Update to [`libp2p-tcp` `v0.37.0`](transports/tcp/CHANGELOG.md#0370).
- Remove default features. You need to enable required features explicitly now. As a quick workaround, you may want to use the
new `full` feature which activates all features. See [PR 2918].

- Introduce `tokio` and `async-std` features and deprecate the following ones:
- `tcp-tokio` in favor of `tcp` + `tokio`
- `mdns-tokio` in favor of `mdns` + `tokio`
- `dns-tokio` in favor of `dns` + `tokio`
- `tcp-async-io` in favor of `tcp` + `async-std`
- `mdns-async-io` in favor of `mdns` + `async-std`
- `dns-async-std` in favor of `dns` + `async-std`

See [PR 2962].

- Update to [`libp2p-swarm-derive` `v0.30.1`](swarm-derive/CHANGELOG.md#0301).

- Update to [`libp2p-metrics` `v0.10.0`](misc/metrics/CHANGELOG.md#0100).

- Update to [`libp2p-kad` `v0.41.0`](protocols/kad/CHANGELOG.md#0410).
- Update individual crates.
- Update to [`libp2p-autonat` `v0.8.0`](protocols/autonat/CHANGELOG.md#0080).
- Update to [`libp2p-core` `v0.37.0`](core/CHANGELOG.md#0370).
- Update to [`libp2p-dcutr` `v0.7.0`](protocols/dcutr/CHANGELOG.md#0070).
- Update to [`libp2p-deflate` `v0.37.0`](transports/deflate/CHANGELOG.md#0370).
- Update to [`libp2p-dns` `v0.37.0`](transports/dns/CHANGELOG.md#0370).
- Update to [`libp2p-floodsub` `v0.40.0`](protocols/floodsub/CHANGELOG.md#0400).
- Update to [`libp2p-gossipsub` `v0.42.0`](protocols/gossipsub/CHANGELOG.md#0420).
- Update to [`libp2p-identify` `v0.40.0`](protocols/identify/CHANGELOG.md#0400).
- Update to [`libp2p-kad` `v0.41.0`](protocols/kad/CHANGELOG.md#0410).
- Update to [`libp2p-mdns` `v0.41.0`](protocols/mdns/CHANGELOG.md#0410).
- Update to [`libp2p-metrics` `v0.10.0`](misc/metrics/CHANGELOG.md#0100).
- Update to [`libp2p-mplex` `v0.37.0`](muxers/mplex/CHANGELOG.md#0370).
- Update to [`libp2p-noise` `v0.40.0`](transports/noise/CHANGELOG.md#0400).
- Update to [`libp2p-ping` `v0.40.0`](protocols/ping/CHANGELOG.md#0400).
- Update to [`libp2p-plaintext` `v0.37.0`](transports/plaintext/CHANGELOG.md#0370).
- Update to [`libp2p-relay` `v0.13.0`](protocols/relay/CHANGELOG.md#0130).
- Update to [`libp2p-rendezvous` `v0.10.0`](protocols/rendezovus/CHANGELOG.md#0100).
- Update to [`libp2p-request-response` `v0.22.0`](protocols/request-response/CHANGELOG.md#0220).
- Update to [`libp2p-swarm-derive` `v0.30.1`](swarm-derive/CHANGELOG.md#0301).
- Update to [`libp2p-swarm` `v0.40.0`](swarm/CHANGELOG.md#0400).
- Update to [`libp2p-tcp` `v0.37.0`](transports/tcp/CHANGELOG.md#0370).
- Update to [`libp2p-uds` `v0.36.0`](transports/uds/CHANGELOG.md#0360).
- Update to [`libp2p-wasm-ext` `v0.37.0`](transports/wasm-ext/CHANGELOG.md#0370).
- Update to [`libp2p-websocket` `v0.39.0`](transports/websocket/CHANGELOG.md#0390).
- Update to [`libp2p-yamux` `v0.41.0`](muxers/mplex/CHANGELOG.md#0410).

[PR 2918]: https://github.com/libp2p/rust-libp2p/pull/2918
[PR 2962]: https://github.com/libp2p/rust-libp2p/pull/2962

# 0.48.0

Expand Down
105 changes: 70 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,57 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[features]
default = [
full = [
"async-std",
"autonat",
"dcutr",
"deflate",
"dns",
"dns-async-std",
"dns-tokio",
"ecdsa",
"floodsub",
"gossipsub",
"identify",
"kad",
"gossipsub",
"mdns",
"mdns-async-io",
"mdns-tokio",
"metrics",
"mplex",
"noise",
"ping",
"plaintext",
"pnet",
"relay",
"request-response",
"rendezvous",
"request-response",
"rsa",
"secp256k1",
"serde",
"tcp",
"tcp-async-io",
"tcp-tokio",
"tokio",
"uds",
"wasm-bindgen",
"wasm-ext",
"wasm-ext-websocket",
"websocket",
"yamux",
]

autonat = ["dep:libp2p-autonat"]
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
deflate = ["dep:libp2p-deflate"]
dns = ["dep:libp2p-dns"]
dns-async-std = ["dep:libp2p-dns", "libp2p-dns?/async-std"]
dns-tokio = ["dep:libp2p-dns", "libp2p-dns?/tokio"]
floodsub = ["dep:libp2p-floodsub"]
identify = ["dep:libp2p-identify", "libp2p-metrics?/identify"]
kad = ["dep:libp2p-kad", "libp2p-metrics?/kad"]
gossipsub = ["dep:libp2p-gossipsub", "libp2p-metrics?/gossipsub"]
metrics = ["dep:libp2p-metrics"]
mdns = ["dep:libp2p-mdns"]
mdns-async-io = ["dep:libp2p-mdns", "libp2p-mdns?/async-io"]
mdns-tokio = ["dep:libp2p-mdns", "libp2p-mdns?/tokio"]
mplex = ["dep:libp2p-mplex"]
Expand All @@ -57,17 +72,21 @@ pnet = ["dep:libp2p-pnet"]
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
request-response = ["dep:libp2p-request-response"]
rendezvous = ["dep:libp2p-rendezvous"]
tcp = ["dep:libp2p-tcp"]
tcp-async-io = ["dep:libp2p-tcp", "libp2p-tcp?/async-io"]
tcp-tokio = ["dep:libp2p-tcp", "libp2p-tcp?/tokio"]
uds = ["dep:libp2p-uds"]
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "rand/wasm-bindgen"]
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js"]
wasm-ext = ["dep:libp2p-wasm-ext"]
wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"]
websocket = ["dep:libp2p-websocket"]
yamux = ["dep:libp2p-yamux"]
secp256k1 = ["libp2p-core/secp256k1"]
rsa = ["libp2p-core/rsa"]
ecdsa = ["libp2p-core/ecdsa"]
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
tokio = ["libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio"]
async-std = ["libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std"]

[package.metadata.docs.rs]
all-features = true
Expand All @@ -80,47 +99,46 @@ getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature
instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature
lazy_static = "1.2"

libp2p-autonat = { version = "0.7.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.36.0", path = "core", default-features = false }
libp2p-dcutr = { version = "0.6.0", path = "protocols/dcutr", optional = true }
libp2p-floodsub = { version = "0.39.0", path = "protocols/floodsub", optional = true }
libp2p-identify = { version = "0.39.0", path = "protocols/identify", optional = true }
libp2p-autonat = { version = "0.8.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.37.0", path = "core" }
libp2p-dcutr = { version = "0.7.0", path = "protocols/dcutr", optional = true }
libp2p-floodsub = { version = "0.40.1", path = "protocols/floodsub", optional = true }
libp2p-identify = { version = "0.40.0", path = "protocols/identify", optional = true }
libp2p-kad = { version = "0.41.0", path = "protocols/kad", optional = true }
libp2p-metrics = { version = "0.10.0", path = "misc/metrics", optional = true }
libp2p-mplex = { version = "0.36.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.39.1", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.39.0", path = "protocols/ping", optional = true }
libp2p-plaintext = { version = "0.36.0", path = "transports/plaintext", optional = true }
libp2p-pnet = { version = "0.22.0", path = "transports/pnet", optional = true }
libp2p-relay = { version = "0.12.0", path = "protocols/relay", optional = true }
libp2p-rendezvous = { version = "0.9.0", path = "protocols/rendezvous", optional = true }
libp2p-request-response = { version = "0.21.0", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.39.0", path = "swarm" }
libp2p-mplex = { version = "0.37.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.40.0", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.40.1", path = "protocols/ping", optional = true }
libp2p-plaintext = { version = "0.37.0", path = "transports/plaintext", optional = true }
libp2p-pnet = { version = "0.22.1", path = "transports/pnet", optional = true }
libp2p-relay = { version = "0.13.0", path = "protocols/relay", optional = true }
libp2p-rendezvous = { version = "0.10.0", path = "protocols/rendezvous", optional = true }
libp2p-request-response = { version = "0.22.1", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.40.1", path = "swarm" }
libp2p-swarm-derive = { version = "0.30.1", path = "swarm-derive" }
libp2p-uds = { version = "0.35.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.36.0", path = "transports/wasm-ext", default-features = false, optional = true }
libp2p-yamux = { version = "0.40.0", path = "muxers/yamux", optional = true }
libp2p-uds = { version = "0.36.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.37.0", path = "transports/wasm-ext", optional = true }
libp2p-yamux = { version = "0.41.0", path = "muxers/yamux", optional = true }
multiaddr = { version = "0.14.0" }
parking_lot = "0.12.0"
pin-project = "1.0.0"
rand = "0.7.3" # Explicit dependency to be used in `wasm-bindgen` feature
smallvec = "1.6.1"

[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
libp2p-deflate = { version = "0.36.0", path = "transports/deflate", optional = true }
libp2p-dns = { version = "0.36.0", path = "transports/dns", optional = true, default-features = false }
libp2p-mdns = { version = "0.40.0", path = "protocols/mdns", optional = true, default-features = false }
libp2p-tcp = { version = "0.37.0", path = "transports/tcp", default-features = false, optional = true }
libp2p-websocket = { version = "0.38.0", path = "transports/websocket", optional = true }
libp2p-deflate = { version = "0.37.0", path = "transports/deflate", optional = true }
libp2p-dns = { version = "0.37.0", path = "transports/dns", optional = true }
libp2p-mdns = { version = "0.41.0", path = "protocols/mdns", optional = true }
libp2p-tcp = { version = "0.37.0", path = "transports/tcp", optional = true }
libp2p-websocket = { version = "0.39.0", path = "transports/websocket", optional = true }

[target.'cfg(not(target_os = "unknown"))'.dependencies]
libp2p-gossipsub = { version = "0.41.0", path = "protocols/gossipsub", optional = true }
libp2p-gossipsub = { version = "0.42.1", path = "protocols/gossipsub", optional = true }

[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.9.0"
clap = {version = "3.1.6", features = ["derive"]}
clap = { version = "3.1.6", features = ["derive"] }
tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }

[workspace]
Expand All @@ -131,6 +149,7 @@ members = [
"misc/rw-stream-sink",
"misc/keygen",
"misc/prost-codec",
"misc/quickcheck-ext",
"muxers/mplex",
"muxers/yamux",
"protocols/dcutr",
Expand Down Expand Up @@ -159,20 +178,36 @@ members = [

[[example]]
name = "chat"
required-features = ["floodsub"]
required-features = ["full"]

[[example]]
name = "chat-tokio"
required-features = ["tcp-tokio", "mdns-tokio"]
required-features = ["full"]

[[example]]
name = "file-sharing"
required-features = ["request-response"]
required-features = ["full"]

[[example]]
name = "gossipsub-chat"
required-features = ["gossipsub"]
required-features = ["full"]

[[example]]
name = "ipfs-private"
required-features = ["gossipsub"]
required-features = ["full"]

[[example]]
name = "ipfs-kad"
required-features = ["full"]

[[example]]
name = "ping"
required-features = ["full"]

[[example]]
name = "mdns-passive-discovery"
required-features = ["full"]

[[example]]
name = "distributed-key-value-store"
required-features = ["full"]
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

(open a pull request if you want your project to be added here)

- https://github.com/paritytech/polkadot
- https://github.com/paritytech/substrate
- https://github.com/sigp/lighthouse
- https://github.com/golemfactory/golem-libp2p
- https://github.com/comit-network
- https://github.com/rs-ipfs/rust-ipfs
- https://github.com/marcopoloprotocol/marcopolo
- https://github.com/ChainSafe/forest
- https://github.com/ipfs-rust/ipfs-embed
- https://www.actyx.com/developers/
- https://github.com/starcoinorg/starcoin
- [COMIT](https://github.com/comit-network/xmr-btc-swap) - Bitcoin–Monero Cross-chain Atomic Swap.
- [Forest](https://github.com/ChainSafe/forest) - An implementation of Filecoin written in Rust.
- [ipfs-embed](https://github.com/ipfs-rust/ipfs-embed) - A small embeddable ipfs implementation
used and maintained by [Actyx][https://www.actyx.com].
- [iroh](https://github.com/n0-computer/iroh) - Next-generation implementation of IPFS for Cloud & Mobile platforms.
- [Lighthouse](https://github.com/sigp/lighthouse) - Ethereum consensus client in Rust.
- [Locutus](https://github.com/freenet/locutus) - Global, observable, decentralized key-value store.
- [rust-ipfs](https://github.com/rs-ipfs/rust-ipfs) - IPFS implementation in Rust.
- [Starcoin](https://github.com/starcoinorg/starcoin) - A smart contract blockchain network that scales by layering.
- [Subspace](https://github.com/subspace/subspace) - Subspace Network reference implementation
- [Substrate](https://github.com/paritytech/substrate) - Framework for blockchain innovation,
used by [Polkadot](https://www.parity.io/technologies/polkadot/).
10 changes: 10 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 0.37.0 [unreleased]

- Implement `Hash` and `Ord` for `PublicKey`. See [PR 2915].

- Remove default features. If you previously depended on `secp256k1` or `ecdsa` you need to enable these explicitly
now. See [PR 2918].

[PR 2915]: https://github.com/libp2p/rust-libp2p/pull/2915
[PR 2918]: https://github.com/libp2p/rust-libp2p/pull/2918

# 0.36.0

- Make RSA keypair support optional. To enable RSA support, `rsa` feature should be enabled.
Expand Down
Loading

0 comments on commit af7cf9b

Please sign in to comment.