mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 06:47:55 +00:00
@@ -1,5 +1,6 @@
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
use log::info;
|
||||
@@ -182,7 +183,7 @@ pub fn run() -> Result<()> {
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner.sync_run(|config| cmd.run::<Block, ()>(config))
|
||||
runner.sync_run(|config| cmd.run::<sp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(config))
|
||||
} else {
|
||||
Err("Benchmarking wasn't enabled when building the node. \
|
||||
You can enable it with `--features runtime-benchmarks`."
|
||||
|
||||
@@ -26,9 +26,7 @@ use parachain_template_runtime::{
|
||||
};
|
||||
use sc_client_api::Backend;
|
||||
use sc_consensus::ImportQueue;
|
||||
use sc_executor::{
|
||||
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
|
||||
};
|
||||
use sc_executor::NativeElseWasmExecutor;
|
||||
use sc_network::NetworkBlock;
|
||||
use sc_network_sync::SyncingService;
|
||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||
@@ -66,30 +64,30 @@ type ParachainBackend = TFullBackend<Block>;
|
||||
|
||||
type ParachainBlockImport = TParachainBlockImport<Block, Arc<ParachainClient>, ParachainBackend>;
|
||||
|
||||
/// Assembly of PartialComponents (enough to run chain ops subcommands)
|
||||
pub type Service = PartialComponents<
|
||||
ParachainClient,
|
||||
ParachainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, ParachainClient>,
|
||||
(
|
||||
ParachainBlockImport,
|
||||
Option<Telemetry>,
|
||||
Option<TelemetryWorkerHandle>,
|
||||
FrontierBackend,
|
||||
Arc<fc_rpc::OverrideHandle<Block>>,
|
||||
),
|
||||
>;
|
||||
|
||||
/// Starts a `ServiceBuilder` for a full service.
|
||||
///
|
||||
/// Use this macro if you don't actually need the full service, but just the
|
||||
/// builder in order to be able to perform chain operations.
|
||||
/// Use this macro if you don't actually need the full service, but just the builder in order to
|
||||
/// be able to perform chain operations.
|
||||
pub fn new_partial(
|
||||
config: &Configuration,
|
||||
eth_config: &EthConfiguration,
|
||||
) -> Result<
|
||||
PartialComponents<
|
||||
ParachainClient,
|
||||
ParachainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, ParachainClient>,
|
||||
(
|
||||
ParachainBlockImport,
|
||||
Option<Telemetry>,
|
||||
Option<TelemetryWorkerHandle>,
|
||||
FrontierBackend,
|
||||
Arc<fc_rpc::OverrideHandle<Block>>,
|
||||
),
|
||||
>,
|
||||
sc_service::Error,
|
||||
> {
|
||||
) -> Result<Service, sc_service::Error> {
|
||||
let telemetry = config
|
||||
.telemetry_endpoints
|
||||
.clone()
|
||||
@@ -101,25 +99,14 @@ pub fn new_partial(
|
||||
})
|
||||
.transpose()?;
|
||||
|
||||
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 executor = sc_service::new_native_or_wasm_executor(config);
|
||||
|
||||
let (client, backend, keystore_container, task_manager) =
|
||||
sc_service::new_full_parts::<Block, RuntimeApi, _>(
|
||||
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
|
||||
config,
|
||||
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
|
||||
executor,
|
||||
true,
|
||||
)?;
|
||||
let client = Arc::new(client);
|
||||
|
||||
@@ -516,6 +503,8 @@ fn start_consensus(
|
||||
|
||||
// NOTE: because we use Aura here explicitly, we can use
|
||||
// `CollatorSybilResistance::Resistant` when starting the network.
|
||||
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
|
||||
|
||||
let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||
@@ -554,6 +543,7 @@ fn start_consensus(
|
||||
collator_key,
|
||||
para_id,
|
||||
overseer_handle,
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
slot_duration,
|
||||
relay_chain_slot_duration,
|
||||
proposer,
|
||||
|
||||
Reference in New Issue
Block a user