Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

*: Ensure GossipEngine is being polled #836

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,984 changes: 992 additions & 992 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions availability-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ futures = "0.3.4"
tokio = { version = "0.2.10", features = ["rt-core"] }
exit-future = "0.2.0"
codec = { package = "parity-scale-codec", version = "1.1.0", features = ["derive"] }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client = { package = "sc-client-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
keystore = { package = "sc-keystore", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-network = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
client = { package = "sc-client-api", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-client = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-runtime = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-blockchain = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
keystore = { package = "sc-keystore", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-core = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
kvdb = "0.3.1"
kvdb-memorydb = "0.3.1"

Expand Down
18 changes: 9 additions & 9 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ crate-type = ["cdylib", "rlib"]
log = "0.4.8"
futures = { version = "0.3.4", features = ["compat"] }
structopt = "0.3.8"
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-cli = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", optional = true }
sp-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-core = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-runtime = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-client = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-client-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-client-db = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-executor = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
service = { package = "polkadot-service", path = "../service", default-features = false }

tokio = { version = "0.2.10", features = ["rt-threaded"], optional = true }

wasm-bindgen = { version = "0.2.57", optional = true }
wasm-bindgen-futures = { version = "0.4.7", optional = true }
browser-utils = { package = "browser-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
browser-utils = { package = "browser-utils", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", optional = true }

[features]
default = [ "wasmtime", "rocksdb", "cli" ]
Expand Down
20 changes: 10 additions & 10 deletions collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ edition = "2018"

[dependencies]
futures = "0.3.4"
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-cli = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-client-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-network = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-blockchain = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-core = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-runtime = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
polkadot-primitives = { path = "../primitives" }
polkadot-cli = { path = "../cli" }
polkadot-network = { path = "../network" }
Expand All @@ -27,4 +27,4 @@ futures-timer = "2.0"
codec = { package = "parity-scale-codec", version = "1.1.0" }

[dev-dependencies]
keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
keyring = { package = "sp-keyring", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
4 changes: 2 additions & 2 deletions erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ edition = "2018"
primitives = { package = "polkadot-primitives", path = "../primitives" }
reed_solomon = { package = "reed-solomon-erasure", git = "https://github.com/paritytech/reed-solomon-erasure" }
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
trie = { package = "sp-trie", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
derive_more = "0.15.0"
18 changes: 9 additions & 9 deletions network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ polkadot-validation = { path = "../validation" }
polkadot-primitives = { path = "../primitives" }
polkadot-erasure-coding = { path = "../erasure-coding" }
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-network-gossip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-network = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-network-gossip = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-core = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-runtime = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
futures = "0.3.4"
log = "0.4.8"
exit-future = "0.2.0"
futures-timer = "2.0"
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-blockchain = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
wasm-timer = "0.2.4"

[dev-dependencies]
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-keyring = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-state-machine = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
10 changes: 9 additions & 1 deletion network/src/legacy/gossip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,19 @@ pub fn register_validator<C: ChainContext + 'static, S: NetworkSpecialization<Bl
let gossip_side = validator.clone();
let gossip_engine = sc_network_gossip::GossipEngine::new(
service.clone(),
executor,
POLKADOT_ENGINE_ID,
gossip_side,
);

// Ideally this would not be spawned as an orphaned task, but polled by
// `RegisteredMessageValidator` which in turn would be polled by a `ValidationNetwork`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that when we remove the legacy code we will use protocol.rs which could run this in a future.

let spawn_res = executor.spawn_obj(futures::task::FutureObj::from(Box::new(gossip_engine.clone())));

// Note: we consider the chances of an error to spawn a background task almost null.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but should we panic instead? This code will only be run on node startup, maybe it makes sense to just fail right away?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A graceful exit would be hard to include, but maybe a warning would be good.

if spawn_res.is_err() {
log::error!(target: "polkadot-gossip", "Failed to spawn background task");
}

RegisteredMessageValidator {
inner: validator as _,
service: Some(service),
Expand Down
12 changes: 6 additions & 6 deletions parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ edition = "2018"
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = [ "derive" ] }
derive_more = { version = "0.99.2", optional = true }
serde = { version = "1.0.102", default-features = false, features = [ "derive" ], optional = true }
rstd = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", optional = true }
rstd = { package = "sp-std", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
sp-core = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
sp-runtime-interface = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
sp-externalities = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", optional = true }
sc-executor = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", optional = true }
sp-io = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", optional = true }
lazy_static = { version = "1.4.0", optional = true }
parking_lot = { version = "0.10.0", optional = true }
log = { version = "0.4.8", optional = true }
Expand Down
20 changes: 10 additions & 10 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.102", optional = true, features = ["derive"] }
parity-scale-codec = { version = "1.1.0", default-features = false, features = ["bit-vec", "derive"] }
primitives = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
application-crypto = { package = "sp-application-crypto", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
rstd = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
runtime_primitives = { package = "sp-runtime", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
primitives = { package = "sp-core", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
inherents = { package = "sp-inherents", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
application-crypto = { package = "sp-application-crypto", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
sp-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
sp-version = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
rstd = { package = "sp-std", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
runtime_primitives = { package = "sp-runtime", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
polkadot-parachain = { path = "../parachain", default-features = false }
trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
trie = { package = "sp-trie", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }
bitvec = { version = "0.15.2", default-features = false, features = ["alloc"] }
babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
babe = { package = "pallet-babe", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master", default-features = false }

[dev-dependencies]
sp-serializer = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-serializer = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
pretty_assertions = "0.5.1"

[features]
Expand Down
14 changes: 7 additions & 7 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
client = { package = "sc-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client = { package = "sc-client", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
jsonrpc-core = "14.0.3"
polkadot-primitives = { path = "../primitives" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
txpool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sp-api = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
sc-rpc = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
txpool-api = { package = "sp-transaction-pool", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
pallet-transaction-payment-rpc = { git = "https://github.com/mxinden/substrate", branch = "restructure-gossip-engine-polkadot-master" }
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false }
Loading