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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- name: Checkout sources
uses: actions/checkout@main

- name: Install stable toolchain
- name: Install pinned toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: "1.94.1"
targets: wasm32-unknown-unknown,wasm32v1-none
components: rust-src

Expand All @@ -39,10 +39,10 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
- name: Install pinned toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: "1.94.1"
targets: wasm32-unknown-unknown,wasm32v1-none
components: rust-src

Expand Down
23 changes: 13 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ scale-info = { version = "2.1.1", default-features = false, features = [
"derive",
] }
jsonrpsee = "0.24"
polkadot-sdk = { version = "2512.1.0", default-features = false }
polkadot-sdk = { version = "2604.2.0", default-features = false }

# crates which cannot be used from polkadot-sdk
sp-core = { version = "39.0.0", default-features = false }
sp-runtime-interface = { version = "33.0.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.25.0", default-features = false }
substrate-wasm-builder = "31.1.0"
sc-service = "0.56.0"
sc-network-sync = "0.54.0"
sc-tracing = "44.0.0"
sp-core = { version = "41.0.0", default-features = false }
sp-runtime-interface = { version = "35.0.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.28.0", default-features = false }
substrate-wasm-builder = "33.0.0"
sc-service = "0.59.0"
sc-network-sync = "0.56.1"
sc-tracing = "46.0.0"

# local crates
simnode-runtime-api = { path = "./runtime-api", version = "2512.0.0", default-features = false }
sc-simnode = { path = "./simnode", version = "2512.0.0" }
simnode-runtime-api = { path = "./runtime-api", version = "2604.0.0", default-features = false }
sc-simnode = { path = "./simnode", version = "2604.0.0" }

[patch.crates-io]
core2 = { git = "https://github.com/technocreatives/core2", rev = "545e84bcb0f235b12e21351e0c69767958efe2a7" }
2 changes: 2 additions & 0 deletions examples/aura/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ where
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
Default::default(),
)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -183,6 +184,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
spawn_essential_handle: task_manager.spawn_essential_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_config: Some(WarpSyncConfig::WithProvider(warp_sync)),
Expand Down
4 changes: 2 additions & 2 deletions examples/aura/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ impl_runtime_apis! {
}

impl sp_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
opaque::SessionKeys::generate(seed)
fn generate_session_keys(owner: Vec<u8>, seed: Option<Vec<u8>>) -> sp_session::OpaqueGeneratedSessionKeys {
opaque::SessionKeys::generate(&owner, seed).into()
}

fn decode_session_keys(
Expand Down
38 changes: 25 additions & 13 deletions examples/babe/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ use sp_core::{crypto::Pair, traits::CodeExecutor, H256};
use sp_runtime::{generic, SaturatedConversion};
use std::{path::Path, sync::Arc};

/// Retention period for transaction storage proofs.
///
/// This runtime has no transaction storage pallet to source the value from, so we keep the
/// `DEFAULT_STORAGE_PERIOD` that `sp-transaction-storage-proof` applied internally before it
/// became a caller-supplied parameter.
const STORAGE_PROOF_RETENTION_PERIOD: u32 = 100_800;

/// The full client type definition.
pub type FullClient<E = WasmExecutor<sp_io::SubstrateHostFunctions>> =
sc_service::TFullClient<Block, RuntimeApi, E>;
Expand All @@ -65,27 +72,32 @@ impl BabeInherentDataProvider {

#[async_trait::async_trait]
impl sp_inherents::CreateInherentDataProviders<Block, ()> for BabeInherentDataProvider {
type InherentDataProviders = (
sp_consensus_babe::inherents::InherentDataProvider,
sp_timestamp::InherentDataProvider,
);
type InherentDataProviders =
(sp_consensus_babe::inherents::InherentDataProvider, sp_timestamp::InherentDataProvider);

async fn create_inherent_data_providers(
&self,
_parent: <Block as sp_runtime::traits::Block>::Hash,
_extra_args: (),
) -> Result<Self::InherentDataProviders, Box<dyn std::error::Error + Send + Sync>> {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot = sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
self.slot_duration,
);
let slot =
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
self.slot_duration,
);
Ok((slot, timestamp))
}
}

type FullBabeBlockImport<E = WasmExecutor<sp_io::SubstrateHostFunctions>> =
sc_consensus_babe::BabeBlockImport<Block, FullClient<E>, FullGrandpaBlockImport<E>, BabeInherentDataProvider, FullSelectChain>;
sc_consensus_babe::BabeBlockImport<
Block,
FullClient<E>,
FullGrandpaBlockImport<E>,
BabeInherentDataProvider,
FullSelectChain,
>;

