Companion PR for warp sync support. (#3382)

* Update for the new GrandpaAPI

* Update substrate

* Update substrate
This commit is contained in:
Arkadiy Paronyan
2021-08-02 11:59:50 +02:00
committed by GitHub
parent 3445cbecd0
commit 30e3012270
8 changed files with 189 additions and 182 deletions
+157 -177
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -19,7 +19,6 @@ sc-consensus-uncles = { git = "https://github.com/paritytech/substrate", branch
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" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -146,7 +145,6 @@ full-node = [
"polkadot-node-core-runtime-api",
"polkadot-statement-distribution",
"polkadot-approval-distribution",
"sc-finality-grandpa-warp-sync",
"kvdb-rocksdb"
]
+12 -3
View File
@@ -696,15 +696,17 @@ pub fn new_full<RuntimeApi, Executor, OverseerGenerator>(
config.network.extra_sets.extend(peer_sets_info(is_authority));
}
config.network.request_response_protocols.push(sc_finality_grandpa_warp_sync::request_response_config_for_chain(
&config, task_manager.spawn_handle(), backend.clone(), import_setup.1.shared_authority_set().clone(),
));
let request_multiplexer = {
let (multiplexer, configs) = RequestMultiplexer::new();
config.network.request_response_protocols.extend(configs);
multiplexer
};
let warp_sync = Arc::new(grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
import_setup.1.shared_authority_set().clone(),
));
let (network, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
@@ -714,6 +716,7 @@ pub fn new_full<RuntimeApi, Executor, OverseerGenerator>(
import_queue,
on_demand: None,
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;
if config.offchain_worker.enabled {
@@ -1136,6 +1139,11 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(
telemetry.as_ref().map(|x| x.handle()),
)?;
let warp_sync = Arc::new(grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));
let (network, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
@@ -1145,6 +1153,7 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(
import_queue,
on_demand: Some(on_demand.clone()),
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;
let enable_grandpa = !config.disable_grandpa;
+4
View File
@@ -1727,6 +1727,10 @@ sp_api::impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
+4
View File
@@ -1304,6 +1304,10 @@ sp_api::impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
+4
View File
@@ -1274,6 +1274,10 @@ sp_api::impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
+4
View File
@@ -750,6 +750,10 @@ sp_api::impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
+4
View File
@@ -1311,6 +1311,10 @@ sp_api::impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,