Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
3,480 changes: 1,846 additions & 1,634 deletions Cargo.lock

Large diffs are not rendered by default.

583 changes: 291 additions & 292 deletions Cargo.toml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sp-runtime = { workspace = true }
sp-state-machine = { workspace = true }
sp-timestamp = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }

# Own
Expand Down
27 changes: 25 additions & 2 deletions client/consensus/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ use {
async_trait::async_trait,
cumulus_client_collator::service::CollatorService,
cumulus_client_consensus_proposer::Proposer as ConsensusProposer,
cumulus_primitives_core::{relay_chain::BlockId, CollationInfo, CollectCollationInfo, ParaId},
cumulus_primitives_core::{
relay_chain::{BlockId, BlockNumber, CoreState},
CollationInfo, CollectCollationInfo, ParaId,
},
cumulus_relay_chain_interface::{
CommittedCandidateReceipt, OverseerHandle, RelayChainInterface, RelayChainResult,
StorageValue,
Expand Down Expand Up @@ -64,6 +67,7 @@ use {
Digest, DigestItem,
},
sp_timestamp::Timestamp,
sp_version::RuntimeVersion,
std::{
collections::{BTreeMap, BTreeSet},
pin::Pin,
Expand Down Expand Up @@ -259,6 +263,25 @@ impl RelayChainInterface for RelayChain {
) -> RelayChainResult<Option<polkadot_primitives::ValidationCodeHash>> {
unimplemented!("Not needed for test")
}

async fn candidates_pending_availability(
&self,
_: PHash,
_: ParaId,
) -> RelayChainResult<Vec<CommittedCandidateReceipt>> {
unimplemented!("Not needed for test")
}

async fn availability_cores(
&self,
_relay_parent: PHash,
) -> RelayChainResult<Vec<CoreState<PHash, BlockNumber>>> {
unimplemented!("Not needed for test");
}

async fn version(&self, _: PHash) -> RelayChainResult<RuntimeVersion> {
unimplemented!("Not needed for test")
}
}

#[derive(Clone)]
Expand Down Expand Up @@ -303,7 +326,7 @@ impl SealExtractorVerfier {
#[async_trait::async_trait]
impl<B: BlockT> sc_consensus::Verifier<B> for SealExtractorVerfier {
async fn verify(
&mut self,
&self,
mut block: sc_consensus::BlockImportParams<B>,
) -> Result<sc_consensus::BlockImportParams<B>, String> {
if block.fork_choice.is_none() {
Expand Down
9 changes: 7 additions & 2 deletions client/node-common/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ use {
},
sc_executor::{
sp_wasm_interface::{ExtendedHostFunctions, HostFunctions},
HeapAllocStrategy, NativeElseWasmExecutor, NativeExecutionDispatch, RuntimeVersionOf,
WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
HeapAllocStrategy, NativeExecutionDispatch, RuntimeVersionOf, WasmExecutor,
DEFAULT_HEAP_ALLOC_STRATEGY,
},
sc_network::{config::FullNetworkConfiguration, NetworkBlock},
sc_network_sync::SyncingService,
Expand All @@ -62,6 +62,9 @@ use {
std::{str::FromStr, sync::Arc},
};

#[allow(deprecated)]
use sc_executor::NativeElseWasmExecutor;

/// Trait to configure the main types the builder rely on, bundled in a single
/// type to reduce verbosity and the amount of type parameters.
pub trait NodeBuilderConfig {
Expand Down Expand Up @@ -174,13 +177,15 @@ impl TanssiExecutorExt for WasmExecutor<ParachainHostFunctions> {
}
}

#[allow(deprecated)]
impl<D> TanssiExecutorExt for NativeElseWasmExecutor<D>
where
D: NativeExecutionDispatch,
{
type HostFun = ExtendedHostFunctions<sp_io::SubstrateHostFunctions, D::ExtendHostFunctions>;

fn new_with_wasm_executor(wasm_executor: WasmExecutor<Self::HostFun>) -> Self {
#[allow(deprecated)]
NativeElseWasmExecutor::new_with_wasm_executor(wasm_executor)
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/service-container-chain/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use {
};

/// Specialized `ChainSpec` for container chains that only allows raw genesis format.
pub type RawChainSpec = sc_service::GenericChainSpec<RawGenesisConfig, Extensions>;
pub type RawChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Helper type that implements the traits needed to be used as a "GenesisConfig",
/// but whose implementation panics because we only expect it to be used with raw ChainSpecs,
Expand Down
10 changes: 7 additions & 3 deletions client/service-container-chain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use {
polkadot_primitives::CollatorPair,
sc_basic_authorship::ProposerFactory,
sc_consensus::{BasicQueue, BlockImport},
sc_executor::{NativeElseWasmExecutor, WasmExecutor},
sc_executor::WasmExecutor,
sc_network::NetworkBlock,
sc_network_sync::SyncingService,
sc_service::{
Expand All @@ -58,6 +58,9 @@ use {
tokio_util::sync::CancellationToken,
};

#[allow(deprecated)]
use sc_executor::NativeElseWasmExecutor;

type FullBackend = TFullBackend<Block>;

/// Native executor type.
Expand Down Expand Up @@ -102,12 +105,12 @@ impl<BI> OrchestratorParachainBlockImport<BI> {
#[async_trait::async_trait]
impl<BI> BlockImport<Block> for OrchestratorParachainBlockImport<BI>
where
BI: BlockImport<Block> + Send,
BI: BlockImport<Block> + Send + Sync,
{
type Error = BI::Error;

async fn check_block(
&mut self,
&self,
block: sc_consensus::BlockCheckParams<Block>,
) -> Result<sc_consensus::ImportResult, Self::Error> {
self.inner.check_block(block).await
Expand All @@ -127,6 +130,7 @@ where
impl<BI> ParachainBlockImportMarker for OrchestratorParachainBlockImport<BI> {}

// Orchestrator chain types
#[allow(deprecated)]
pub type ParachainExecutor = NativeElseWasmExecutor<ParachainNativeExecutor>;
pub type ParachainClient = TFullClient<Block, RuntimeApi, ParachainExecutor>;
pub type ParachainBackend = TFullBackend<Block>;
Expand Down
5 changes: 1 addition & 4 deletions container-chains/nodes/frontier/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ use {
};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec = sc_service::GenericChainSpec<
container_chain_template_frontier_runtime::RuntimeGenesisConfig,
Extensions,
>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Orcherstrator's parachain id
pub const ORCHESTRATOR: ParaId = ParaId::new(1000);
Expand Down
3 changes: 2 additions & 1 deletion container-chains/nodes/frontier/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ pub async fn start_dev_node(
let time = MockTimestampInherentDataProvider;
let mocked_parachain = MockValidationDataInherentDataProvider {
current_para_block,
current_para_block_head: None,
relay_offset: 1000,
relay_blocks_per_para_block: 2,
// TODO: Recheck
Expand All @@ -446,12 +447,12 @@ pub async fn start_dev_node(
xcm_config: MockXcmConfig::new(
&*client_for_xcm,
block,
para_id,
Default::default(),
),
raw_downward_messages: downward_xcm_receiver.drain().collect(),
raw_horizontal_messages: hrmp_xcm_receiver.drain().collect(),
additional_key_values: Some(additional_keys),
para_id,
};

Ok((time, mocked_parachain, mocked_authorities_noting))
Expand Down
5 changes: 1 addition & 4 deletions container-chains/nodes/simple/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ use {
};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec = sc_service::GenericChainSpec<
container_chain_template_simple_runtime::RuntimeGenesisConfig,
Extensions,
>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand Down
3 changes: 2 additions & 1 deletion container-chains/nodes/simple/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ pub async fn start_dev_node(
let time = MockTimestampInherentDataProvider;
let mocked_parachain = MockValidationDataInherentDataProvider {
current_para_block,
current_para_block_head: None,
relay_offset: 1000,
relay_blocks_per_para_block: 2,
// TODO: Recheck
Expand All @@ -291,12 +292,12 @@ pub async fn start_dev_node(
xcm_config: MockXcmConfig::new(
&*client_for_xcm,
block,
para_id,
Default::default(),
),
raw_downward_messages: downward_xcm_receiver.drain().collect(),
raw_horizontal_messages: hrmp_xcm_receiver.drain().collect(),
additional_key_values: Some(additional_keys),
para_id,
};

Ok((time, mocked_parachain, mocked_authorities_noting))
Expand Down
4 changes: 0 additions & 4 deletions container-chains/runtime-templates/frontier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ staging-xcm-executor = { workspace = true }
xcm-runtime-apis = { workspace = true }

# Cumulus
cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-session-benchmarking = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
Expand Down Expand Up @@ -135,7 +134,6 @@ default = [ "std" ]
std = [
"async-backing-primitives/std",
"ccp-xcm/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-session-benchmarking/std",
"cumulus-pallet-xcm/std",
Expand Down Expand Up @@ -234,7 +232,6 @@ std = [
force-debug = [ "sp-debug-derive/force-debug" ]

runtime-benchmarks = [
"cumulus-pallet-dmp-queue/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
Expand Down Expand Up @@ -281,7 +278,6 @@ runtime-benchmarks = [
]

try-runtime = [
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
Expand Down
8 changes: 5 additions & 3 deletions container-chains/runtime-templates/frontier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,6 @@ construct_runtime!(
// XCM
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Storage, Event<T>} = 70,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 71,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 72,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 73,
MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event<T>} = 74,
ForeignAssets: pallet_assets::<Instance1>::{Pallet, Call, Storage, Event<T>} = 75,
Expand Down Expand Up @@ -1024,7 +1023,6 @@ mod benches {
[pallet_cc_authorities_noting, AuthoritiesNoting]
[pallet_author_inherent, AuthorInherent]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[cumulus_pallet_dmp_queue, DmpQueue]
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
[pallet_xcm_benchmarks::generic, pallet_xcm_benchmarks::generic::Pallet::<Runtime>]
[pallet_message_queue, MessageQueue]
Expand Down Expand Up @@ -1619,7 +1617,11 @@ impl_runtime_apis! {
pallet_ethereum::CurrentBlock::<Runtime>::get(),
pallet_ethereum::CurrentTransactionStatuses::<Runtime>::get()
)
}
}

fn initialize_pending_block(header: &<Block as BlockT>::Header) {
Executive::initialize_block(header);
}
}

impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {
Expand Down
Loading