diff --git a/Cargo.toml b/Cargo.toml index 7f697f9..757e3c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,35 +5,38 @@ members = [ "runtime-api", "tests", - # parachain + # parachain "examples/parachain/node", "examples/parachain/runtime", - # aura - "examples/aura/node", - "examples/aura/runtime", + # aura + "examples/aura/node", + "examples/aura/runtime", - # babe - "examples/babe/node", - "examples/babe/runtime", - "examples/babe/rpc", + # babe + "examples/babe/node", + "examples/babe/runtime", + "examples/babe/rpc", ] [workspace.dependencies] codec = { version = "3.1.3", package = "parity-scale-codec", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.1.1", default-features = false, features = [ + "derive", +] } jsonrpsee = "0.24" -polkadot-sdk = { version = "0.12.2", default-features = false } +polkadot-sdk = { version = "=2503.0.1", default-features = false } # crates which cannot be used from polkadot-sdk -sp-core = { version = "35.0.0", default-features = false } -sp-runtime-interface = { version = "29.0.0", default-features = false } -cumulus-pallet-parachain-system = { version = "0.18.1", default-features = false } -substrate-wasm-builder = "25.0.0" -sc-service = "0.49.0" -sc-tracing = "38.0.0" -sp-api-proc-macro = "21.0.0" +sp-core = { version = "36.1.0", default-features = false } +sp-runtime-interface = { version = "29.0.1", default-features = false } +cumulus-pallet-parachain-system = { version = "0.20.0", default-features = false } +substrate-wasm-builder = "26.0.0" +sc-service = "0.50.0" +sc-network-sync = "0.48.0" +sc-tracing = "39.0.0" +sp-api-proc-macro = "22.0.0" # local crates -simnode-runtime-api = { path = "./runtime-api", version = "2412.0.0", default-features = false } -sc-simnode = { path = "./simnode", version = "2412.0.0" } +simnode-runtime-api = { path = "./runtime-api", version = "2503.0.0", default-features = false } +sc-simnode = { path = "./simnode", version = "2503.0.0" } diff --git a/examples/aura/node/src/service.rs b/examples/aura/node/src/service.rs index 153985f..51cfb9e 100644 --- a/examples/aura/node/src/service.rs +++ b/examples/aura/node/src/service.rs @@ -176,7 +176,7 @@ pub fn new_full(config: Configuration) -> Result { Vec::default(), )); - let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = + let (network, system_rpc_tx, tx_handler_controller, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, net_config, @@ -336,6 +336,5 @@ pub fn new_full(config: Configuration) -> Result { ); } - network_starter.start_network(); Ok(task_manager) } diff --git a/examples/babe/node/src/service.rs b/examples/babe/node/src/service.rs index f91b68b..a215b08 100644 --- a/examples/babe/node/src/service.rs +++ b/examples/babe/node/src/service.rs @@ -391,7 +391,7 @@ pub fn new_full_base( Vec::default(), )); - let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = + let (network, system_rpc_tx, tx_handler_controller, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, net_config, @@ -576,7 +576,6 @@ pub fn new_full_base( ); } - network_starter.start_network(); Ok(NewFullBase { task_manager, client, diff --git a/examples/babe/runtime/src/lib.rs b/examples/babe/runtime/src/lib.rs index 6fae4d2..c30379e 100644 --- a/examples/babe/runtime/src/lib.rs +++ b/examples/babe/runtime/src/lib.rs @@ -166,15 +166,17 @@ pub type Executive = frame_executive::Executive< /// to even the core data structures. pub mod opaque { use super::*; + use sp_runtime::{generic, traits::BlakeTwo256}; pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - /// Opaque block header type. pub type Header = generic::Header; /// Opaque block type. pub type Block = generic::Block; /// Opaque block identifier type. pub type BlockId = generic::BlockId; + /// Opaque block hash type. + pub type Hash = ::Output; } /// Max size for serialized extrinsic params for this testing runtime. @@ -447,6 +449,7 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = pallet_session::weights::SubstrateWeight; + type DisablingStrategy = (); } impl pallet_session::historical::Config for Runtime { @@ -511,7 +514,9 @@ impl pallet_staking::Config for Runtime { type EventListeners = (); type BenchmarkingConfig = StakingBenchmarkingConfig; type WeightInfo = (); - type DisablingStrategy = pallet_staking::UpToLimitDisablingStrategy; + type OldCurrency = Balances; + type RuntimeHoldReason = RuntimeHoldReason; + type Filter = (); } parameter_types! { diff --git a/examples/parachain/node/src/service.rs b/examples/parachain/node/src/service.rs index 5a1e900..c30242c 100644 --- a/examples/parachain/node/src/service.rs +++ b/examples/parachain/node/src/service.rs @@ -180,7 +180,7 @@ async fn start_node_impl( >::new( ¶chain_config.network, parachain_config.prometheus_registry().cloned() ); - let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = + let (network, system_rpc_tx, tx_handler_controller, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, net_config, @@ -326,7 +326,7 @@ async fn start_node_impl( )?; } - start_network.start_network(); + // Network starts automatically Ok((task_manager, client)) } @@ -427,6 +427,7 @@ fn start_consensus( collator_service, // Async backing time authoring_duration: Duration::from_millis(1500), + max_pov_percentage: Some(100), }; let fut = diff --git a/examples/parachain/runtime/src/lib.rs b/examples/parachain/runtime/src/lib.rs index 57ebee1..fea8eb5 100644 --- a/examples/parachain/runtime/src/lib.rs +++ b/examples/parachain/runtime/src/lib.rs @@ -463,6 +463,8 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = (); + // Disable validator slots when they get kicked from the CollatorSelection pallet + type DisablingStrategy = (); } impl pallet_aura::Config for Runtime { diff --git a/examples/parachain/runtime/src/xcm_config.rs b/examples/parachain/runtime/src/xcm_config.rs index d45c9d6..f3880a2 100644 --- a/examples/parachain/runtime/src/xcm_config.rs +++ b/examples/parachain/runtime/src/xcm_config.rs @@ -198,6 +198,7 @@ impl staging_xcm_executor::Config for XcmConfig { type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = FixedWeightBounds; + type XcmEventEmitter = PolkadotXcm; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -248,6 +249,7 @@ impl pallet_xcm::Config for Runtime { type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; type RuntimeOrigin = RuntimeOrigin; + type AuthorizedAliasConsideration = (); type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; diff --git a/runtime-api/Cargo.toml b/runtime-api/Cargo.toml index a617b54..a965338 100644 --- a/runtime-api/Cargo.toml +++ b/runtime-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simnode-runtime-api" -version = "2412.0.0" +version = "2503.0.0" authors = ["Polytope Labs "] edition = "2021" license = "Apache-2.0" @@ -17,7 +17,4 @@ polkadot-sdk = { workspace = true, features = ["sp-api", "sp-std"] } [features] default = ["std"] -std = [ - "codec/std", - "polkadot-sdk/std", -] +std = ["codec/std", "polkadot-sdk/std"] diff --git a/simnode/Cargo.toml b/simnode/Cargo.toml index 0ccb540..dba70d0 100644 --- a/simnode/Cargo.toml +++ b/simnode/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sc-simnode" -version = "2412.0.0" +version = "2503.0.0" authors = ["Polytope Labs "] edition = "2021" license = "Apache-2.0" @@ -20,9 +20,9 @@ rand = "0.8.5" futures = "0.3.16" tokio = { version = "1.13", features = ["signal"] } clap = { version = "4.0.9", features = ["derive"] } -jsonrpsee = { workspace = true, features = ["server", "client-core", "macros"] } +jsonrpsee = { workspace = true, features = ["server", "client-core", "macros"] } -sc-service = { workspace = true, features = ["test-helpers"] } +sc-service = { workspace = true } sp-runtime-interface = { workspace = true, default-features = true } simnode-runtime-api = { workspace = true, default-features = true } diff --git a/simnode/src/client/aura.rs b/simnode/src/client/aura.rs index 6a00207..39b0b5c 100644 --- a/simnode/src/client/aura.rs +++ b/simnode/src/client/aura.rs @@ -104,7 +104,7 @@ where config.prometheus_registry(), ); - let (network, system_rpc_tx, tx_handler_controller, _network_starter, sync_service) = { + let (network, system_rpc_tx, tx_handler_controller, sync_service) = { let params = BuildNetworkParams { config: &config, net_config, @@ -181,8 +181,6 @@ where }; spawn_tasks(params)?; - _network_starter.start_network(); - let task = run_manual_seal(ManualSealParams { block_import, env, diff --git a/simnode/src/client/babe.rs b/simnode/src/client/babe.rs index 19818c6..7f8a798 100644 --- a/simnode/src/client/babe.rs +++ b/simnode/src/client/babe.rs @@ -109,7 +109,7 @@ where let metrics = >::register_notification_metrics( config.prometheus_registry(), ); - let (network, system_rpc_tx, tx_handler_controller, _network_starter, sync_service) = { + let (network, system_rpc_tx, tx_handler_controller, sync_service) = { let params = BuildNetworkParams { config: &config, net_config, @@ -187,8 +187,6 @@ where }; spawn_tasks(params)?; - _network_starter.start_network(); - let babe_consensus = BabeConsensusDataProvider::new( client.clone(), keystore_container.keystore(), diff --git a/simnode/src/client/parachain.rs b/simnode/src/client/parachain.rs index 113468e..81de9ee 100644 --- a/simnode/src/client/parachain.rs +++ b/simnode/src/client/parachain.rs @@ -236,7 +236,7 @@ where let metrics = >::register_notification_metrics( config.prometheus_registry(), ); - let (network, system_rpc_tx, tx_handler_controller, _network_starter, sync_service) = { + let (network, system_rpc_tx, tx_handler_controller, sync_service) = { let params = BuildNetworkParams { config: &config, net_config, @@ -320,8 +320,6 @@ where }; spawn_tasks(params)?; - _network_starter.start_network(); - let task = run_manual_seal(ManualSealParams { block_import, env,