Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
3 changes: 1 addition & 2 deletions examples/aura/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
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,
Expand Down Expand Up @@ -336,6 +336,5 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
);
}

network_starter.start_network();
Ok(task_manager)
}
3 changes: 1 addition & 2 deletions examples/babe/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -576,7 +576,6 @@ pub fn new_full_base(
);
}

network_starter.start_network();
Ok(NewFullBase {
task_manager,
client,
Expand Down
9 changes: 7 additions & 2 deletions examples/babe/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockNumber, BlakeTwo256>;
/// Opaque block type.
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// Opaque block identifier type.
pub type BlockId = generic::BlockId<Block>;
/// Opaque block hash type.
pub type Hash = <BlakeTwo256 as sp_runtime::traits::Hash>::Output;
}

/// Max size for serialized extrinsic params for this testing runtime.
Expand Down Expand Up @@ -447,6 +449,7 @@ impl pallet_session::Config for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type WeightInfo = pallet_session::weights::SubstrateWeight<Runtime>;
type DisablingStrategy = ();
}

impl pallet_session::historical::Config for Runtime {
Expand Down Expand Up @@ -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! {
Expand Down
5 changes: 3 additions & 2 deletions examples/parachain/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async fn start_node_impl(
>::new(
&parachain_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: &parachain_config,
net_config,
Expand Down Expand Up @@ -326,7 +326,7 @@ async fn start_node_impl(
)?;
}

start_network.start_network();
// Network starts automatically

Ok((task_manager, client))
}
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 2 additions & 0 deletions examples/parachain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ impl pallet_session::Config for Runtime {
type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::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 {
Expand Down
2 changes: 2 additions & 0 deletions examples/parachain/runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ impl staging_xcm_executor::Config for XcmConfig {
type UniversalLocation = UniversalLocation;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type XcmEventEmitter = PolkadotXcm;
type Trader =
UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = PolkadotXcm;
Expand Down Expand Up @@ -248,6 +249,7 @@ impl pallet_xcm::Config for Runtime {
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type UniversalLocation = UniversalLocation;
type RuntimeOrigin = RuntimeOrigin;
type AuthorizedAliasConsideration = ();
type RuntimeCall = RuntimeCall;

const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
Expand Down
7 changes: 2 additions & 5 deletions runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "simnode-runtime-api"
version = "2412.0.0"
version = "2503.0.0"
authors = ["Polytope Labs <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -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"]
6 changes: 3 additions & 3 deletions simnode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sc-simnode"
version = "2412.0.0"
version = "2503.0.0"
authors = ["Polytope Labs <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -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 }

Expand Down
4 changes: 1 addition & 3 deletions simnode/src/client/aura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -181,8 +181,6 @@ where
};
spawn_tasks(params)?;

_network_starter.start_network();

let task = run_manual_seal(ManualSealParams {
block_import,
env,
Expand Down
4 changes: 1 addition & 3 deletions simnode/src/client/babe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ where
let metrics = <sc_network::Litep2pNetworkBackend as NetworkBackend<B, B::Hash>>::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,
Expand Down Expand Up @@ -187,8 +187,6 @@ where
};
spawn_tasks(params)?;

_network_starter.start_network();

let babe_consensus = BabeConsensusDataProvider::new(
client.clone(),
keystore_container.keystore(),
Expand Down
4 changes: 1 addition & 3 deletions simnode/src/client/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ where
let metrics = <sc_network::Litep2pNetworkBackend as NetworkBackend<B, B::Hash>>::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,
Expand Down Expand Up @@ -320,8 +320,6 @@ where
};
spawn_tasks(params)?;

_network_starter.start_network();

let task = run_manual_seal(ManualSealParams {
block_import,
env,
Expand Down
Loading