Unverified Commit 3490daa0 authored by André Silva's avatar André Silva Committed by GitHub
Browse files

Introduce Wococo testnet (#2918)



* runtime: remove mmr and beefy from westend runtime

* runtime: westend: remove pallet_beefy config

* node: only start beefy gadget on rococo

* node: remove beefy keys from westend chain spec

* node: add wococo testnet chain spec

* node: add comments about beefy gadget task

* runtime: update wococo chainspec

* Remove stale comment

Co-authored-by: default avatarTomasz Drwięga <tomasz@parity.io>
Co-authored-by: default avataradoerr <0xad@gmx.net>
parent 48618a81
Pipeline #135518 failed with stages
in 39 minutes and 24 seconds
......@@ -89,6 +89,7 @@ impl SubstrateCli for Cli {
"rococo-staging" => Box::new(service::chain_spec::rococo_staging_testnet_config()?),
"rococo-local" => Box::new(service::chain_spec::rococo_local_testnet_config()?),
"rococo" => Box::new(service::chain_spec::rococo_config()?),
"wococo" => Box::new(service::chain_spec::wococo_config()?),
path => {
let path = std::path::PathBuf::from(path);
......@@ -98,7 +99,7 @@ impl SubstrateCli for Cli {
// When `force_*` is given or the file name starts with the name of one of the known chains,
// we use the chain spec for the specific chain.
if self.run.force_rococo || starts_with("rococo") {
if self.run.force_rococo || starts_with("rococo") || starts_with("wococo") {
Box::new(service::RococoChainSpec::from_json_file(path)?)
} else if self.run.force_kusama || starts_with("kusama") {
Box::new(service::KusamaChainSpec::from_json_file(path)?)
......@@ -116,7 +117,7 @@ impl SubstrateCli for Cli {
&service::kusama_runtime::VERSION
} else if spec.is_westend() {
&service::westend_runtime::VERSION
} else if spec.is_rococo() {
} else if spec.is_rococo() || spec.is_wococo() {
&service::rococo_runtime::VERSION
} else {
&service::polkadot_runtime::VERSION
......
This diff is collapsed.
......@@ -112,6 +112,11 @@ pub fn rococo_config() -> Result<PolkadotChainSpec, String> {
PolkadotChainSpec::from_json_bytes(&include_bytes!("../res/rococo.json")[..])
}
/// This is a temporary testnet that uses the same runtime as rococo.
pub fn wococo_config() -> Result<PolkadotChainSpec, String> {
PolkadotChainSpec::from_json_bytes(&include_bytes!("../res/wococo.json")[..])
}
fn polkadot_session_keys(
babe: BabeId,
grandpa: GrandpaId,
......@@ -294,7 +299,6 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi
// for i in 1 2 3 4; do for j in grandpa; do subkey --ed25519 inspect "$SECRET//$i//$j"; done; done
// for i in 1 2 3 4; do for j in im_online; do subkey --sr25519 inspect "$SECRET//$i//$j"; done; done
// for i in 1 2 3 4; do for j in para_validator para_assignment; do subkey --sr25519 inspect "$SECRET//$i//$j"; done; done
// for i in 1 2 3 4; do for j in beefy; do subkey --ecdsa inspect "$SECRET//$i//$j"; done; done
let initial_authorities: Vec<(
AccountId,
AccountId,
......
......@@ -151,7 +151,7 @@ pub enum Error {
DatabasePathRequired,
}
/// Can be called for a `Configuration` to check if it is a configuration for the `Kusama` network.
/// Can be called for a `Configuration` to identify which network the configuration targets.
pub trait IdentifyVariant {
/// Returns if this is a configuration for the `Kusama` network.
fn is_kusama(&self) -> bool;
......@@ -162,6 +162,9 @@ pub trait IdentifyVariant {
/// Returns if this is a configuration for the `Rococo` network.
fn is_rococo(&self) -> bool;
/// Returns if this is a configuration for the `Wococo` test network.
fn is_wococo(&self) -> bool;
/// Returns true if this configuration is for a development network.
fn is_dev(&self) -> bool;
}
......@@ -176,6 +179,9 @@ impl IdentifyVariant for Box<dyn ChainSpec> {
fn is_rococo(&self) -> bool {
self.id().starts_with("rococo") || self.id().starts_with("rco")
}
fn is_wococo(&self) -> bool {
self.id().starts_with("wococo") || self.id().starts_with("wco")
}
fn is_dev(&self) -> bool {
self.id().ends_with("dev")
}
......@@ -680,7 +686,7 @@ pub fn new_full<RuntimeApi, Executor>(
let backoff_authoring_blocks = {
let mut backoff = sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default();
if config.chain_spec.is_rococo() {
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
// it's a testnet that's in flux, finality has stalled sometimes due
// to operational issues and it's annoying to slow down block
// production to 1 block per hour.
......@@ -715,7 +721,7 @@ pub fn new_full<RuntimeApi, Executor>(
// Substrate nodes.
config.network.extra_sets.push(grandpa::grandpa_peers_set_config());
if config.chain_spec.is_rococo() {
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
config.network.extra_sets.push(beefy_gadget::beefy_peers_set_config());
}
......@@ -921,19 +927,25 @@ pub fn new_full<RuntimeApi, Executor>(
task_manager.spawn_essential_handle().spawn_blocking("babe", babe);
}
// We currently only run the BEEFY gadget on Rococo.
if chain_spec.is_rococo() {
// We currently only run the BEEFY gadget on the Rococo and Wococo testnets.
if chain_spec.is_rococo() || chain_spec.is_wococo() {
let gadget = beefy_gadget::start_beefy_gadget::<_, beefy_primitives::ecdsa::AuthorityPair, _, _, _, _>(
client.clone(),
keystore_container.sync_keystore(),
network.clone(),
beefy_link,
network.clone(),
8,
if chain_spec.is_wococo() { 4 } else { 8 },
prometheus_registry.clone()
);
task_manager.spawn_handle().spawn_blocking("beefy-gadget", gadget);
// Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll
// bring the node down with it to make sure it is noticed.
if chain_spec.is_wococo() {
task_manager.spawn_essential_handle().spawn_blocking("beefy-gadget", gadget);
} else {
task_manager.spawn_handle().spawn_blocking("beefy-gadget", gadget);
}
}
// if the node isn't actively participating in consensus then it doesn't
......@@ -1165,7 +1177,7 @@ pub fn new_chain_ops(
>
{
config.keystore = service::config::KeystoreConfig::InMemory;
if config.chain_spec.is_rococo() {
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
let service::PartialComponents { client, backend, import_queue, task_manager, .. }
= new_partial::<rococo_runtime::RuntimeApi, RococoExecutor>(config, jaeger_agent, None)?;
Ok((Arc::new(Client::Rococo(client)), backend, import_queue, task_manager))
......@@ -1189,7 +1201,7 @@ pub fn build_light(config: Configuration) -> Result<(
TaskManager,
RpcHandlers,
), Error> {
if config.chain_spec.is_rococo() {
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
new_light::<rococo_runtime::RuntimeApi, RococoExecutor>(config)
} else if config.chain_spec.is_kusama() {
new_light::<kusama_runtime::RuntimeApi, KusamaExecutor>(config)
......@@ -1208,7 +1220,7 @@ pub fn build_full(
jaeger_agent: Option<std::net::SocketAddr>,
telemetry_worker_handle: Option<TelemetryWorkerHandle>,
) -> Result<NewFull<Client>, Error> {
if config.chain_spec.is_rococo() {
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
new_full::<rococo_runtime::RuntimeApi, RococoExecutor>(
config,
is_collator,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment