diff --git a/Cargo.lock b/Cargo.lock index 90e653e6..eb80e7fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9851,7 +9851,6 @@ dependencies = [ "frame-system", "futures", "hex-literal", - "once_cell", "pallet-rewards", "pallet-subspace", "parity-scale-codec", @@ -9863,7 +9862,6 @@ dependencies = [ "sc-executor", "sc-network", "sc-network-sync", - "sc-proof-of-time", "sc-rpc-api", "sc-service", "sc-storage-monitor", diff --git a/node/Cargo.toml b/node/Cargo.toml index 9a4bff0c..05d7795a 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -20,7 +20,6 @@ fp-evm = { version = "3.0.0-dev", git = "https://github.com/subspace/frontier", frame-system = { version = "4.0.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1" } futures = "0.3" hex-literal = "0.4" -once_cell = "1.18.0" pallet-rewards = { git = "https://github.com/subspace/subspace", rev = "aa2ca80b42b460dd73c1567057d6c07151a626dd" } pallet-subspace = { git = "https://github.com/subspace/subspace", rev = "aa2ca80b42b460dd73c1567057d6c07151a626dd" } parity-scale-codec = "3.6.3" @@ -32,7 +31,6 @@ sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "a sc-executor = { version = "0.10.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1" } sc-network = { version = "0.10.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1" } sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1" } -sc-proof-of-time = { git = "https://github.com/subspace/subspace", rev = "aa2ca80b42b460dd73c1567057d6c07151a626dd" } sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1" } sc-service = { version = "0.10.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1", default-features = false } sc-storage-monitor = { version = "0.1.0", git = "https://github.com/subspace/polkadot-sdk", rev = "892bf8e938c6bd2b893d3827d1093cd81baa59a1", default-features = false } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index f44820dc..3852cf5c 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -12,11 +12,7 @@ use sp_core::crypto::{Ss58Codec, UncheckedFrom}; use sp_domains::storage::RawGenesis; use sp_domains::{OperatorAllowList, RuntimeType}; use sp_runtime::{BuildStorage, Percent}; -use subspace_runtime::{ - AllowAuthoringBy, BalancesConfig, DomainsConfig, GenesisConfig, MaxDomainBlockSize, - MaxDomainBlockWeight, RuntimeConfigsConfig, SubspaceConfig, SudoConfig, SystemConfig, - VestingConfig, MILLISECS_PER_BLOCK, WASM_BINARY, -}; +use subspace_runtime::{AllowAuthoringBy, BalancesConfig, DomainsConfig, MaxDomainBlockSize, MaxDomainBlockWeight, RuntimeConfigsConfig, SubspaceConfig, SudoConfig, SystemConfig, VestingConfig, MILLISECS_PER_BLOCK, WASM_BINARY, RuntimeGenesisConfig}; use subspace_runtime_primitives::{AccountId, Balance, BlockNumber, SSC}; use crate::domains::evm_chain_spec; @@ -59,7 +55,7 @@ pub struct GenesisParams { } /// Chain spec type for the subspace -pub type ChainSpec = SerializableChainSpec; +pub type ChainSpec = SerializableChainSpec; /// Gemini 3f chain spec pub fn gemini_3f() -> ChainSpec { @@ -344,7 +340,7 @@ fn subspace_genesis_config( // who, start, period, period_count, per_period vesting: Vec<(AccountId, BlockNumber, BlockNumber, u32, Balance)>, genesis_params: GenesisParams, -) -> GenesisConfig { +) -> RuntimeGenesisConfig { let GenesisParams { enable_rewards, enable_storage_access, @@ -355,7 +351,7 @@ fn subspace_genesis_config( confirmation_depth_k, } = genesis_params; - let (mut domain_genesis_config, genesis_domain_params) = + let (domain_genesis_config, genesis_domain_params) = evm_chain_spec::get_testnet_genesis_by_spec_id(evm_domain_spec_id); let raw_genesis_storage = { @@ -366,7 +362,7 @@ fn subspace_genesis_config( raw_genesis.encode() }; - GenesisConfig { + RuntimeGenesisConfig { domains: DomainsConfig { genesis_domain: Some(sp_domains::GenesisDomain { runtime_name: "evm".into(), diff --git a/node/src/domains/builder.rs b/node/src/domains/builder.rs index 9a4202c6..4369abe4 100644 --- a/node/src/domains/builder.rs +++ b/node/src/domains/builder.rs @@ -44,8 +44,6 @@ pub struct ConsensusNodeLink { Arc::Hash>>, /// Reference to the consensus node's network sync service pub consensus_sync_service: Arc>, - /// Consensus node's select chain - pub select_chain: FullSelectChain, /// Consensus tx pool pub consensus_transaction_pool: Arc>>, @@ -168,7 +166,6 @@ impl DomainConfig { new_slot_notification_stream, consensus_network_service, consensus_sync_service, - select_chain, consensus_transaction_pool, } = consensus_node_link; let printable_domain_id: u32 = self.domain_id.into(); @@ -345,7 +342,6 @@ impl DomainConfig { let domain_starter = DomainInstanceStarter { service_config, domain_id: self.domain_id, - relayer_id: self.relayer_id.clone(), runtime_type, additional_arguments: self.additional_args.clone(), consensus_client, @@ -353,7 +349,6 @@ impl DomainConfig { new_slot_notification_stream, consensus_network_service, consensus_sync_service, - select_chain, consensus_offchain_tx_pool_factory: OffchainTransactionPoolFactory::new( consensus_transaction_pool.clone(), ), diff --git a/node/src/domains/domain_instance_starter.rs b/node/src/domains/domain_instance_starter.rs index 0c5119cf..2f3474f0 100644 --- a/node/src/domains/domain_instance_starter.rs +++ b/node/src/domains/domain_instance_starter.rs @@ -13,18 +13,17 @@ use sc_consensus_subspace::{BlockImportingNotification, NewSlotNotification}; use sc_service::{BasePath, Configuration, RpcHandlers}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sc_utils::mpsc::{TracingUnboundedReceiver, TracingUnboundedSender}; -use sp_core::crypto::AccountId32; use sp_core::traits::SpawnEssentialNamed; use sp_domains::{DomainId, RuntimeType}; use sp_messenger::messages::ChainId; -use sp_runtime::traits::{Block as BlockT, Convert, NumberFor}; +use sp_runtime::traits::{Block as BlockT, NumberFor}; use subspace_runtime::RuntimeApi as CRuntimeApi; use subspace_runtime_primitives::opaque::Block as CBlock; -use subspace_service::{FullClient as CFullClient, FullSelectChain}; +use subspace_service::FullClient as CFullClient; use tokio::task::JoinHandle; use crate::domains::evm_domain_executor_dispatch::EVMDomainExecutorDispatch; -use crate::domains::utils::{AccountId20, AccountId32ToAccountId20Converter}; +use crate::domains::utils::AccountId20; use crate::ExecutorDispatch as CExecutorDispatch; /// `DomainInstanceStarter` used to start a domain instance node based on the @@ -32,7 +31,6 @@ use crate::ExecutorDispatch as CExecutorDispatch; pub struct DomainInstanceStarter { pub service_config: Configuration, pub domain_id: DomainId, - pub relayer_id: AccountId32, pub runtime_type: RuntimeType, pub additional_arguments: Vec, pub consensus_client: Arc>, @@ -42,7 +40,6 @@ pub struct DomainInstanceStarter { pub consensus_network_service: Arc::Hash>>, pub consensus_sync_service: Arc>, - pub select_chain: FullSelectChain, pub consensus_offchain_tx_pool_factory: OffchainTransactionPoolFactory, pub domain_message_sink: TracingUnboundedSender>, pub domain_message_receiver: TracingUnboundedReceiver>, @@ -57,7 +54,6 @@ impl DomainInstanceStarter { let DomainInstanceStarter { domain_id, runtime_type, - relayer_id, mut additional_arguments, service_config, consensus_client, @@ -65,7 +61,6 @@ impl DomainInstanceStarter { new_slot_notification_stream, consensus_network_service, consensus_sync_service, - select_chain, consensus_offchain_tx_pool_factory, domain_message_receiver, domain_message_sink, diff --git a/node/src/domains/evm_chain_spec.rs b/node/src/domains/evm_chain_spec.rs index 80059e8f..df2143e7 100644 --- a/node/src/domains/evm_chain_spec.rs +++ b/node/src/domains/evm_chain_spec.rs @@ -4,23 +4,19 @@ use std::str::FromStr; use evm_domain_runtime::{ AccountId, BalancesConfig, EVMChainIdConfig, EVMConfig, Precompiles, RuntimeGenesisConfig, - SelfDomainIdConfig, SudoConfig, SystemConfig, WASM_BINARY, + SudoConfig, SystemConfig, WASM_BINARY, }; use hex_literal::hex; -use once_cell::sync::OnceCell; use sc_service::{ChainSpec as _, ChainType}; use sc_subspace_chain_specs::ExecutionChainSpec; use sdk_utils::chain_spec::{ - chain_spec_properties, get_account_id_from_seed, get_public_key_from_seed, + chain_spec_properties, get_public_key_from_seed, }; use sp_core::crypto::UncheckedFrom; use sp_domains::storage::RawGenesis; -use sp_domains::{DomainId, DomainInstanceData, OperatorPublicKey, RuntimeType}; -use sp_runtime::traits::Convert; +use sp_domains::OperatorPublicKey; use subspace_runtime_primitives::SSC; -use crate::domains::utils::AccountId32ToAccountId20Converter; - /// Chain spec type for the system domain pub type ChainSpec = ExecutionChainSpec; @@ -52,11 +48,6 @@ pub fn create_domain_spec(chain_id: &str, raw_genesis: RawGenesis) -> Result> = OnceCell::new(); - /// Development keys that will be injected automatically on polkadotjs apps fn get_dev_accounts() -> Vec { vec![ @@ -82,12 +73,6 @@ pub fn get_testnet_genesis_by_spec_id( accounts.clone(), // Alith is Sudo Some(accounts[0]), - vec![( - accounts[0], - AccountId32ToAccountId20Converter::convert(get_account_id_from_seed( - "Alice", - )), - )], 1000, ), GenesisDomainParams { @@ -105,7 +90,6 @@ pub fn get_testnet_genesis_by_spec_id( sudo_account, ], Some(sudo_account), - Default::default(), 1002, ), GenesisDomainParams { @@ -125,11 +109,6 @@ pub fn get_testnet_genesis_by_spec_id( sudo_account, ], Some(sudo_account), - vec![( - sudo_account, - AccountId::from_str("5b267fd1ba3ace6e3c3234f9576c49c877b5beb9") - .expect("Wrong relayer account address"), - )], 1003, ), GenesisDomainParams { @@ -146,7 +125,6 @@ pub fn get_testnet_genesis_by_spec_id( accounts.clone(), // Alith is sudo Some(accounts[0]), - vec![(accounts[0], accounts[0]), (accounts[1], accounts[1])], 1001, ), GenesisDomainParams { @@ -254,7 +232,6 @@ pub fn devnet_config RuntimeGenesisConfig + 'static + Send + Sync>( fn testnet_genesis( endowed_accounts: Vec, maybe_sudo_account: Option, - relayers: Vec<(AccountId, AccountId)>, chain_id: u64, ) -> RuntimeGenesisConfig { // This is the simplest bytecode to revert without returning any data. diff --git a/node/src/lib.rs b/node/src/lib.rs index 87645649..527e5a81 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -51,7 +51,7 @@ pub use builder::*; pub use domains::builder::{DomainConfig, DomainConfigBuilder}; pub use domains::domain::Domain; pub use subspace_runtime::RuntimeEvent as Event; -use tracing::{log, Instrument}; +use tracing::Instrument; use crate::domains::builder::ConsensusNodeLink; @@ -219,7 +219,7 @@ impl Config { network_service, backend: _, - select_chain, + select_chain: _, reward_signing_notification_stream: _, archived_segment_notification_stream: _, transaction_pool, @@ -280,7 +280,6 @@ impl Config { new_slot_notification_stream: new_slot_notification_stream.clone(), consensus_network_service: network_service.clone(), consensus_sync_service: sync_service.clone(), - select_chain: select_chain.clone(), consensus_transaction_pool: transaction_pool.clone(), }, ) @@ -573,7 +572,7 @@ impl Node { .build(); let check_synced_backoff = backoff::ExponentialBackoffBuilder::new() .with_initial_interval(Duration::from_secs(1)) - .with_max_elapsed_time(Some(Duration::from_secs(5*60))) + .with_max_elapsed_time(Some(Duration::from_secs(10*60))) .build(); backoff::future::retry(check_offline_backoff, || {