From d68902ff088164dc85b37ae6b7cde91a0cf7ab7e Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 31 Jan 2024 06:09:14 +0200 Subject: [PATCH 1/4] Update chain spec name to 3h everywhere --- .github/workflows/chain-spec-snapshot-build.yml | 10 +++++----- crates/subspace-node/src/chain_spec.rs | 16 ++++++++-------- crates/subspace-node/src/cli.rs | 4 ++-- .../subspace-node/src/commands/run/consensus.rs | 4 ++-- crates/subspace-node/src/domain/cli.rs | 4 ++-- .../subspace-node/src/domain/evm_chain_spec.rs | 10 +++++----- docs/farming.md | 10 +++++----- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/chain-spec-snapshot-build.yml b/.github/workflows/chain-spec-snapshot-build.yml index fefa1651b8..424d9663c9 100644 --- a/.github/workflows/chain-spec-snapshot-build.yml +++ b/.github/workflows/chain-spec-snapshot-build.yml @@ -28,16 +28,16 @@ jobs: - name: Generate testnet chain specifications run: | - docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3g-compiled --disable-default-bootnode > chain-spec-gemini-3g.json - docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3g-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3g.json + docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3h-compiled --disable-default-bootnode > chain-spec-gemini-3h.json + docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3h-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3h.json - name: Upload chain specifications to artifacts uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # @v3.1.1 with: name: chain-specifications path: | - chain-spec-gemini-3g.json - chain-spec-raw-gemini-3g.json + chain-spec-gemini-3h.json + chain-spec-raw-gemini-3h.json if-no-files-found: error - name: Upload chain specifications to assets @@ -45,4 +45,4 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - asset_paths: '["chain-spec-gemini-3g.json", "chain-spec-raw-gemini-3g.json"]' + asset_paths: '["chain-spec-gemini-3h.json", "chain-spec-raw-gemini-3h.json"]' diff --git a/crates/subspace-node/src/chain_spec.rs b/crates/subspace-node/src/chain_spec.rs index 574ab0ff00..2c7d0e578a 100644 --- a/crates/subspace-node/src/chain_spec.rs +++ b/crates/subspace-node/src/chain_spec.rs @@ -109,15 +109,15 @@ struct GenesisDomainParams { operator_signing_key: OperatorPublicKey, } -pub fn gemini_3g_compiled() -> Result, String> { +pub fn gemini_3h_compiled() -> Result, String> { // TODO: Migrate once https://github.com/paritytech/polkadot-sdk/issues/2963 is un-broken #[allow(deprecated)] Ok(GenericChainSpec::from_genesis( // Name - "Subspace Gemini 3g", + "Subspace Gemini 3h", // ID - "subspace_gemini_3g", - ChainType::Custom("Subspace Gemini 3g".to_string()), + "subspace_gemini_3h", + ChainType::Custom("Subspace Gemini 3h".to_string()), || { let sudo_account = AccountId::from_ss58check("5DNwQTHfARgKoa2NdiUM51ZUow7ve5xG9S2yYdSbVQcnYxBA") @@ -200,7 +200,7 @@ pub fn gemini_3g_compiled() -> Result, St .map_err(|error| error.to_string())?, ), // Protocol ID - Some("subspace-gemini-3g"), + Some("subspace-gemini-3h"), None, // Properties Some({ @@ -218,8 +218,8 @@ pub fn gemini_3g_compiled() -> Result, St )) } -pub fn gemini_3g_config() -> Result, String> { - unimplemented!("Please use release prefixed with gemini-3g") +pub fn gemini_3h_config() -> Result, String> { + unimplemented!("Please use release prefixed with gemini-3h") } pub fn devnet_config() -> Result, String> { @@ -417,7 +417,7 @@ fn subspace_genesis_config( SpecId::Dev => evm_chain_spec::development_config(move || { evm_chain_spec::get_testnet_genesis_by_spec_id(spec_id) }), - SpecId::Gemini => evm_chain_spec::gemini_3g_config(move || { + SpecId::Gemini => evm_chain_spec::gemini_3h_config(move || { evm_chain_spec::get_testnet_genesis_by_spec_id(spec_id) }), SpecId::DevNet => evm_chain_spec::devnet_config(move || { diff --git a/crates/subspace-node/src/cli.rs b/crates/subspace-node/src/cli.rs index 8822db6f6d..d541a003c3 100644 --- a/crates/subspace-node/src/cli.rs +++ b/crates/subspace-node/src/cli.rs @@ -98,8 +98,8 @@ impl SubstrateCli for SubspaceCliPlaceholder { fn load_spec(&self, id: &str) -> Result, String> { let chain_spec = match id { - "gemini-3g-compiled" => chain_spec::gemini_3g_compiled()?, - "gemini-3g" => chain_spec::gemini_3g_config()?, + "gemini-3h-compiled" => chain_spec::gemini_3h_compiled()?, + "gemini-3h" => chain_spec::gemini_3h_config()?, "devnet" => chain_spec::devnet_config()?, "devnet-compiled" => chain_spec::devnet_config_compiled()?, "dev" => chain_spec::dev_config()?, diff --git a/crates/subspace-node/src/commands/run/consensus.rs b/crates/subspace-node/src/commands/run/consensus.rs index bcded9acb3..ee5d1f6b2d 100644 --- a/crates/subspace-node/src/commands/run/consensus.rs +++ b/crates/subspace-node/src/commands/run/consensus.rs @@ -366,8 +366,8 @@ pub(super) fn create_consensus_chain_configuration( } let chain_spec = match chain.as_deref() { - Some("gemini-3g-compiled") => chain_spec::gemini_3g_compiled()?, - Some("gemini-3g") => chain_spec::gemini_3g_config()?, + Some("gemini-3h-compiled") => chain_spec::gemini_3h_compiled()?, + Some("gemini-3h") => chain_spec::gemini_3h_config()?, Some("devnet") => chain_spec::devnet_config()?, Some("devnet-compiled") => chain_spec::devnet_config_compiled()?, Some("dev") => chain_spec::dev_config()?, diff --git a/crates/subspace-node/src/domain/cli.rs b/crates/subspace-node/src/domain/cli.rs index 24b9e52d32..6e2109ca33 100644 --- a/crates/subspace-node/src/domain/cli.rs +++ b/crates/subspace-node/src/domain/cli.rs @@ -310,10 +310,10 @@ impl BuildGenesisStorageCmd { let is_dev = self.shared_params.is_dev(); let chain_id = self.shared_params.chain_id(is_dev); let domain_chain_spec = match chain_id.as_str() { - "gemini-3g" | "devnet" | "dev" => evm_chain_spec::load_chain_spec(&chain_id)?, + "gemini-3h" | "devnet" | "dev" => evm_chain_spec::load_chain_spec(&chain_id)?, unknown_id => { eprintln!( - "unknown chain {unknown_id:?}, expected gemini-3g, devnet, dev, or local", + "unknown chain {unknown_id:?}, expected gemini-3h, devnet, dev, or local", ); return Ok(()); } diff --git a/crates/subspace-node/src/domain/evm_chain_spec.rs b/crates/subspace-node/src/domain/evm_chain_spec.rs index 26d4e5ce79..cf79caeb21 100644 --- a/crates/subspace-node/src/domain/evm_chain_spec.rs +++ b/crates/subspace-node/src/domain/evm_chain_spec.rs @@ -64,16 +64,16 @@ pub fn development_config RuntimeGenesisConfig + 'static + Send + Syn ) } -pub fn gemini_3g_config RuntimeGenesisConfig + 'static + Send + Sync>( +pub fn gemini_3h_config RuntimeGenesisConfig + 'static + Send + Sync>( constructor: F, ) -> GenericChainSpec { // TODO: Migrate once https://github.com/paritytech/polkadot-sdk/issues/2963 is un-broken #[allow(deprecated)] GenericChainSpec::from_genesis( // Name - "Subspace Gemini 3g EVM Domain", + "Subspace Gemini 3h EVM Domain", // ID - "subspace_gemini_3g_evm_domain", + "subspace_gemini_3h_evm_domain", ChainType::Live, constructor, // Bootnodes @@ -81,7 +81,7 @@ pub fn gemini_3g_config RuntimeGenesisConfig + 'static + Send + Sync> // Telemetry None, // Protocol ID - Some("subspace-gemini-3g-evm-domain"), + Some("subspace-gemini-3h-evm-domain"), None, // Properties Some(chain_spec_properties()), @@ -122,7 +122,7 @@ pub fn devnet_config RuntimeGenesisConfig + 'static + Send + Sync>( pub fn load_chain_spec(spec_id: &str) -> Result, String> { let chain_spec = match spec_id { - "gemini-3g" => gemini_3g_config(move || get_testnet_genesis_by_spec_id(SpecId::Gemini)), + "gemini-3h" => gemini_3h_config(move || get_testnet_genesis_by_spec_id(SpecId::Gemini)), "devnet" => devnet_config(move || get_testnet_genesis_by_spec_id(SpecId::DevNet)), "dev" => development_config(move || get_testnet_genesis_by_spec_id(SpecId::Dev)), path => GenericChainSpec::from_json_file(std::path::PathBuf::from(path))?, diff --git a/docs/farming.md b/docs/farming.md index 13a5a2ab65..bd30a47239 100644 --- a/docs/farming.md +++ b/docs/farming.md @@ -46,7 +46,7 @@ If you're connected directly without any router, then again nothing needs to be # Copy all of the lines below, they are all part of the same command .\NODE_FILE_NAME.exe run ` --base-path PATH_TO_NODE ` ---chain gemini-3g ` +--chain gemini-3h ` --blocks-pruning 256 ` --state-pruning archive-canonical ` --farmer ` @@ -98,7 +98,7 @@ If you're connected directly without any router, then again nothing needs to be # Copy all of the lines below, they are all part of the same command ./NODE_FILE_NAME run \ --base-path PATH_TO_NODE \ - --chain gemini-3g \ + --chain gemini-3h \ --blocks-pruning 256 \ --state-pruning archive-canonical \ --farmer \ @@ -153,7 +153,7 @@ After this, simply repeat the step you prompted for (step 4 or 6). This time, cl # Copy all of the lines below, they are all part of the same command ./NODE_FILE_NAME run \ --base-path PATH_TO_NODE \ - --chain gemini-3g \ + --chain gemini-3h \ --blocks-pruning 256 \ --state-pruning archive-canonical \ --farmer \ @@ -217,7 +217,7 @@ services: restart: unless-stopped command: [ "run", - "--chain", "gemini-3g", + "--chain", "gemini-3h", "--base-path", "/var/subspace", "--blocks-pruning", "256", "--state-pruning", "archive-canonical", @@ -288,7 +288,7 @@ You can read logs with `docker-compose logs --tail=1000 -f`, for the rest read [ ## Checking results and interacting with the network -Visit [Polkadot.js explorer](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Feu-0.gemini-3g.subspace.network%2Fws#/explorer), from there you can interact with Subspace Network as any Substrate-based blockchain. +Visit [Polkadot.js explorer](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Feu-0.gemini-3h.subspace.network%2Fws#/explorer), from there you can interact with Subspace Network as any Substrate-based blockchain. ## Switching from older/different versions of Subspace From 66ed2ce2f89967347517257cca69f964c3afad71 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 31 Jan 2024 06:11:49 +0200 Subject: [PATCH 2/4] Support disabling genesis domain registration in chain spec --- crates/subspace-node/src/chain_spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/subspace-node/src/chain_spec.rs b/crates/subspace-node/src/chain_spec.rs index 2c7d0e578a..c57e7ea110 100644 --- a/crates/subspace-node/src/chain_spec.rs +++ b/crates/subspace-node/src/chain_spec.rs @@ -454,7 +454,7 @@ fn subspace_genesis_config( confirmation_depth_k, }, domains: DomainsConfig { - genesis_domain: Some(sp_domains::GenesisDomain { + genesis_domain: enable_domains.then_some(sp_domains::GenesisDomain { runtime_name: "evm".to_owned(), runtime_type: RuntimeType::Evm, runtime_version: evm_domain_runtime::VERSION, From 84232f497efffc977ca5c4850717cff1dd6b1f70 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 31 Jan 2024 06:12:11 +0200 Subject: [PATCH 3/4] Disable genesis domain at the start of Gemini 3h --- crates/subspace-node/src/chain_spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/subspace-node/src/chain_spec.rs b/crates/subspace-node/src/chain_spec.rs index c57e7ea110..ca64c4cec7 100644 --- a/crates/subspace-node/src/chain_spec.rs +++ b/crates/subspace-node/src/chain_spec.rs @@ -175,7 +175,7 @@ pub fn gemini_3h_compiled() -> Result, St // TODO: Adjust once we bench PoT on faster hardware // About 1s on 6.0 GHz Raptor Lake CPU (14900K) pot_slot_iterations: NonZeroU32::new(200_032_000).expect("Not zero; qed"), - enable_domains: true, + enable_domains: false, enable_dynamic_cost_of_storage: false, enable_balance_transfers: true, enable_non_root_calls: false, From e83f13dde8afd495f308ca26e76d3aacb3244b94 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 31 Jan 2024 07:47:00 +0200 Subject: [PATCH 4/4] Skip pushing chain spec assets unless release is built --- .github/workflows/chain-spec-snapshot-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/chain-spec-snapshot-build.yml b/.github/workflows/chain-spec-snapshot-build.yml index 424d9663c9..e298e551eb 100644 --- a/.github/workflows/chain-spec-snapshot-build.yml +++ b/.github/workflows/chain-spec-snapshot-build.yml @@ -46,3 +46,5 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: asset_paths: '["chain-spec-gemini-3h.json", "chain-spec-raw-gemini-3h.json"]' + # Only run for releases + if: github.event_name == 'push' && github.ref_type == 'tag'