Skip to content

Commit 4f9c7ed

Browse files
authored
Merge pull request #3674 from autonomys/chronos_testnet
Chronos Testnet chainspec
2 parents c153c82 + 6517715 commit 4f9c7ed

File tree

16 files changed

+136
-173
lines changed

16 files changed

+136
-173
lines changed

.github/workflows/domain-genesis-storage-snapshot-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
push:
99
tags:
1010
- 'domain-genesis-storage-snapshot-*'
11-
- 'domain-genesis-storage-taurus-*'
11+
- 'domain-genesis-storage-chronos-*'
1212
- 'domain-genesis-storage-mainnet-*'
1313

1414
jobs:
@@ -35,10 +35,10 @@ jobs:
3535
run: |
3636
EVM_SPEC_VERSION=$(sed -nr 's/.*spec_version: ([0-9]+),/\1/p' domains/runtime/evm/src/lib.rs)
3737
AUTO_ID_SPEC_VERSION=$(sed -nr 's/.*spec_version: ([0-9]+),/\1/p' domains/runtime/auto-id/src/lib.rs)
38-
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type evm --chain taurus > evm-domain-genesis-storage-taurus-v$EVM_SPEC_VERSION
38+
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type evm --chain chronos > evm-domain-genesis-storage-chronos-v$EVM_SPEC_VERSION
3939
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type evm --chain devnet > evm-domain-genesis-storage-devnet-v$EVM_SPEC_VERSION
4040
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type evm --chain mainnet > evm-domain-genesis-storage-mainnet-v$EVM_SPEC_VERSION
41-
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type auto-id --chain taurus > auto-id-domain-genesis-storage-taurus-v$AUTO_ID_SPEC_VERSION
41+
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type auto-id --chain chronos > auto-id-domain-genesis-storage-chronos-v$AUTO_ID_SPEC_VERSION
4242
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type auto-id --chain devnet > auto-id-domain-genesis-storage-devnet-v$AUTO_ID_SPEC_VERSION
4343
docker run --rm -u root ${{ steps.build.outputs.digest }} domain build-genesis-storage --runtime-type auto-id --chain mainnet > auto-id-domain-genesis-storage-mainnet-v$AUTO_ID_SPEC_VERSION
4444
echo "EVM_SPEC_VERSION=$EVM_SPEC_VERSION" >> $GITHUB_ENV
@@ -49,10 +49,10 @@ jobs:
4949
with:
5050
name: domain-genesis-storage
5151
path: |
52-
evm-domain-genesis-storage-taurus-v${{ env.EVM_SPEC_VERSION }}
52+
evm-domain-genesis-storage-chronos-v${{ env.EVM_SPEC_VERSION }}
5353
evm-domain-genesis-storage-devnet-v${{ env.EVM_SPEC_VERSION }}
5454
evm-domain-genesis-storage-mainnet-v${{ env.EVM_SPEC_VERSION }}
55-
auto-id-domain-genesis-storage-taurus-v${{ env.AUTO_ID_SPEC_VERSION }}
55+
auto-id-domain-genesis-storage-chronos-v${{ env.AUTO_ID_SPEC_VERSION }}
5656
auto-id-domain-genesis-storage-devnet-v${{ env.AUTO_ID_SPEC_VERSION }}
5757
auto-id-domain-genesis-storage-mainnet-v${{ env.AUTO_ID_SPEC_VERSION }}
5858
if-no-files-found: error
@@ -62,6 +62,6 @@ jobs:
6262
env:
6363
GITHUB_TOKEN: ${{ github.token }}
6464
with:
65-
asset_paths: '["evm-domain-genesis-storage-mainnet-v${{ env.EVM_SPEC_VERSION }}", "evm-domain-genesis-storage-taurus-v${{ env.EVM_SPEC_VERSION }}", "evm-domain-genesis-storage-devnet-v${{ env.EVM_SPEC_VERSION }}", "auto-id-domain-genesis-storage-mainnet-v${{ env.AUTO_ID_SPEC_VERSION }}", "auto-id-domain-genesis-storage-taurus-v${{ env.AUTO_ID_SPEC_VERSION }}", "auto-id-domain-genesis-storage-devnet-v${{ env.AUTO_ID_SPEC_VERSION }}"]'
65+
asset_paths: '["evm-domain-genesis-storage-mainnet-v${{ env.EVM_SPEC_VERSION }}", "evm-domain-genesis-storage-chronos-v${{ env.EVM_SPEC_VERSION }}", "evm-domain-genesis-storage-devnet-v${{ env.EVM_SPEC_VERSION }}", "auto-id-domain-genesis-storage-mainnet-v${{ env.AUTO_ID_SPEC_VERSION }}", "auto-id-domain-genesis-storage-chronos-v${{ env.AUTO_ID_SPEC_VERSION }}", "auto-id-domain-genesis-storage-devnet-v${{ env.AUTO_ID_SPEC_VERSION }}"]'
6666
# Only run for releases
6767
if: github.event_name == 'push' && github.ref_type == 'tag'

