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
34 changes: 19 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk"
cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.6.0" }
Expand Down Expand Up @@ -252,6 +253,7 @@ cumulus-pallet-dmp-queue = { git = "https://github.com/pendulum-chain/polkadot-
cumulus-pallet-session-benchmarking = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
cumulus-pallet-xcm = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
cumulus-pallet-xcmp-queue = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
cumulus-primitives-aura = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
cumulus-primitives-timestamp = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
cumulus-primitives-utility = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
cumulus-client-cli = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "release-polkadot-v1.6.0" }
Expand Down
1 change: 1 addition & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ cumulus-client-collator = { workspace = true, default-features = true }
cumulus-client-network = { workspace = true, default-features = true }
cumulus-client-parachain-inherent = { workspace = true, default-features = true }
cumulus-client-service = { workspace = true, default-features = true }
cumulus-primitives-aura = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
cumulus-primitives-parachain-inherent = { workspace = true, default-features = true }
cumulus-relay-chain-inprocess-interface = { workspace = true, default-features = true }
Expand Down
61 changes: 39 additions & 22 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ use runtime_common::{opaque::Block, AccountId, Balance, Index as Nonce};

// Cumulus Imports
use cumulus_client_collator::service::CollatorService;
use cumulus_client_consensus_aura::collators::basic::{
self as basic_aura, Params as BasicAuraParams,
};
use cumulus_client_consensus_aura::collators::lookahead::{self as aura, Params as AuraParams};
use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport;
use cumulus_client_consensus_proposer::Proposer;
use cumulus_client_network::RequireSecondedInBlockAnnounce;
use cumulus_client_parachain_inherent::{MockValidationDataInherentDataProvider, MockXcmConfig};
use cumulus_client_service::{
prepare_node_config, start_relay_chain_tasks, DARecoveryProfile, StartRelayChainTasksParams,
};
use cumulus_primitives_core::{relay_chain::Hash, ParaId};
use cumulus_primitives_core::{
relay_chain::{CollatorPair, Hash, ValidationCode},
ParaId,
};
use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain;
use cumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult};
use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc;
Expand All @@ -37,14 +38,15 @@ use sc_service::{
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
use sp_api::ConstructRuntimeApi;
use sp_consensus_aura::{sr25519::AuthorityId, AuraApi};
use cumulus_primitives_aura::AuraUnincludedSegmentApi;
use sp_keystore::KeystorePtr;
use sp_runtime::traits::{BlakeTwo256, Block as BlockT};
use substrate_prometheus_endpoint::Registry;

use crate::rpc::{
create_full_amplitude, create_full_foucoco, create_full_pendulum, FullDeps, ResultRpcExtension,
};
use polkadot_service::{CollatorPair, Handle};
use polkadot_service::Handle;
use sc_consensus::{import_queue::ImportQueueService, ImportQueue};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;

Expand Down Expand Up @@ -91,6 +93,7 @@ pub trait ParachainRuntimeApiImpl:
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>
+ AuraApi<Block, AuthorityId>
+ AuraUnincludedSegmentApi<Block>
{
}

Expand Down Expand Up @@ -353,9 +356,9 @@ where
keystore: params.keystore_container.keystore(),
backend: backend.clone(),
network: network.clone(),
sync_service: sync_service.clone(),
system_rpc_tx,
tx_handler_controller,
sync_service: sync_service.clone(),
telemetry: telemetry.as_mut(),
})?;

Expand All @@ -376,7 +379,7 @@ where
+ Send
+ Sync
+ 'static,
RuntimeApi::RuntimeApi: ParachainRuntimeApiImpl,
RuntimeApi::RuntimeApi: ParachainRuntimeApiImpl + cumulus_primitives_aura::AuraUnincludedSegmentApi<Block>,
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>:
sc_client_api::StateBackend<BlakeTwo256>,
{
Expand All @@ -385,6 +388,7 @@ where
let mut params = new_partial(&mut parachain_config, is_standalone)?;

let client = params.client.clone();
let backend = params.backend.clone();

//just clone the last element of the "other" tuple
let telemetry_worker_handle_clone = params.other.2.clone();
Expand Down Expand Up @@ -468,6 +472,7 @@ where
if validator {
start_consensus(
client.clone(),
backend.clone(),
block_import,
prometheus_registry.as_ref(),
telemetry.as_ref().map(|t| t.handle()),
Expand Down Expand Up @@ -628,6 +633,7 @@ where
#[allow(clippy::too_many_arguments)]
fn start_consensus<RuntimeApi>(
client: Arc<TFullClient<Block, RuntimeApi, ParachainExecutor>>,
backend: Arc<TFullBackend<Block>>,
block_import: ParachainBlockImport<RuntimeApi>,
prometheus_registry: Option<&Registry>,
telemetry: Option<TelemetryHandle>,
Expand All @@ -647,12 +653,12 @@ where
+ Send
+ Sync
+ 'static,
RuntimeApi::RuntimeApi: ParachainRuntimeApiImpl,
RuntimeApi::RuntimeApi: ParachainRuntimeApiImpl + cumulus_primitives_aura::AuraUnincludedSegmentApi<Block>,
sc_client_api::StateBackendFor<TFullBackend<Block>, Block>:
sc_client_api::StateBackend<BlakeTwo256>,
{
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;

let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
task_manager.spawn_handle(),
client.clone(),
Expand All @@ -669,29 +675,40 @@ where
client.clone(),
);

let params = BasicAuraParams {
proposer,
let params = AuraParams {
create_inherent_data_providers: move |_, ()| async move { Ok(()) },
block_import,
collator_key,
collator_service,
para_client: client,
para_client: client.clone(),
para_backend: backend.clone(),
relay_client: relay_chain_interface,
code_hash_provider: move |block_hash| {
client.code_at(block_hash).ok().map(|c| ValidationCode::from(c).hash())
},
sync_oracle,
keystore,
slot_duration,
authoring_duration: Duration::from_millis(500),
relay_chain_slot_duration,
collator_key,
para_id: id,
overseer_handle,
collation_request_receiver: None,
relay_chain_slot_duration,
proposer,
collator_service,
authoring_duration: Duration::from_millis(1500),
};

let fut =
basic_aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _>(
params,
);

let fut = aura::run::<
Block,
sp_consensus_aura::sr25519::AuthorityPair,
_,
_,
_,
_,
_,
_,
_,
_,
_,
>(params);
task_manager.spawn_essential_handle().spawn("aura", None, fut);
Ok(())
}
Expand Down
5 changes: 3 additions & 2 deletions runtime/amplitude/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ staging-xcm-executor = { workspace = true }
# Cumulus
cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true, features = ["parameterized-consensus-hook"] }
cumulus-pallet-session-benchmarking = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
Expand All @@ -160,10 +161,10 @@ std = [
"codec/std",
"log/std",
"scale-info/std",
"cumulus-primitives-aura/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-parachain-system/parameterized-consensus-hook",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-core/std",
Expand Down
Loading
Loading