#![allow(clippy::crate_in_macro_def)] use frame_support::pallet_macros::pallet_section; /// A [`pallet_section`] that defines the errors for a pallet. /// This can later be imported into the pallet using [`import_section`]. #[pallet_section] mod config { use crate::{CommitmentsInterface, GetAlphaForTao, GetTaoForAlpha}; use frame_support::PalletId; use frame_support::traits::LockableCurrency; use pallet_alpha_assets::AlphaAssetsInterface; use pallet_commitments::GetCommitments; use subtensor_runtime_common::AuthorshipInfo; use subtensor_swap_interface::{SwapEngine, SwapHandler}; /// Configure the pallet by specifying the parameters and types on which it depends. #[pallet::config] pub trait Config: frame_system::Config + pallet_drand::Config + pallet_crowdloan::Config + pallet_scheduler::Config { /// call type type RuntimeCall: Parameter + Dispatchable> + From> + IsType<::RuntimeCall> + From>; /// A sudo-able call. type SudoRuntimeCall: Parameter + UnfilteredDispatchable> + GetDispatchInfo; /// Currency type that will be used to place deposits on neurons type Currency: fungible::Balanced + fungible::Mutate + LockableCurrency; /// The scheduler type used for scheduling delayed calls. type Scheduler: ScheduleAnon< BlockNumberFor, LocalCallOf, PalletsOriginOf, Hasher = Self::Hashing, >; /// the preimage to store the call data. type Preimages: QueryPreimage + StorePreimage; /// Implementor of `SwapHandler` interface from `subtensor_swap_interface` type SwapInterface: SwapHandler + SwapEngine> + SwapEngine>; /// Interface to allow interacting with the proxy pallet. type ProxyInterface: crate::ProxyInterface; /// Interface to get commitments. type GetCommitments: GetCommitments; /// Interface to clean commitments on network dissolution. type CommitmentsInterface: CommitmentsInterface; /// Interface to mint, burn, and recycle subnet alpha. type AlphaAssets: AlphaAssetsInterface; /// Rate limit for associating an EVM key. type EvmKeyAssociateRateLimit: Get; /// Provider of current block author type AuthorshipProvider: AuthorshipInfo; /// Weight information for extrinsics in this pallet. type WeightInfo: crate::weights::WeightInfo; // Initial Value Constants /// Initial currency issuance. #[pallet::constant] type InitialIssuance: Get; /// Initial min allowed weights setting. #[pallet::constant] type InitialMinAllowedWeights: Get; /// Initial Emission Ratio. #[pallet::constant] type InitialEmissionValue: Get; /// Tempo for each network. #[pallet::constant] type InitialTempo: Get; /// Initial Difficulty. #[pallet::constant] type InitialDifficulty: Get; /// Initial Max Difficulty. #[pallet::constant] type InitialMaxDifficulty: Get; /// Initial Min Difficulty. #[pallet::constant] type InitialMinDifficulty: Get; /// Initial RAO Recycled. #[pallet::constant] type InitialRAORecycledForRegistration: Get; /// Initial Burn. #[pallet::constant] type InitialBurn: Get; /// Initial Max Burn. #[pallet::constant] type InitialMaxBurn: Get; /// Initial Min Burn. #[pallet::constant] type InitialMinBurn: Get; /// Initial minimum stake. #[pallet::constant] type InitialMinStake: Get; /// Min burn upper bound. #[pallet::constant] type MinBurnUpperBound: Get; /// Max burn lower bound. #[pallet::constant] type MaxBurnLowerBound: Get; /// Lower bound for owner-set tempo. #[pallet::constant] type MinTempo: Get; /// Upper bound for owner-set tempo. #[pallet::constant] type MaxTempo: Get; /// Lower bound for the activity-cutoff factor (per-mille). #[pallet::constant] type MinActivityCutoffFactorMilli: Get; /// Upper bound for the activity-cutoff factor (per-mille). #[pallet::constant] type MaxActivityCutoffFactorMilli: Get; /// Initial adjustment interval. #[pallet::constant] type InitialAdjustmentInterval: Get; /// Initial bonds moving average. #[pallet::constant] type InitialBondsMovingAverage: Get; /// Initial bonds penalty. #[pallet::constant] type InitialBondsPenalty: Get; /// Initial bonds reset. #[pallet::constant] type InitialBondsResetOn: Get; /// Initial target registrations per interval. #[pallet::constant] type InitialTargetRegistrationsPerInterval: Get; /// Rho constant. #[pallet::constant] type InitialRho: Get; /// AlphaSigmoidSteepness constant. #[pallet::constant] type InitialAlphaSigmoidSteepness: Get; /// Kappa constant. #[pallet::constant] type InitialKappa: Get; /// Initial minimum allowed network UIDs #[pallet::constant] type InitialMinAllowedUids: Get; /// Initial maximum allowed network UIDs #[pallet::constant] type InitialMaxAllowedUids: Get; /// Initial validator context pruning length. #[pallet::constant] type InitialValidatorPruneLen: Get; /// Initial scaling law power. #[pallet::constant] type InitialScalingLawPower: Get; /// Immunity Period Constant. #[pallet::constant] type InitialImmunityPeriod: Get; /// Activity constant. #[pallet::constant] type InitialActivityCutoff: Get; /// Initial max registrations per block. #[pallet::constant] type InitialMaxRegistrationsPerBlock: Get; /// Initial pruning score for each neuron. #[pallet::constant] type InitialPruningScore: Get; /// Initial maximum allowed validators per network. #[pallet::constant] type InitialMaxAllowedValidators: Get; /// Initial default delegation take. #[pallet::constant] type InitialDefaultDelegateTake: Get; /// Initial minimum delegation take. #[pallet::constant] type InitialMinDelegateTake: Get; /// Initial default childkey take. #[pallet::constant] type InitialDefaultChildKeyTake: Get; /// Initial minimum childkey take. #[pallet::constant] type InitialMinChildKeyTake: Get; /// Initial maximum childkey take. #[pallet::constant] type InitialMaxChildKeyTake: Get; /// Initial weights version key. #[pallet::constant] type InitialWeightsVersionKey: Get; /// Initial serving rate limit. #[pallet::constant] type InitialServingRateLimit: Get; /// Initial transaction rate limit. #[pallet::constant] type InitialTxRateLimit: Get; /// Initial delegate take transaction rate limit. #[pallet::constant] type InitialTxDelegateTakeRateLimit: Get; /// Initial childkey take transaction rate limit. #[pallet::constant] type InitialTxChildKeyTakeRateLimit: Get; /// Initial adjustment alpha on burn and pow. #[pallet::constant] type InitialAdjustmentAlpha: Get; /// Initial network immunity period #[pallet::constant] type InitialNetworkImmunityPeriod: Get; /// Initial network minimum burn cost #[pallet::constant] type InitialNetworkMinLockCost: Get; /// Initial network subnet cut. #[pallet::constant] type InitialSubnetOwnerCut: Get; /// Initial lock reduction interval. #[pallet::constant] type InitialNetworkLockReductionInterval: Get; /// Initial network creation rate limit #[pallet::constant] type InitialNetworkRateLimit: Get; /// Cost of swapping a hotkey. #[pallet::constant] type KeySwapCost: Get; /// The upper bound for the alpha parameter. Used for Liquid Alpha. #[pallet::constant] type AlphaHigh: Get; /// The lower bound for the alpha parameter. Used for Liquid Alpha. #[pallet::constant] type AlphaLow: Get; /// A flag to indicate if Liquid Alpha is enabled. #[pallet::constant] type LiquidAlphaOn: Get; /// A flag to indicate if Yuma3 is enabled. #[pallet::constant] type Yuma3On: Get; /// Coldkey swap announcement delay. #[pallet::constant] type InitialColdkeySwapAnnouncementDelay: Get>; /// Coldkey swap reannouncement delay. #[pallet::constant] type InitialColdkeySwapReannouncementDelay: Get>; /// Dissolve network schedule duration #[pallet::constant] type InitialDissolveNetworkScheduleDuration: Get>; /// Initial TAO weight. #[pallet::constant] type InitialTaoWeight: Get; /// Initial EMA price halving period #[pallet::constant] type InitialEmaPriceHalvingPeriod: Get; /// Delay after which a new subnet can dispatch start call extrinsic. #[pallet::constant] type InitialStartCallDelay: Get; /// Cost of swapping a hotkey in a subnet. #[pallet::constant] type KeySwapOnSubnetCost: Get; /// Block number for a coldkey swap the hotkey in specific subnet. #[pallet::constant] type HotkeySwapOnSubnetInterval: Get; /// Number of blocks between dividends distribution. #[pallet::constant] type LeaseDividendsDistributionInterval: Get>; /// Maximum percentage of immune UIDs. #[pallet::constant] type MaxImmuneUidsPercentage: Get; /// Pallet account ID #[pallet::constant] type SubtensorPalletId: Get; /// Burn account ID #[pallet::constant] type BurnAccountId: Get; /// Initial default per-block cap on number of subnet epochs that may /// execute in a single `block_step`; the rest are deferred 1 block forward via /// `PendingEpochAt`. #[pallet::constant] type InitialMaxEpochsPerBlock: Get; } }