.github/workflows/runtime-snapshot-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
push:
1010
tags:
1111
- "runtime-snapshot-*"
12-
- "runtime-taurus-*"
12+
- "runtime-chronos-*"
1313
- "runtime-mainnet-*"
1414

1515
jobs:

.github/workflows/snapshot-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
push:
1111
tags:
1212
- "snapshot-*"
13-
- "taurus-*"
13+
- "chronos-*"
1414
- "mainnet-*"
1515

1616
# Incremental compilation here isn't helpful

crates/sc-subspace-chain-specs/res/chain-spec-raw-chronos.json

Lines changed: 89 additions & 0 deletions
Large diffs are not rendered by default.

crates/sc-subspace-chain-specs/res/chain-spec-raw-taurus.json

Lines changed: 0 additions & 88 deletions
This file was deleted.

crates/sc-subspace-chain-specs/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
33
/// Devnet chain spec
44
pub const DEVNET_CHAIN_SPEC: &str = include_str!("../res/chain-spec-raw-devnet.json");
5-
pub const TAURUS_CHAIN_SPEC: &str = include_str!("../res/chain-spec-raw-taurus.json");
65
pub const MAINNET_CHAIN_SPEC: &str = include_str!("../res/chain-spec-raw-mainnet.json");
6+
pub const CHRONOS_CHAIN_SPEC: &str = include_str!("../res/chain-spec-raw-chronos.json");

crates/subspace-node/src/chain_spec.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::domain::cli::{GenesisDomain, SpecId};
55
use crate::domain::evm_chain_spec::{self};
66
use sc_chain_spec::GenericChainSpec;
77
use sc_service::ChainType;
8-
use sc_subspace_chain_specs::{DEVNET_CHAIN_SPEC, MAINNET_CHAIN_SPEC, TAURUS_CHAIN_SPEC};
8+
use sc_subspace_chain_specs::{CHRONOS_CHAIN_SPEC, DEVNET_CHAIN_SPEC, MAINNET_CHAIN_SPEC};
99
use sc_telemetry::TelemetryEndpoints;
1010
use serde::Deserialize;
1111
use sp_core::crypto::Ss58Codec;
@@ -250,8 +250,8 @@ pub fn mainnet_config() -> Result<GenericChainSpec, String> {
250250
GenericChainSpec::from_json_bytes(MAINNET_CHAIN_SPEC.as_bytes())
251251
}
252252

