From 4c24d49632d2e7dc0abfbfb55c2455fb27203bfb Mon Sep 17 00:00:00 2001 From: Fotis Zikos Date: Thu, 24 Aug 2023 14:25:41 +0300 Subject: [PATCH 1/2] fix: removed versi chain --- cli/src/command.rs | 17 +++------------- node/service/src/chain_spec.rs | 37 ++-------------------------------- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/cli/src/command.rs b/cli/src/command.rs index 1156930aa53b..bbc49c794c6c 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -76,7 +76,7 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> std::result::Result, String> { let id = if id == "" { let n = get_exec_name().unwrap_or_default(); - ["cherry", "rococo", "versi"] + ["cherry", "rococo"] .iter() .cloned() .find(|&chain| n.starts_with(chain)) @@ -111,15 +111,6 @@ impl SubstrateCli for Cli { #[cfg(not(feature = "rococo-native"))] name if name.starts_with("wococo-") => Err(format!("`{}` only supported with `rococo-native` feature enabled.", name))?, - #[cfg(feature = "rococo-native")] - "versi-dev" => Box::new(service::chain_spec::versi_development_config()?), - #[cfg(feature = "rococo-native")] - "versi-local" => Box::new(service::chain_spec::versi_local_testnet_config()?), - #[cfg(feature = "rococo-native")] - "versi-staging" => Box::new(service::chain_spec::versi_staging_testnet_config()?), - #[cfg(not(feature = "rococo-native"))] - name if name.starts_with("versi-") => - Err(format!("`{}` only supported with `rococo-native` feature enabled.", name))?, path => { let path = std::path::PathBuf::from(path); @@ -129,9 +120,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 || - chain_spec.is_rococo() || - chain_spec.is_wococo() || - chain_spec.is_versi() + chain_spec.is_rococo() { Box::new(service::RococoChainSpec::from_json_file(path)?) } else { @@ -143,7 +132,7 @@ impl SubstrateCli for Cli { fn native_runtime_version(spec: &Box) -> &'static RuntimeVersion { #[cfg(feature = "rococo-native")] - if spec.is_rococo() || spec.is_wococo() || spec.is_versi() { + if spec.is_rococo() { return &service::rococo_runtime::VERSION } diff --git a/node/service/src/chain_spec.rs b/node/service/src/chain_spec.rs index c6f7ec133e46..6a35973102cb 100644 --- a/node/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.rs @@ -26,13 +26,8 @@ use grandpa::AuthorityId as GrandpaId; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_staking::Forcing; use polkadot_primitives::{AccountId, AccountPublic, AssignmentId, ValidatorId}; -#[cfg(feature = "polkadot-native")] -use polkadot_runtime as polkadot; -#[cfg(feature = "polkadot-native")] -use polkadot_runtime_constants::currency::UNITS as DOT; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; - #[cfg(feature = "rococo-native")] use rococo_runtime as rococo; #[cfg(feature = "rococo-native")] @@ -47,8 +42,6 @@ use telemetry::TelemetryEndpoints; const POLKADOT_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; #[cfg(feature = "rococo-native")] const ROCOCO_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; -#[cfg(feature = "rococo-native")] -const VERSI_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; const DEFAULT_PROTOCOL_ID: &str = "dot"; /// Node `ChainSpec` extensions. @@ -366,7 +359,7 @@ fn cherry_staging_testnet_config_genesis(wasm_binary: &[u8]) -> cherry::GenesisC }, paras: Default::default(), xcm_pallet: Default::default(), - sudo: Default::default(), + sudo: cherry_runtime::SudoConfig { key: Some(endowed_accounts[0].clone()) }, // nomination_pools: Default::default(), } } @@ -1130,32 +1123,6 @@ pub fn versi_chain_spec_properties() -> serde_json::map::Map Result { - let wasm_binary = rococo::WASM_BINARY.ok_or("Versi development wasm not available")?; - let boot_nodes = vec![]; - - Ok(RococoChainSpec::from_genesis( - "Versi Staging Testnet", - "versi_staging_testnet", - ChainType::Live, - move || RococoGenesisExt { - runtime_genesis_config: rococo_staging_testnet_config_genesis(wasm_binary), - session_length_in_blocks: Some(100), - }, - boot_nodes, - Some( - TelemetryEndpoints::new(vec![(VERSI_STAGING_TELEMETRY_URL.to_string(), 0)]) - .expect("Versi Staging telemetry url is valid; qed"), - ), - Some("versi"), - None, - Some(versi_chain_spec_properties()), - Default::default(), - )) -} - /// Helper function to generate a crypto pair from seed pub fn get_from_seed(seed: &str) -> ::Public { TPublic::Pair::from_string(&format!("//{}", seed), None) @@ -1319,7 +1286,7 @@ pub fn cherry_testnet_genesis( }, paras: Default::default(), xcm_pallet: Default::default(), - sudo: Default::default(), + sudo: cherry_runtime::SudoConfig { key: Some(root_key.clone()) }, // nomination_pools: Default::default(), } } From 95084d3338d00d407a8e51604ef5a30acd1ba41e Mon Sep 17 00:00:00 2001 From: Fotis Zikos Date: Thu, 24 Aug 2023 14:27:30 +0300 Subject: [PATCH 2/2] bump spec version --- runtime/cherry/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/cherry/src/lib.rs b/runtime/cherry/src/lib.rs index 23fd5e94807e..910ceb9444e5 100644 --- a/runtime/cherry/src/lib.rs +++ b/runtime/cherry/src/lib.rs @@ -120,7 +120,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("cherry-testnet"), impl_name: create_runtime_str!("cherry-testnet"), authoring_version: 0, - spec_version: 25, + spec_version: 26, impl_version: 0, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS,