Skip to content

Commit ec2b771

Browse files
altonenark0f
authored andcommitted
Move bitswap to its own crate (paritytech#12242)
* Introduce `sc-network-bitswap` Move the bitswap protocol out of `sc-network` to its own crate. * Improve test coverage * Remove mention of bitswap from `sc-network` * Fix documentation * Fix clippy and remove the void dependency * Remove unneeded trait bound and bump prost to 0.11
1 parent 450cc38 commit ec2b771

17 files changed

+708
-494
lines changed

Cargo.lock

+115-37
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ members = [
4343
"client/keystore",
4444
"client/network",
4545
"client/network-gossip",
46+
"client/network/bitswap",
4647
"client/network/common",
4748
"client/network/light",
4849
"client/network/sync",

client/network/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ readme = "README.md"
1313
[package.metadata.docs.rs]
1414
targets = ["x86_64-unknown-linux-gnu"]
1515

16-
[build-dependencies]
17-
prost-build = "0.10"
18-
1916
[dependencies]
2017
async-trait = "0.1"
2118
asynchronous-codec = "0.6"
@@ -43,7 +40,6 @@ serde_json = "1.0.85"
4340
smallvec = "1.8.0"
4441
thiserror = "1.0"
4542
unsigned-varint = { version = "0.7.1", features = ["futures", "asynchronous_codec"] }
46-
void = "1.0.2"
4743
zeroize = "1.4.3"
4844
fork-tree = { version = "3.0.0", path = "../../utils/fork-tree" }
4945
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }

client/network/bitswap/Cargo.toml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[package]
2+
description = "Substrate bitswap protocol"
3+
name = "sc-network-bitswap"
4+
version = "0.10.0-dev"
5+
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
6+
authors = ["Parity Technologies <admin@parity.io>"]
7+
edition = "2021"
8+
homepage = "https://substrate.io"
9+
repository = "https://github.com/paritytech/substrate/"
10+
documentation = "https://docs.rs/sc-network-bitswap"
11+
readme = "README.md"
12+
13+
[package.metadata.docs.rs]
14+
targets = ["x86_64-unknown-linux-gnu"]
15+
16+
[build-dependencies]
17+
prost-build = "0.11"
18+
19+
[dependencies]
20+
cid = "0.8.6"
21+
futures = "0.3.21"
22+
libp2p = "0.46.1"
23+
log = "0.4.17"
24+
prost = "0.11"
25+
thiserror = "1.0"
26+
unsigned-varint = { version = "0.7.1", features = ["futures", "asynchronous_codec"] }
27+
void = "1.0.2"
28+
sc-client-api = { version = "4.0.0-dev", path = "../../api" }
29+
sc-network-common = { version = "0.10.0-dev", path = "../common" }
30+
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
31+
sp-runtime = { version = "6.0.0", path = "../../../primitives/runtime" }
32+
33+
[dev-dependencies]
34+
tokio = { version = "1", features = ["full"] }
35+
sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" }
36+
sc-consensus = { version = "0.10.0-dev", path = "../../consensus/common" }
37+
sp-core = { version = "6.0.0", path = "../../../primitives/core" }
38+
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
39+
substrate-test-runtime = { version = "2.0.0", path = "../../../test-utils/runtime" }
40+
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }

client/network/build.rs client/network/bitswap/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const PROTOS: &[&str] = &["src/schema/bitswap.v1.2.0.proto"];
1+
const PROTOS: &[&str] = &["bitswap.v1.2.0.proto"];
22

33
fn main() {
44
prost_build::compile_protos(PROTOS, &["src/schema"]).unwrap();

0 commit comments

Comments
 (0)