253-
pub fn taurus_config() -> Result<GenericChainSpec, String> {
254-
GenericChainSpec::from_json_bytes(TAURUS_CHAIN_SPEC.as_bytes())
253+
pub fn chronos_config() -> Result<GenericChainSpec, String> {
254+
GenericChainSpec::from_json_bytes(CHRONOS_CHAIN_SPEC.as_bytes())
255255
}
256256

257257
pub fn devnet_config() -> Result<GenericChainSpec, String> {
@@ -313,7 +313,6 @@ pub fn devnet_config_compiled() -> Result<GenericChainSpec, String> {
313313
]),
314314
genesis_domains: vec![evm_chain_spec::get_genesis_domain(
315315
SpecId::DevNet,
316-
sudo_account.clone(),
317316
EvmType::Public,
318317
)?],
319318
},
@@ -379,7 +378,6 @@ pub fn dev_config() -> Result<GenericChainSpec, String> {
379378
]),
380379
genesis_domains: vec![evm_chain_spec::get_genesis_domain(
381380
SpecId::Dev,
382-
sudo_account,
383381
// TODO: in production configs, set this to Public, unless we specifically want a private EVM
384382
EvmType::Private {
385383
initial_contract_creation_allow_list:

crates/subspace-node/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl SubstrateCli for SubspaceCliPlaceholder {
8585
let chain_spec = match id {
8686
"mainnet-compiled" => chain_spec::mainnet_compiled()?,
8787
"mainnet" => chain_spec::mainnet_config()?,
88-
"taurus" => chain_spec::taurus_config()?,
88+
"chronos" => chain_spec::chronos_config()?,
8989
"devnet" => chain_spec::devnet_config()?,
9090
"devnet-compiled" => chain_spec::devnet_config_compiled()?,
9191
"dev" => chain_spec::dev_config()?,

crates/subspace-node/src/commands/run/consensus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ pub(super) fn create_consensus_chain_configuration(
586586
let chain_spec = match chain.as_deref() {
587587
Some("mainnet-compiled") => chain_spec::mainnet_compiled()?,
588588
Some("mainnet") => chain_spec::mainnet_config()?,
589-
Some("taurus") => chain_spec::taurus_config()?,
589+
Some("chronos") => chain_spec::chronos_config()?,
590590
Some("devnet") => chain_spec::devnet_config()?,
591591
Some("devnet-compiled") => chain_spec::devnet_config_compiled()?,
592592
Some("dev") => chain_spec::dev_config()?,

crates/subspace-node/src/domain/auto_id_chain_spec.rs

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use sp_domains::storage::RawGenesis;
1515
use sp_domains::{DomainRuntimeConfig, OperatorAllowList, OperatorPublicKey, RuntimeType};
1616
use sp_runtime::BuildStorage;
1717
use sp_runtime::traits::Convert;
18-
use std::collections::BTreeSet;
1918
use subspace_runtime_primitives::{AI3, Balance};
2019

2120
/// Development keys that will be injected automatically on polkadotjs apps
@@ -46,21 +45,21 @@ pub fn development_config(
4645
.build())
4746
}
4847

49-
pub fn taurus_config(
48+
pub fn chronos_config(
5049
runtime_genesis_config: RuntimeGenesisConfig,
5150
) -> Result<GenericChainSpec, String> {
5251
Ok(GenericChainSpec::builder(
5352
WASM_BINARY.ok_or_else(|| "WASM binary was not build, please build it!".to_string())?,
5453
None,
5554
)
56-
.with_name("Autonomys Taurus AutoId Domain")
57-
.with_id("autonomys_taurus_auto_id_domain")
55+
.with_name("Autonomys Chronos AutoId Domain")
56+
.with_id("autonomys_chronos_auto_id_domain")
5857
.with_chain_type(ChainType::Live)
5958
.with_genesis_config(
6059
serde_json::to_value(runtime_genesis_config)
6160
.map_err(|error| format!("Failed to serialize genesis config: {error}"))?,
6261
)
63-
.with_protocol_id("autonomys-taurus-auto-id-domain")
62+
.with_protocol_id("autonomys-chronos-auto-id-domain")
6463
.with_properties(chain_spec_properties())
6564
.build())
6665
}
@@ -105,7 +104,7 @@ pub fn devnet_config(
105104

106105
pub fn load_chain_spec(spec_id: &str) -> Result<Box<dyn sc_cli::ChainSpec>, String> {
107106
let chain_spec = match spec_id {
108-
"taurus" => taurus_config(get_testnet_genesis_by_spec_id(SpecId::Taurus))?,
107+
"chronos" => chronos_config(get_testnet_genesis_by_spec_id(SpecId::Chronos))?,
109108
"devnet" => devnet_config(get_testnet_genesis_by_spec_id(SpecId::DevNet))?,
110109
"dev" => development_config(get_testnet_genesis_by_spec_id(SpecId::Dev))?,
111110
"mainnet" => mainnet_config(get_testnet_genesis_by_spec_id(SpecId::Mainnet))?,
@@ -129,7 +128,7 @@ pub fn get_testnet_endowed_accounts_by_spec_id(spec_id: SpecId) -> Vec<(MultiAcc
129128
let alice_account = accounts[0].clone();
130129
vec![(AccountIdConverter::convert(alice_account), 1_000_000 * AI3)]
131130
}
132-
SpecId::Taurus | SpecId::Mainnet => vec![],
131+
SpecId::Chronos | SpecId::Mainnet => vec![],
133132
}
134133
}
135134

@@ -141,55 +140,41 @@ fn empty_genesis() -> RuntimeGenesisConfig {
141140
}
142141
}
143142

144-
fn get_operator_params(
145-
spec_id: SpecId,
146-
sudo_account: subspace_runtime_primitives::AccountId,
147-
) -> GenesisOperatorParams {
143+
fn get_operator_params(spec_id: SpecId) -> GenesisOperatorParams {
148144
match spec_id {
149145
SpecId::Dev => GenesisOperatorParams {
150146
operator_allow_list: OperatorAllowList::Anyone,
151147
operator_signing_key: get_public_key_from_seed::<OperatorPublicKey>("Alice"),
152148
},
153-
SpecId::Taurus => GenesisOperatorParams {
154-
operator_allow_list: OperatorAllowList::Operators(BTreeSet::from_iter(vec![
155-
sudo_account.clone(),
156-
])),
157-
operator_signing_key: OperatorPublicKey::unchecked_from(hex!(
158-
"3458e79cd1f106a4a7eaed78b46fe97dffcf0f619d1278a4dd4e4c9e862fc348"
159-
)),
160-
},
161149
SpecId::DevNet => GenesisOperatorParams {
162150
operator_allow_list: OperatorAllowList::Anyone,
163151
operator_signing_key: OperatorPublicKey::unchecked_from(hex!(
164152
"18df97b9335e11f239f8f3f8041819d42f27b60845cf209416fdba8de15f4b7c"
165153
)),
166154
},
167-
// mainnet should never be called for genesis domain instantiation since
168-
// actual consensus mainnet has no genesis domains.
169-
SpecId::Mainnet => {
170-
panic!("mainnet domains does not have any operator parameters")
155+
// mainnet/chronos should never be called for genesis domain instantiation since
156+
// actual consensus mainnet/chronos testnet has no genesis domains.
157+
SpecId::Mainnet | SpecId::Chronos => {
158+
panic!("mainnet/chronos domains does not have any operator parameters")
171159
}
172160
}
173161
}
174162

175163
/// Returns AutoId genesis domain.
176164
/// Note: Currently unused since dev or devnet uses EVM domain and not AutoId
177165
#[expect(dead_code)]
178-
pub fn get_genesis_domain(
179-
spec_id: SpecId,
180-
sudo_account: subspace_runtime_primitives::AccountId,
181-
) -> Result<GenesisDomain, String> {
166+
pub fn get_genesis_domain(spec_id: SpecId) -> Result<GenesisDomain, String> {
182167
let chain_spec = match spec_id {
183168
SpecId::Dev => development_config(get_testnet_genesis_by_spec_id(spec_id))?,
184-
SpecId::Taurus => taurus_config(get_testnet_genesis_by_spec_id(spec_id))?,
169+
SpecId::Chronos => chronos_config(get_testnet_genesis_by_spec_id(spec_id))?,
185170
SpecId::DevNet => devnet_config(get_testnet_genesis_by_spec_id(spec_id))?,
186171
SpecId::Mainnet => return Err("No genesis domain available for mainnet spec.".to_string()),
187172
};
188173

189174
let GenesisOperatorParams {
190175
operator_allow_list,
191176
operator_signing_key,
192-
} = get_operator_params(spec_id, sudo_account);
177+
} = get_operator_params(spec_id);
193178

194179
let storage = chain_spec
195180
.build_storage()

0 commit comments

Comments
 (0)