/// Our native executor instance.
pub struct ExecutorDispatch;
Expand Down Expand Up @@ -231,6 +243,7 @@ where
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
Default::default(),
)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -364,10 +377,7 @@ pub struct NewFullBase {
pub fn new_full_base(
config: Configuration,
disable_hardware_benchmarks: bool,
with_startup_data: impl FnOnce(
&FullBabeBlockImport,
&sc_consensus_babe::BabeLink<Block>,
),
with_startup_data: impl FnOnce(&FullBabeBlockImport, &sc_consensus_babe::BabeLink<Block>),
) -> Result<NewFullBase, ServiceError> {
let hwbench = (!disable_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
Expand Down Expand Up @@ -426,6 +436,7 @@ pub fn new_full_base(
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
spawn_essential_handle: task_manager.spawn_essential_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_config: Some(WarpSyncConfig::WithProvider(warp_sync)),
Expand Down Expand Up @@ -539,6 +550,7 @@ pub fn new_full_base(
sp_transaction_storage_proof::registration::new_data_provider(
&*client_clone,
&parent,
STORAGE_PROOF_RETENTION_PERIOD,
)?;

Ok((slot, timestamp, storage_proof))
Expand Down
4 changes: 2 additions & 2 deletions examples/babe/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,8 @@ impl_runtime_apis! {
}

impl sp_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
SessionKeys::generate(seed)
fn generate_session_keys(owner: Vec<u8>, seed: Option<Vec<u8>>) -> sp_session::OpaqueGeneratedSessionKeys {
SessionKeys::generate(&owner, seed).into()
}

fn decode_session_keys(
Expand Down
1 change: 0 additions & 1 deletion examples/parachain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ features = [
"cumulus-client-cli",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-client-collator",
"cumulus-primitives-core",
Expand Down
2 changes: 2 additions & 0 deletions examples/parachain/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ where
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
Default::default(),
)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -188,6 +189,7 @@ async fn start_node_impl(
transaction_pool: transaction_pool.clone(),
para_id,
spawn_handle: task_manager.spawn_handle(),
spawn_essential_handle: task_manager.spawn_essential_handle(),
relay_chain_interface: relay_chain_interface.clone(),
import_queue: params.import_queue,
sybil_resistance_level: CollatorSybilResistance::Resistant,
Expand Down
11 changes: 9 additions & 2 deletions examples/parachain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,8 @@ impl_runtime_apis! {
}

impl sp_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
SessionKeys::generate(seed)
fn generate_session_keys(owner: Vec<u8>, seed: Option<Vec<u8>>) -> sp_session::OpaqueGeneratedSessionKeys {
SessionKeys::generate(&owner, seed).into()
}

fn decode_session_keys(
Expand Down Expand Up @@ -706,6 +706,13 @@ impl_runtime_apis! {
}
}

impl cumulus_primitives_core::KeyToIncludeInRelayProof<Block> for Runtime {
fn keys_to_prove() -> cumulus_primitives_core::RelayProofRequest {
// This runtime reads no extra relay chain storage, so no keys need proving.
Default::default()
}
}

impl<RuntimeCall, AccountId> simnode_runtime_api::CreateTransactionApi<Block, RuntimeCall, AccountId> for Runtime
where
RuntimeCall: codec::Codec,
Expand Down
1 change: 0 additions & 1 deletion examples/parachain/runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ impl staging_xcm_executor::Config for XcmConfig {
type AssetTrap = PolkadotXcm;
type AssetLocker = ();
type AssetExchanger = ();
type AssetClaims = PolkadotXcm;
type SubscriptionService = PolkadotXcm;
type PalletInstancesInfo = AllPalletsWithSystem;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
Expand Down
2 changes: 1 addition & 1 deletion runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "simnode-runtime-api"
version = "2512.0.0"
version = "2604.0.0"
authors = ["Polytope Labs <hello@polytope.technology>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion simnode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sc-simnode"
version = "2512.0.0"
version = "2604.0.0"
authors = ["Polytope Labs <hello@polytope.technology>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions simnode/src/client/aura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ where
client: client.clone(),
transaction_pool: pool.clone(),
spawn_handle: task_manager.spawn_handle(),
spawn_essential_handle: task_manager.spawn_essential_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_config: None,
Expand Down
1 change: 1 addition & 0 deletions simnode/src/client/babe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ where
client: client.clone(),
transaction_pool: pool.clone(),
spawn_handle: task_manager.spawn_handle(),
spawn_essential_handle: task_manager.spawn_essential_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_config: None,
Expand Down
1 change: 1 addition & 0 deletions simnode/src/client/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ where
client: client.clone(),
transaction_pool: pool.clone(),
spawn_handle: task_manager.spawn_handle(),
spawn_essential_handle: task_manager.spawn_essential_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_config: None,
Expand Down
Loading
Loading