mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
Companion PR for warp sync support. (#3382)
* Update for the new GrandpaAPI * Update substrate * Update substrate
This commit is contained in:
Generated
+157
-177
File diff suppressed because it is too large
Load Diff
@@ -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 = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-consensus-slots = { 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-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-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-transaction-pool = { 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" }
|
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
@@ -146,7 +145,6 @@ full-node = [
|
|||||||
"polkadot-node-core-runtime-api",
|
"polkadot-node-core-runtime-api",
|
||||||
"polkadot-statement-distribution",
|
"polkadot-statement-distribution",
|
||||||
"polkadot-approval-distribution",
|
"polkadot-approval-distribution",
|
||||||
"sc-finality-grandpa-warp-sync",
|
|
||||||
"kvdb-rocksdb"
|
"kvdb-rocksdb"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -696,15 +696,17 @@ pub fn new_full<RuntimeApi, Executor, OverseerGenerator>(
|
|||||||
config.network.extra_sets.extend(peer_sets_info(is_authority));
|
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 request_multiplexer = {
|
||||||
let (multiplexer, configs) = RequestMultiplexer::new();
|
let (multiplexer, configs) = RequestMultiplexer::new();
|
||||||
config.network.request_response_protocols.extend(configs);
|
config.network.request_response_protocols.extend(configs);
|
||||||
multiplexer
|
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) =
|
let (network, system_rpc_tx, network_starter) =
|
||||||
service::build_network(service::BuildNetworkParams {
|
service::build_network(service::BuildNetworkParams {
|
||||||
config: &config,
|
config: &config,
|
||||||
@@ -714,6 +716,7 @@ pub fn new_full<RuntimeApi, Executor, OverseerGenerator>(
|
|||||||
import_queue,
|
import_queue,
|
||||||
on_demand: None,
|
on_demand: None,
|
||||||
block_announce_validator_builder: None,
|
block_announce_validator_builder: None,
|
||||||
|
warp_sync: Some(warp_sync),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
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()),
|
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) =
|
let (network, system_rpc_tx, network_starter) =
|
||||||
service::build_network(service::BuildNetworkParams {
|
service::build_network(service::BuildNetworkParams {
|
||||||
config: &config,
|
config: &config,
|
||||||
@@ -1145,6 +1153,7 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(
|
|||||||
import_queue,
|
import_queue,
|
||||||
on_demand: Some(on_demand.clone()),
|
on_demand: Some(on_demand.clone()),
|
||||||
block_announce_validator_builder: None,
|
block_announce_validator_builder: None,
|
||||||
|
warp_sync: Some(warp_sync),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let enable_grandpa = !config.disable_grandpa;
|
let enable_grandpa = !config.disable_grandpa;
|
||||||
|
|||||||
@@ -1727,6 +1727,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Grandpa::grandpa_authorities()
|
Grandpa::grandpa_authorities()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_set_id() -> fg_primitives::SetId {
|
||||||
|
Grandpa::current_set_id()
|
||||||
|
}
|
||||||
|
|
||||||
fn submit_report_equivocation_unsigned_extrinsic(
|
fn submit_report_equivocation_unsigned_extrinsic(
|
||||||
equivocation_proof: fg_primitives::EquivocationProof<
|
equivocation_proof: fg_primitives::EquivocationProof<
|
||||||
<Block as BlockT>::Hash,
|
<Block as BlockT>::Hash,
|
||||||
|
|||||||
@@ -1304,6 +1304,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Grandpa::grandpa_authorities()
|
Grandpa::grandpa_authorities()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_set_id() -> fg_primitives::SetId {
|
||||||
|
Grandpa::current_set_id()
|
||||||
|
}
|
||||||
|
|
||||||
fn submit_report_equivocation_unsigned_extrinsic(
|
fn submit_report_equivocation_unsigned_extrinsic(
|
||||||
equivocation_proof: fg_primitives::EquivocationProof<
|
equivocation_proof: fg_primitives::EquivocationProof<
|
||||||
<Block as BlockT>::Hash,
|
<Block as BlockT>::Hash,
|
||||||
|
|||||||
@@ -1274,6 +1274,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Grandpa::grandpa_authorities()
|
Grandpa::grandpa_authorities()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_set_id() -> fg_primitives::SetId {
|
||||||
|
Grandpa::current_set_id()
|
||||||
|
}
|
||||||
|
|
||||||
fn submit_report_equivocation_unsigned_extrinsic(
|
fn submit_report_equivocation_unsigned_extrinsic(
|
||||||
equivocation_proof: fg_primitives::EquivocationProof<
|
equivocation_proof: fg_primitives::EquivocationProof<
|
||||||
<Block as BlockT>::Hash,
|
<Block as BlockT>::Hash,
|
||||||
|
|||||||
@@ -750,6 +750,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Grandpa::grandpa_authorities()
|
Grandpa::grandpa_authorities()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_set_id() -> fg_primitives::SetId {
|
||||||
|
Grandpa::current_set_id()
|
||||||
|
}
|
||||||
|
|
||||||
fn submit_report_equivocation_unsigned_extrinsic(
|
fn submit_report_equivocation_unsigned_extrinsic(
|
||||||
_equivocation_proof: fg_primitives::EquivocationProof<
|
_equivocation_proof: fg_primitives::EquivocationProof<
|
||||||
<Block as BlockT>::Hash,
|
<Block as BlockT>::Hash,
|
||||||
|
|||||||
@@ -1311,6 +1311,10 @@ sp_api::impl_runtime_apis! {
|
|||||||
Grandpa::grandpa_authorities()
|
Grandpa::grandpa_authorities()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_set_id() -> fg_primitives::SetId {
|
||||||
|
Grandpa::current_set_id()
|
||||||
|
}
|
||||||
|
|
||||||
fn submit_report_equivocation_unsigned_extrinsic(
|
fn submit_report_equivocation_unsigned_extrinsic(
|
||||||
equivocation_proof: fg_primitives::EquivocationProof<
|
equivocation_proof: fg_primitives::EquivocationProof<
|
||||||
<Block as BlockT>::Hash,
|
<Block as BlockT>::Hash,
|
||||||
|
|||||||
Reference in New Issue
Block a user