Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.
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
3,026 changes: 1,822 additions & 1,204 deletions Cargo.lock

Large diffs are not rendered by default.

103 changes: 52 additions & 51 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,74 @@ homepage = "https://substrate.io"
license = "Unlicense"
name = "parachain-template-node"
repository = "https://github.com/paritytech/extended-parachain-template/"
version = "0.9.400"
version = "0.9.420"

[dependencies]
clap = { version = "4.1.8", features = ["derive"] }
clap = {version = "4.2.3", features = ["derive"]}
codec = {package = "parity-scale-codec", version = "3.0.0"}
jsonrpsee = {version = "0.16.2", features = ["server"]}
log = "0.4.17"
serde = {version = "1.0.152", features = ["derive"]}
serde = {version = "1.0.160", features = ["derive"]}
color-print = "0.3.4"

# Local
parachain-template-runtime = {path = "../runtime"}

# Substrate
frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", optional = true}
sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
substrate-frame-rpc-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
try-runtime-cli = { git = "https://github.com/paritytech/substrate", optional = true , branch = "polkadot-v0.9.40" }
frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-network-sync = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", optional = true}
sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
substrate-frame-rpc-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}
try-runtime-cli = {git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.42"}

# Polkadot
polkadot-cli = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40"}
polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40"}
xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.40"}
polkadot-cli = {git = "https://github.com/paritytech/polkadot", features = ["rococo-native"], branch = "release-v0.9.42"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42"}
polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42"}
xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42"}

# Cumulus
cumulus-client-cli = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-client-service = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-relay-chain-inprocess-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-relay-chain-minimal-node = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-relay-chain-rpc-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40"}
cumulus-client-cli = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-client-service = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-relay-chain-inprocess-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-relay-chain-minimal-node = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}
cumulus-relay-chain-rpc-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42"}

[build-dependencies]
substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}
substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"}

[features]
default = []
Expand Down
14 changes: 14 additions & 0 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,26 @@ pub enum Subcommand {
TryRuntime,
}

const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
r#"<bold><underline>Examples:</></>
<bold>parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json</>
Export a chainspec for a local testnet in json format.
<bold>parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain rococo-local</>
Launch a full node with chain specification loaded from plain-parachain-chainspec.json.
<bold>parachain-template-node</>
Launch a full node with default parachain <italic>local-testnet</> and relay chain <italic>rococo-local</>.
<bold>parachain-template-node --collator</>
Launch a collator with default parachain <italic>local-testnet</> and relay chain <italic>rococo-local</>.
"#
);

#[derive(Debug, clap::Parser)]
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
#[clap(after_help = AFTER_HELP_EXAMPLE)]
pub struct Cli {
#[command(subcommand)]
pub subcommand: Option<Subcommand>,
Expand Down
35 changes: 23 additions & 12 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ use cumulus_relay_chain_interface::RelayChainInterface;
// Substrate Imports
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use sc_consensus::ImportQueue;
use sc_executor::NativeElseWasmExecutor;
use sc_executor::{
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
};
use sc_network::NetworkBlock;
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
use sp_keystore::SyncCryptoStorePtr;
use sp_keystore::KeystorePtr;
use substrate_prometheus_endpoint::Registry;

/// Native executor type.
Expand Down Expand Up @@ -81,12 +83,19 @@ pub fn new_partial(
})
.transpose()?;

let executor = ParachainExecutor::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
);
let heap_pages = config
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });

let wasm = WasmExecutor::builder()
.with_execution_method(config.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.build();

let executor = ParachainExecutor::new_with_wasm_executor(wasm);

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
Expand Down Expand Up @@ -212,7 +221,7 @@ async fn start_node_impl(
transaction_pool: transaction_pool.clone(),
task_manager: &mut task_manager,
config: parachain_config,
keystore: params.keystore_container.sync_keystore(),
keystore: params.keystore_container.keystore(),
backend,
network: network.clone(),
sync_service: sync_service.clone(),
Expand Down Expand Up @@ -262,8 +271,8 @@ async fn start_node_impl(
&task_manager,
relay_chain_interface.clone(),
transaction_pool,
sync_service,
params.keystore_container.sync_keystore(),
sync_service.clone(),
params.keystore_container.keystore(),
force_authoring,
para_id,
)?;
Expand All @@ -282,6 +291,7 @@ async fn start_node_impl(
collator_key: collator_key.expect("Command line arguments do not allow this. qed"),
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle),
sync_service,
};

start_collator(params).await?;
Expand All @@ -295,6 +305,7 @@ async fn start_node_impl(
relay_chain_slot_duration,
import_queue: import_queue_service,
recovery_handle: Box::new(overseer_handle),
sync_service,
};

start_full_node(params)?;
Expand Down Expand Up @@ -352,7 +363,7 @@ fn build_consensus(
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient>>,
sync_oracle: Arc<SyncingService<Block>>,
keystore: SyncCryptoStorePtr,
keystore: KeystorePtr,
force_authoring: bool,
para_id: ParaId,
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error> {
Expand Down
24 changes: 12 additions & 12 deletions pallets/motion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-motion"
version = "4.0.0-dev"
description = "FRAME pallet template for defining custom runtime logic."
description = "FRAME pallet to wrap council calls providing root origin to the council."
authors = ["Substrate DevHub <https://github.com/substrate-developer-hub>"]
homepage = "https://substrate.io"
edition = "2021"
Expand All @@ -16,19 +16,19 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
"derive",
] }
log = { version = "0.4.17", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-std = { version = "5.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-runtime = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
sp-std = { version = "5.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
sp-runtime = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }

[dev-dependencies]
sp-core = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-io = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" }
pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" }
pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" }
sp-core = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
sp-io = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }

[features]
default = ["std"]
Expand Down
16 changes: 14 additions & 2 deletions pallets/motion/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ use super::*;
pub(crate) use crate as pallet_motion;
use frame_support::{
parameter_types,
traits::{ConstU16, ConstU64},
traits::{ConstU16, ConstU32, ConstU64},
weights::Weight,
};
use frame_system::limits::BlockWeights;
use sp_core::H256;
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
BuildStorage,
BuildStorage, Perbill,
};

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;

parameter_types! {
pub RuntimeBlockWeights: BlockWeights = BlockWeights::default();
}

// Configure a mock runtime to test the pallet.
frame_support::construct_runtime!(
pub enum Test where
Expand Down Expand Up @@ -65,13 +71,18 @@ impl pallet_balances::Config for Test {
type RuntimeEvent = RuntimeEvent;
type ExistentialDeposit = ConstU64<1>;
type AccountStore = System;
type HoldIdentifier = ();
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
type WeightInfo = ();
}

parameter_types! {
pub CouncilMotionDuration: u64 = 7;
pub const CouncilMaxProposals: u32 = 100;
pub const CouncilMaxMembers: u32 = 100;
pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block;
}

pub type CouncilCollective = pallet_collective::Instance1;
Expand All @@ -84,6 +95,7 @@ impl pallet_collective::Config<CouncilCollective> for Test {
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type MaxProposalWeight = MaxProposalWeight;
type WeightInfo = ();
}

Expand Down
Loading