pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
/// Submits a transaction with the node's public and signature type. Adheres to the signed extension
/// This is not a good value for para-chains since the `Scheduler` already uses up to 80% block weight.
pub MessageQueueServiceWeight: Weight = Perbill::from_percent(20) * BlockWeights::get().max_block;
// If you change this, make sure the `Assignment` type of the new provider is binary compatible,
pub const FreeCollatorAssignmentCredits: u32 = FreeBlockProductionCredits::get()/EpochDurationInBlocks::get();
pub const InflationRate: Perbill = runtime_common::prod_or_fast!(Perbill::from_parts(9), Perbill::from_percent(1));
impl frame_support::traits::OnUnbalanced<Credit<AccountId, Balances>> for OnUnbalancedInflation {
// Authorship must be before session in order to note author in the correct session and era.
pub struct InnerDancelightRegistrar<Runtime, AccountId, RegistrarManager, RegistrarWeightInfo>(
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("52bc71c1eca5353749542dfdf0af97bf764f9c2f44e860cd485f1cd86400f649"));
fn initialize_block(header: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result<Vec<VersionedAssetId>, XcmPaymentApiError> {
fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<u128, XcmPaymentApiError> {
fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, XcmPaymentApiError> {
fn inherent_extrinsics(data: inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
fn candidate_pending_availability(para_id: ParaId) -> Option<CommittedCandidateReceipt<Hash>> {
fn para_backing_state(para_id: ParaId) -> Option<primitives::async_backing::BackingState> {
fn candidates_pending_availability(para_id: ParaId) -> Vec<CommittedCandidateReceipt<Hash>> {
fn verify_proof(leaves: Vec<mmr::EncodableOpaqueLeaf>, proof: mmr::LeafProof<mmr::Hash>)
let nodes = leaves.into_iter().map(|leaf|mmr::DataOrHash::Data(leaf.into_opaque_leaf())).collect();
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {
// NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to
// We could potentially predict whether the next block will yield a session change as in dancebox but this
// is innecesary: the dancelight blocks are being produced by validators, and therefore it should never
// stall because of any collator-rotation. Therefore it suffices for collators to predict the chain in
impl pallet_registrar_runtime_api::OnDemandBlockProductionApi<Block, ParaId, Slot> for Runtime {
/// Returns slot frequency for particular para thread. Slot frequency specifies amount of slot
/// need to be passed between two parathread blocks. It is expressed as `(min, max)` pair where `min`
/// indicates amount of slot must pass before we produce another block and `max` indicates amount of
/// Simply put, parathread must produce a block after `min` but before `(min+max)` slots.
impl pallet_author_noting_runtime_api::AuthorNotingApi<Block, AccountId, BlockNumber, ParaId> for Runtime
let assigned_authorities = TanssiAuthorityAssignment::collator_container_chain(session_index)?;
let assigned_authorities = TanssiAuthorityAssignment::collator_container_chain(session_index)?;
let assigned_authorities = TanssiAuthorityAssignment::collator_container_chain(session_index)?;
impl pallet_services_payment_runtime_api::ServicesPaymentApi<Block, Balance, ParaId> for Runtime {
let (block_production_costs, _) = <Runtime as pallet_services_payment::Config>::ProvideBlockProductionCost::block_cost(¶_id);
let (collator_assignment_costs, _) = <Runtime as pallet_services_payment::Config>::ProvideCollatorAssignmentCost::collator_assignment_cost(¶_id);
pub AssetHubParaId: ParaId = dancelight_runtime_constants::system_parachain::ASSET_HUB_ID.into();
// Relay supports only native token, either reserve transfer it to non-system parachains,
fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {
let mut whitelist: Vec<TrackedStorageKey> = AllPalletsWithSystem::whitelisted_storage_keys();
let treasury_key = frame_system::Account::<Runtime>::hashed_key_for(Treasury::account_id());
/// This ensures that the randomness will be different on different pallets, as long as the subject is different.
pub fn mix_randomness<T: frame_system::Config>(vrf_output: [u8; 32], subject: &[u8]) -> T::Hash {
impl frame_support::traits::Randomness<Hash, BlockNumber> for BabeCurrentBlockRandomnessGetter {
let free_block_credits = pallet_services_payment::BlockProductionCredits::<Runtime>::get(para_id)
let free_session_credits = pallet_services_payment::CollatorAssignmentCredits::<Runtime>::get(para_id)
let max_tip = pallet_services_payment::MaxTip::<Runtime>::get(para_id).unwrap_or_default() ;
return Balances::can_withdraw(&pallet_services_payment::Pallet::<Runtime>::parachain_tank(*para_id), max_tip).into_result(true).is_ok()
let (block_production_costs, _) = <Runtime as pallet_services_payment::Config>::ProvideBlockProductionCost::block_cost(para_id);
let (collator_assignment_costs, _) = <Runtime as pallet_services_payment::Config>::ProvideCollatorAssignmentCost::collator_assignment_cost(para_id);
let remaining_block_credits_to_pay = u128::from(remaining_block_credits).saturating_mul(block_production_costs);
let remaining_session_credits_to_pay = u128::from(remaining_session_credits).saturating_mul(collator_assignment_costs);
let remaining_to_pay = remaining_block_credits_to_pay.saturating_add(remaining_session_credits_to_pay).saturating_add(max_tip);
Balances::can_withdraw(&pallet_services_payment::Pallet::<Runtime>::parachain_tank(*para_id), remaining_to_pay).into_result(true).is_ok()
let mut pending_configs = runtime_parachains::configuration::PendingConfigs::<Runtime>::get();
// We are not making any assumptions about number of configurations existing in pending config
// We do not have to check for session ending as new session always starts at block initialization which means
// as on block initialization epoch index have been incremented and by extension session has been changed.