Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 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
16 changes: 16 additions & 0 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ pub fn polkadot_staging_testnet_config() -> Result<PolkadotChainSpec, String> {
),
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1113,6 +1114,7 @@ pub fn kusama_staging_testnet_config() -> Result<KusamaChainSpec, String> {
),
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1135,6 +1137,7 @@ pub fn westend_staging_testnet_config() -> Result<WestendChainSpec, String> {
),
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1160,6 +1163,7 @@ pub fn rococo_staging_testnet_config() -> Result<RococoChainSpec, String> {
),
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand Down Expand Up @@ -1637,6 +1641,7 @@ pub fn polkadot_development_config() -> Result<PolkadotChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1655,6 +1660,7 @@ pub fn kusama_development_config() -> Result<KusamaChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1673,6 +1679,7 @@ pub fn westend_development_config() -> Result<WestendChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1695,6 +1702,7 @@ pub fn rococo_development_config() -> Result<RococoChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1717,6 +1725,7 @@ pub fn versi_development_config() -> Result<RococoChainSpec, String> {
None,
Some("versi"),
None,
None,
Default::default(),
))
}
Expand All @@ -1740,6 +1749,7 @@ pub fn wococo_development_config() -> Result<RococoChainSpec, String> {
None,
Some(WOCOCO_DEV_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand Down Expand Up @@ -1771,6 +1781,7 @@ pub fn polkadot_local_testnet_config() -> Result<PolkadotChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand Down Expand Up @@ -1802,6 +1813,7 @@ pub fn kusama_local_testnet_config() -> Result<KusamaChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand Down Expand Up @@ -1833,6 +1845,7 @@ pub fn westend_local_testnet_config() -> Result<WestendChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand Down Expand Up @@ -1865,6 +1878,7 @@ pub fn rococo_local_testnet_config() -> Result<RococoChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand Down Expand Up @@ -1919,6 +1933,7 @@ pub fn wococo_local_testnet_config() -> Result<RococoChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
Expand All @@ -1941,6 +1956,7 @@ pub fn versi_local_testnet_config() -> Result<RococoChainSpec, String> {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
))
}
24 changes: 20 additions & 4 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use {
},
polkadot_node_core_dispute_coordinator::Config as DisputeCoordinatorConfig,
polkadot_overseer::BlockInfo,
sc_client_api::ExecutorProvider,
sc_client_api::{BlockBackend, ExecutorProvider},
sp_trie::PrefixedMemoryDB,
tracing::info,
};
Expand Down Expand Up @@ -755,10 +755,24 @@ where
// Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change
// anything in terms of behaviour, but makes the logs more consistent with the other
// Substrate nodes.
config.network.extra_sets.push(grandpa::grandpa_peers_set_config());

let grandpa_protocol_name = grandpa::protocol_standard_name(
&client.block_hash(0).ok().flatten().unwrap_or_default(),
&config.chain_spec,
);
config
.network
.extra_sets
.push(grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));

let beefy_protocol_name = beefy_gadget::protocol_standard_name(
&client.block_hash(0).ok().flatten().unwrap_or_default(),
&config.chain_spec,
);
if chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi() {
config.network.extra_sets.push(beefy_gadget::beefy_peers_set_config());
config
.network
.extra_sets
.push(beefy_gadget::beefy_peers_set_config(beefy_protocol_name.clone()));
}

{
Expand Down Expand Up @@ -1072,6 +1086,7 @@ where
signed_commitment_sender: beefy_link,
min_block_delta: if chain_spec.is_wococo() { 4 } else { 8 },
prometheus_registry: prometheus_registry.clone(),
protocol_name: beefy_protocol_name,
};

let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _>(beefy_params);
Expand All @@ -1096,6 +1111,7 @@ where
keystore: keystore_opt,
local_role: role,
telemetry: telemetry.as_ref().map(|x| x.handle()),
protocol_name: grandpa_protocol_name,
};

let enable_grandpa = !disable_grandpa;
Expand Down
1 change: 1 addition & 0 deletions node/test/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn polkadot_local_testnet_config() -> PolkadotChainSpec {
None,
Some(DEFAULT_PROTOCOL_ID),
None,
None,
Default::default(),
)
}
Expand Down