Add support for Grandpa warp sync (#2301)

* Add support for Grandpa warp sync

* Don't pull the warp sync crate if not full-node
This commit is contained in:
Pierre Krieger
2021-01-21 21:27:14 +01:00
committed by GitHub
parent 8aee25cae2
commit cfb474cacb
3 changed files with 231 additions and 171 deletions
+225 -171
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -16,6 +16,7 @@ sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "mast
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-finality-grandpa-warp-sync = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -103,6 +104,7 @@ default = ["db", "full-node"]
db = ["service/db"]
full-node = [
"polkadot-node-core-av-store",
"sc-finality-grandpa-warp-sync"
]
runtime-benchmarks = [
+4
View File
@@ -589,6 +589,10 @@ pub fn new_full<RuntimeApi, Executor>(
fn adjust_yamux(_: &mut sc_network::config::NetworkConfiguration) {}
adjust_yamux(&mut config.network);
config.network.request_response_protocols.push(sc_finality_grandpa_warp_sync::request_response_config_for_chain(
&config, task_manager.spawn_handle(), backend.clone(),
));
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,