Skip to content

Commit

Permalink
Merge pull request #2485 from subspace/prepare-for-gemini-3h
Browse files Browse the repository at this point in the history
Prepare for Gemini 3h
  • Loading branch information
nazar-pc authored Jan 31, 2024
2 parents 1483649 + e83f13d commit 148922f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/chain-spec-snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ 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
uses: alexellis/upload-assets@259de5111cb56966d046ced998941e93f91d2c93 # @0.4.0
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"]'
# Only run for releases
if: github.event_name == 'push' && github.ref_type == 'tag'
20 changes: 10 additions & 10 deletions crates/subspace-node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ struct GenesisDomainParams {
operator_signing_key: OperatorPublicKey,
}

pub fn gemini_3g_compiled() -> Result<GenericChainSpec<RuntimeGenesisConfig>, String> {
pub fn gemini_3h_compiled() -> Result<GenericChainSpec<RuntimeGenesisConfig>, 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")
Expand Down Expand Up @@ -175,7 +175,7 @@ pub fn gemini_3g_compiled() -> Result<GenericChainSpec<RuntimeGenesisConfig>, 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,
Expand All @@ -200,7 +200,7 @@ pub fn gemini_3g_compiled() -> Result<GenericChainSpec<RuntimeGenesisConfig>, St
.map_err(|error| error.to_string())?,
),
// Protocol ID
Some("subspace-gemini-3g"),
Some("subspace-gemini-3h"),
None,
// Properties
Some({
Expand All @@ -218,8 +218,8 @@ pub fn gemini_3g_compiled() -> Result<GenericChainSpec<RuntimeGenesisConfig>, St
))
}

pub fn gemini_3g_config() -> Result<GenericChainSpec<RuntimeGenesisConfig>, String> {
unimplemented!("Please use release prefixed with gemini-3g")
pub fn gemini_3h_config() -> Result<GenericChainSpec<RuntimeGenesisConfig>, String> {
unimplemented!("Please use release prefixed with gemini-3h")
}

pub fn devnet_config() -> Result<GenericChainSpec<RuntimeGenesisConfig>, String> {
Expand Down Expand Up @@ -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 || {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions crates/subspace-node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ impl SubstrateCli for SubspaceCliPlaceholder {

fn load_spec(&self, id: &str) -> Result<Box<dyn ChainSpec>, 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()?,
Expand Down
4 changes: 2 additions & 2 deletions crates/subspace-node/src/commands/run/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?,
Expand Down
4 changes: 2 additions & 2 deletions crates/subspace-node/src/domain/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}
Expand Down
10 changes: 5 additions & 5 deletions crates/subspace-node/src/domain/evm_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@ pub fn development_config<F: Fn() -> RuntimeGenesisConfig + 'static + Send + Syn
)
}

pub fn gemini_3g_config<F: Fn() -> RuntimeGenesisConfig + 'static + Send + Sync>(
pub fn gemini_3h_config<F: Fn() -> RuntimeGenesisConfig + 'static + Send + Sync>(
constructor: F,
) -> GenericChainSpec<RuntimeGenesisConfig> {
// 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
vec![],
// Telemetry
None,
// Protocol ID
Some("subspace-gemini-3g-evm-domain"),
Some("subspace-gemini-3h-evm-domain"),
None,
// Properties
Some(chain_spec_properties()),
Expand Down Expand Up @@ -122,7 +122,7 @@ pub fn devnet_config<F: Fn() -> RuntimeGenesisConfig + 'static + Send + Sync>(

pub fn load_chain_spec(spec_id: &str) -> Result<Box<dyn sc_cli::ChainSpec>, 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))?,
Expand Down
10 changes: 5 additions & 5 deletions docs/farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 148922f

Please sign in to comment.