,
+ pub pool: Arc,
+ pub deny_unsafe: DenyUnsafe
+}
+
+pub fn create_full<
+ C: ProvideRuntimeApi +
+ HeaderBackend + HeaderMetadata +
+ Send + Sync + 'static,
+ P: TransactionPool + 'static
+>(
+ deps: FullDeps
+) -> Result, Box>
+ where C::Api: substrate_frame_rpc_system::AccountNonceApi +
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi +
+ BlockBuilder {
+
+ use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
+ use substrate_frame_rpc_system::{System, SystemApiServer};
+
+ let mut module = RpcModule::new(());
+ let FullDeps { client, pool, deny_unsafe } = deps;
+
+ module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
+ module.merge(TransactionPayment::new(client).into_rpc())?;
+
+ Ok(module)
+}
diff --git a/substrate/node/src/service.rs b/substrate/node/src/service.rs
new file mode 100644
index 00000000..afd0508d
--- /dev/null
+++ b/substrate/node/src/service.rs
@@ -0,0 +1,170 @@
+use std::sync::Arc;
+
+use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
+use sc_executor::NativeElseWasmExecutor;
+use sc_telemetry::{Telemetry, TelemetryWorker};
+
+use serai_runtime::{self, opaque::Block, RuntimeApi};
+pub(crate) use serai_consensus::{ExecutorDispatch, FullClient};
+
+type FullBackend = sc_service::TFullBackend;
+type FullSelectChain = sc_consensus::LongestChain;
+
+type PartialComponents = sc_service::PartialComponents<
+ FullClient,
+ FullBackend,
+ FullSelectChain,
+ sc_consensus::DefaultImportQueue,
+ sc_transaction_pool::FullPool,
+ Option,
+>;
+
+pub fn new_partial(config: &Configuration) -> Result {
+ if config.keystore_remote.is_some() {
+ return Err(ServiceError::Other("Remote Keystores are not supported".to_string()))
+ }
+
+ let telemetry = config
+ .telemetry_endpoints
+ .clone()
+ .filter(|x| !x.is_empty())
+ .map(|endpoints| -> Result<_, sc_telemetry::Error> {
+ let worker = TelemetryWorker::new(16)?;
+ let telemetry = worker.handle().new_telemetry(endpoints);
+ Ok((worker, telemetry))
+ })
+ .transpose()?;
+
+ let executor = NativeElseWasmExecutor::::new(
+ config.wasm_method,
+ config.default_heap_pages,
+ config.max_runtime_instances,
+ config.runtime_cache_size
+ );
+
+ let (
+ client,
+ backend,
+ keystore_container,
+ task_manager
+ ) = sc_service::new_full_parts::(
+ config,
+ telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
+ executor
+ )?;
+ let client = Arc::new(client);
+
+ let telemetry = telemetry.map(|(worker, telemetry)| {
+ task_manager.spawn_handle().spawn("telemetry", None, worker.run());
+ telemetry
+ });
+
+ let select_chain = sc_consensus::LongestChain::new(backend.clone());
+
+ let transaction_pool = sc_transaction_pool::BasicPool::new_full(
+ config.transaction_pool.clone(),
+ config.role.is_authority().into(),
+ config.prometheus_registry(),
+ task_manager.spawn_essential_handle(),
+ client.clone()
+ );
+
+ let import_queue = serai_consensus::import_queue(
+ &task_manager,
+ client.clone(),
+ select_chain.clone(),
+ config.prometheus_registry()
+ )?;
+
+ Ok(
+ sc_service::PartialComponents {
+ client,
+ backend,
+ task_manager,
+ import_queue,
+ keystore_container,
+ select_chain,
+ transaction_pool,
+ other: telemetry,
+ }
+ )
+}
+
+pub fn new_full(config: Configuration) -> Result {
+ let sc_service::PartialComponents {
+ client,
+ backend,
+ mut task_manager,
+ import_queue,
+ keystore_container,
+ select_chain,
+ other: mut telemetry,
+ transaction_pool
+ } = new_partial(&config)?;
+
+ let (network, system_rpc_tx, network_starter) = sc_service::build_network(
+ sc_service::BuildNetworkParams {
+ config: &config,
+ client: client.clone(),
+ transaction_pool: transaction_pool.clone(),
+ spawn_handle: task_manager.spawn_handle(),
+ import_queue,
+ block_announce_validator_builder: None,
+ warp_sync: None,
+ }
+ )?;
+
+ if config.offchain_worker.enabled {
+ sc_service::build_offchain_workers(
+ &config,
+ task_manager.spawn_handle(),
+ client.clone(),
+ network.clone(),
+ );
+ }
+
+ let role = config.role.clone();
+ let prometheus_registry = config.prometheus_registry().cloned();
+
+ let rpc_extensions_builder = {
+ let client = client.clone();
+ let pool = transaction_pool.clone();
+
+ Box::new(
+ move |deny_unsafe, _| {
+ crate::rpc::create_full(
+ crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe }
+ ).map_err(Into::into)
+ }
+ )
+ };
+
+ sc_service::spawn_tasks(
+ sc_service::SpawnTasksParams {
+ network: network.clone(),
+ client: client.clone(),
+ keystore: keystore_container.sync_keystore(),
+ task_manager: &mut task_manager,
+ transaction_pool: transaction_pool.clone(),
+ rpc_builder: rpc_extensions_builder,
+ backend,
+ system_rpc_tx,
+ config,
+ telemetry: telemetry.as_mut(),
+ }
+ )?;
+
+ if role.is_authority() {
+ serai_consensus::authority(
+ &task_manager,
+ client,
+ network,
+ transaction_pool,
+ select_chain,
+ prometheus_registry.as_ref()
+ );
+ }
+
+ network_starter.start_network();
+ Ok(task_manager)
+}
diff --git a/substrate/runtime/Cargo.toml b/substrate/runtime/Cargo.toml
new file mode 100644
index 00000000..05107c0c
--- /dev/null
+++ b/substrate/runtime/Cargo.toml
@@ -0,0 +1,94 @@
+[package]
+name = "serai-runtime"
+version = "0.1.0"
+description = "Serai network node runtime, built over Substrate"
+license = "AGPL-3.0-only"
+authors = ["Luke Parker "]
+edition = "2021"
+publish = false
+
+[dependencies]
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
+scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
+
+sp-core = { version = "6.0.0", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-std = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-version = { version = "5.0.0", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-inherents = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai"}
+sp-offchain = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-session = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-transaction-pool = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-block-builder = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai"}
+sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+
+frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+frame-executive = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+frame-try-runtime = { version = "0.10.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai", optional = true }
+
+pallet-timestamp = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+pallet-balances = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+
+# Used for the node template's RPCs
+frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+
+# Used for runtime benchmarking
+frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai", optional = true }
+frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/serai-dex/substrate.git", branch = "serai", optional = true }
+hex-literal = { version = "0.3.4", optional = true }
+
+[build-dependencies]
+substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/serai-dex/substrate.git", branch = "serai" }
+
+[features]
+std = [
+ "codec/std",
+ "scale-info/std",
+
+ "sp-core/std",
+ "sp-std/std",
+ "sp-version/std",
+ "sp-inherents/std",
+ "sp-offchain/std",
+ "sp-session/std",
+ "sp-transaction-pool/std",
+ "sp-block-builder/std",
+ "sp-runtime/std",
+ "sp-api/std",
+
+ "frame-support/std",
+ "frame-system-rpc-runtime-api/std",
+ "frame-system/std",
+ "frame-executive/std",
+
+ "pallet-timestamp/std",
+ "pallet-balances/std",
+ "pallet-transaction-payment/std",
+ "pallet-transaction-payment-rpc-runtime-api/std"
+]
+
+runtime-benchmarks = [
+ "hex-literal",
+ "sp-runtime/runtime-benchmarks",
+ "frame-benchmarking/runtime-benchmarks",
+ "frame-support/runtime-benchmarks",
+ "frame-system-benchmarking",
+ "frame-system/runtime-benchmarks",
+ "pallet-timestamp/runtime-benchmarks",
+ "pallet-balances/runtime-benchmarks"
+]
+
+try-runtime = [
+ "frame-executive/try-runtime",
+ "frame-try-runtime",
+ "frame-system/try-runtime",
+
+ "pallet-timestamp/try-runtime",
+ "pallet-balances/try-runtime",
+ "pallet-transaction-payment/try-runtime"
+]
+
+default = ["std"]
diff --git a/substrate/runtime/LICENSE b/substrate/runtime/LICENSE
new file mode 100644
index 00000000..d6e1814a
--- /dev/null
+++ b/substrate/runtime/LICENSE
@@ -0,0 +1,15 @@
+AGPL-3.0-only license
+
+Copyright (c) 2022 Luke Parker
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License Version 3 as
+published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see .
diff --git a/substrate/runtime/build.rs b/substrate/runtime/build.rs
new file mode 100644
index 00000000..6018c194
--- /dev/null
+++ b/substrate/runtime/build.rs
@@ -0,0 +1,9 @@
+use substrate_wasm_builder::WasmBuilder;
+
+fn main() {
+ WasmBuilder::new()
+ .with_current_project()
+ .export_heap_base()
+ .import_memory()
+ .build()
+}
diff --git a/substrate/runtime/src/lib.rs b/substrate/runtime/src/lib.rs
new file mode 100644
index 00000000..49e72be0
--- /dev/null
+++ b/substrate/runtime/src/lib.rs
@@ -0,0 +1,379 @@
+#![cfg_attr(not(feature = "std"), no_std)]
+#![recursion_limit = "256"]
+
+#[cfg(feature = "std")]
+include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
+
+use sp_api::impl_runtime_apis;
+use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
+use sp_runtime::{
+ create_runtime_str, generic, impl_opaque_keys,
+ traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify},
+ transaction_validity::{TransactionSource, TransactionValidity},
+ ApplyExtrinsicResult, MultiSignature,
+ Perbill
+};
+use sp_std::prelude::*;
+#[cfg(feature = "std")]
+use sp_version::NativeVersion;
+use sp_version::RuntimeVersion;
+
+use frame_support::{
+ traits::{ConstU8, ConstU32, ConstU64},
+ weights::{constants::{RocksDbWeight, WEIGHT_PER_SECOND}, IdentityFee},
+ parameter_types, construct_runtime
+};
+pub use frame_system::Call as SystemCall;
+pub use pallet_timestamp::Call as TimestampCall;
+pub use pallet_balances::Call as BalancesCall;
+use pallet_transaction_payment::CurrencyAdapter;
+
+/// An index to a block
+pub type BlockNumber = u32;
+
+/// Alias to 512-bit hash when used in the context of a transaction signature on the chain
+pub type Signature = MultiSignature;
+
+/// Some way of identifying an account on the chain. We intentionally make it equivalent
+/// to the public key of our transaction signing scheme
+pub type AccountId = <::Signer as IdentifyAccount>::AccountId;
+
+/// Balance of an account
+pub type Balance = u64;
+
+/// Index of a transaction in the chain, for a given account
+pub type Index = u32;
+
+/// A hash of some data used by the chain
+pub type Hash = sp_core::H256;
+
+pub mod opaque {
+ use super::*;
+
+ pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
+
+ pub type Header = generic::Header;
+ pub type Block = generic::Block;
+ pub type BlockId = generic::BlockId;
+
+ impl_opaque_keys! {
+ pub struct SessionKeys {}
+ }
+}
+
+#[sp_version::runtime_version]
+pub const VERSION: RuntimeVersion = RuntimeVersion {
+ spec_name: create_runtime_str!("serai"),
+ impl_name: create_runtime_str!("turoctocrab"),
+ authoring_version: 1,
+ spec_version: 100,
+ impl_version: 1,
+ apis: RUNTIME_API_VERSIONS,
+ transaction_version: 1,
+ state_version: 1
+};
+
+pub const MILLISECS_PER_BLOCK: u64 = 6000;
+pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
+
+/// Measured in blocks
+pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
+pub const HOURS: BlockNumber = MINUTES * 60;
+pub const DAYS: BlockNumber = HOURS * 24;
+
+#[cfg(feature = "std")]
+pub fn native_version() -> NativeVersion {
+ NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
+}
+
+const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
+
+parameter_types! {
+ pub const BlockHashCount: BlockNumber = 2400;
+ pub const Version: RuntimeVersion = VERSION;
+ /// Allow for 2 seconds of compute with a 6 second average block time
+ pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights
+ ::with_sensible_defaults(2 * WEIGHT_PER_SECOND, NORMAL_DISPATCH_RATIO);
+ pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength
+ ::max_with_normal_ratio(1024 * 1024, NORMAL_DISPATCH_RATIO);
+ pub const SS58Prefix: u8 = 42; // TODO: Remove
+}
+
+impl frame_system::Config for Runtime {
+ type BaseCallFilter = frame_support::traits::Everything;
+ type BlockWeights = BlockWeights;
+ type BlockLength = BlockLength;
+ type AccountId = AccountId;
+ type Call = Call;
+ type Lookup = AccountIdLookup;
+ type Index = Index;
+ type BlockNumber = BlockNumber;
+ type Hash = Hash;
+ type Hashing = BlakeTwo256;
+ type Header = Header;
+ type Event = Event;
+ type Origin = Origin;
+ type BlockHashCount = BlockHashCount;
+ type DbWeight = RocksDbWeight;
+ type Version = Version;
+ type PalletInfo = PalletInfo;
+
+ type OnNewAccount = ();
+ type OnKilledAccount = ();
+ type OnSetCode = ();
+
+ type AccountData = pallet_balances::AccountData;
+ type SystemWeightInfo = ();
+ type SS58Prefix = SS58Prefix; // TODO: Remove
+
+ type MaxConsumers = frame_support::traits::ConstU32<16>;
+}
+
+impl pallet_timestamp::Config for Runtime {
+ type Moment = u64;
+ type OnTimestampSet = ();
+ type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
+ type WeightInfo = ();
+}
+
+impl pallet_balances::Config for Runtime {
+ type MaxLocks = ConstU32<50>;
+ type MaxReserves = ();
+ type ReserveIdentifier = [u8; 8];
+ type Balance = Balance;
+ type Event = Event;
+ type DustRemoval = ();
+ type ExistentialDeposit = ConstU64<500>;
+ type AccountStore = System;
+ type WeightInfo = pallet_balances::weights::SubstrateWeight;
+}
+
+impl pallet_transaction_payment::Config for Runtime {
+ type Event = Event;
+ type OnChargeTransaction = CurrencyAdapter;
+ type OperationalFeeMultiplier = ConstU8<5>;
+ type WeightToFee = IdentityFee;
+ type LengthToFee = IdentityFee;
+ type FeeMultiplierUpdate = ();
+}
+
+pub type Address = sp_runtime::MultiAddress;
+pub type Header = generic::Header;
+pub type Block = generic::Block;
+pub type SignedExtra = (
+ frame_system::CheckNonZeroSender,
+ frame_system::CheckSpecVersion,
+ frame_system::CheckTxVersion,
+ frame_system::CheckGenesis,
+ frame_system::CheckEra,
+ frame_system::CheckNonce,
+ frame_system::CheckWeight,
+ pallet_transaction_payment::ChargeTransactionPayment,
+);
+pub type UncheckedExtrinsic = generic::UncheckedExtrinsic;
+pub type SignedPayload = generic::SignedPayload;
+pub type Executive = frame_executive::Executive<
+ Runtime,
+ Block,
+ frame_system::ChainContext,
+ Runtime,
+ AllPalletsWithSystem,
+>;
+
+construct_runtime!(
+ pub enum Runtime where
+ Block = Block,
+ NodeBlock = Block,
+ UncheckedExtrinsic = UncheckedExtrinsic
+ {
+ System: frame_system,
+ Timestamp: pallet_timestamp,
+ Balances: pallet_balances,
+ TransactionPayment: pallet_transaction_payment
+ }
+);
+
+#[cfg(feature = "runtime-benchmarks")]
+#[macro_use]
+extern crate frame_benchmarking;
+
+#[cfg(feature = "runtime-benchmarks")]
+mod benches {
+ define_benchmarks!(
+ [frame_benchmarking, BaselineBench::]
+ [frame_system, SystemBench::]
+ [pallet_balances, Balances]
+ [pallet_timestamp, Timestamp]
+ );
+}
+
+impl_runtime_apis! {
+ impl sp_api::Core for Runtime {
+ fn version() -> RuntimeVersion {
+ VERSION
+ }
+
+ fn execute_block(block: Block) {
+ Executive::execute_block(block);
+ }
+
+ fn initialize_block(header: &::Header) {
+ Executive::initialize_block(header)
+ }
+ }
+
+ impl sp_api::Metadata for Runtime {
+ fn metadata() -> OpaqueMetadata {
+ OpaqueMetadata::new(Runtime::metadata().into())
+ }
+ }
+
+ impl sp_block_builder::BlockBuilder for Runtime {
+ fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult {
+ Executive::apply_extrinsic(extrinsic)
+ }
+
+ fn finalize_block() -> ::Header {
+ Executive::finalize_block()
+ }
+
+ fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> {
+ data.create_extrinsics()
+ }
+
+ fn check_inherents(
+ block: Block,
+ data: sp_inherents::InherentData,
+ ) -> sp_inherents::CheckInherentsResult {
+ data.check_extrinsics(&block)
+ }
+ }
+
+ impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime {
+ fn validate_transaction(
+ source: TransactionSource,
+ tx: ::Extrinsic,
+ block_hash: ::Hash,
+ ) -> TransactionValidity {
+ Executive::validate_transaction(source, tx, block_hash)
+ }
+ }
+
+ impl sp_offchain::OffchainWorkerApi for Runtime {
+ fn offchain_worker(header: &::Header) {
+ Executive::offchain_worker(header)
+ }
+ }
+
+ impl sp_session::SessionKeys for Runtime {
+ fn generate_session_keys(seed: Option>) -> Vec {
+ opaque::SessionKeys::generate(seed)
+ }
+
+ fn decode_session_keys(
+ encoded: Vec,
+ ) -> Option, KeyTypeId)>> {
+ opaque::SessionKeys::decode_into_raw_public_keys(&encoded)
+ }
+ }
+
+ impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime {
+ fn account_nonce(account: AccountId) -> Index {
+ System::account_nonce(account)
+ }
+ }
+
+ impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
+ Block,
+ Balance
+ > for Runtime {
+ fn query_info(
+ uxt: ::Extrinsic,
+ len: u32,
+ ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo {
+ TransactionPayment::query_info(uxt, len)
+ }
+ fn query_fee_details(
+ uxt: ::Extrinsic,
+ len: u32,
+ ) -> pallet_transaction_payment::FeeDetails {
+ TransactionPayment::query_fee_details(uxt, len)
+ }
+ }
+
+ #[cfg(feature = "runtime-benchmarks")]
+ impl frame_benchmarking::Benchmark for Runtime {
+ fn benchmark_metadata(extra: bool) -> (
+ Vec,
+ Vec,
+ ) {
+ use frame_benchmarking::{baseline, Benchmarking, BenchmarkList};
+ use frame_support::traits::StorageInfoTrait;
+ use frame_system_benchmarking::Pallet as SystemBench;
+ use baseline::Pallet as BaselineBench;
+
+ let mut list = Vec::::new();
+ list_benchmarks!(list, extra);
+
+ let storage_info = AllPalletsWithSystem::storage_info();
+
+ (list, storage_info)
+ }
+
+ fn dispatch_benchmark(
+ config: frame_benchmarking::BenchmarkConfig
+ ) -> Result, sp_runtime::RuntimeString> {
+ use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey};
+
+ use frame_system_benchmarking::Pallet as SystemBench;
+ use baseline::Pallet as BaselineBench;
+
+ impl frame_system_benchmarking::Config for Runtime {}
+ impl baseline::Config for Runtime {}
+
+ let whitelist: Vec = vec![
+ // Block Number
+ hex_literal::hex!(
+ "26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"
+ ).to_vec().into(),
+ // Total Issuance
+ hex_literal::hex!(
+ "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80"
+ ).to_vec().into(),
+ // Execution Phase
+ hex_literal::hex!(
+ "26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a"
+ ).to_vec().into(),
+ // Event Count
+ hex_literal::hex!(
+ "26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850"
+ ).to_vec().into(),
+ // System Events
+ hex_literal::hex!(
+ "26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"
+ ).to_vec().into(),
+ ];
+
+ let mut batches = Vec::::new();
+ let params = (&config, &whitelist);
+ add_benchmarks!(params, batches);
+
+ Ok(batches)
+ }
+ }
+
+ #[cfg(feature = "try-runtime")]
+ impl frame_try_runtime::TryRuntime for Runtime {
+ fn on_runtime_upgrade() -> (Weight, Weight) {
+ // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to
+ // have a backtrace here. If any of the pre/post migration checks fail, we shall stop
+ // right here and right now.
+ let weight = Executive::try_runtime_upgrade().unwrap();
+ (weight, BlockWeights::get().max_block)
+ }
+
+ fn execute_block_no_check(block: Block) -> Weight {
+ Executive::execute_block_no_check(block)
+ }
+ }
+}