pub trait Config: Config + Config<RuntimeEvent: From<Event<Self>>> {
type CurrencyBalance: AtLeast32BitUnsigned + FullCodec + DecodeWithMemTracking + HasCompact<Type: DecodeWithMemTracking> + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + TypeInfo + Send + Sync + MaxEncodedLen;
type AssetHubOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type SendToAssetHub: SendToAssetHub<AccountId = Self::AccountId>;
type MinimumValidatorSetSize: Get<u32>;
type UnixTime: UnixTime;
type PointsPerBlock: Get<u32>;
type MaxOffenceBatchSize: Get<u32>;
type SessionInterface: SessionInterface<ValidatorId = Self::AccountId>;
type Fallback: SessionManager<Self::AccountId> + OnOffenceHandler<Self::AccountId, (Self::AccountId, Exposure<Self::AccountId, BalanceOf<Self>>), Weight> + RewardsReporter<Self::AccountId> + EventHandler<Self::AccountId, BlockNumberFor<Self>>;
type WeightInfo: WeightInfo;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait.
Required Associated Types§
Sourcetype CurrencyBalance: AtLeast32BitUnsigned + FullCodec + DecodeWithMemTracking + HasCompact<Type: DecodeWithMemTracking> + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + TypeInfo + Send + Sync + MaxEncodedLen
type CurrencyBalance: AtLeast32BitUnsigned + FullCodec + DecodeWithMemTracking + HasCompact<Type: DecodeWithMemTracking> + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + TypeInfo + Send + Sync + MaxEncodedLen
The balance type of the runtime’s currency interface.
Sourcetype AssetHubOrigin: EnsureOrigin<Self::RuntimeOrigin>
type AssetHubOrigin: EnsureOrigin<Self::RuntimeOrigin>
An origin type that ensures an incoming message is from asset hub.
Sourcetype AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>
The origin that can control this pallet’s operations.
Sourcetype SendToAssetHub: SendToAssetHub<AccountId = Self::AccountId>
type SendToAssetHub: SendToAssetHub<AccountId = Self::AccountId>
Our communication interface to AssetHub.
Sourcetype MinimumValidatorSetSize: Get<u32>
type MinimumValidatorSetSize: Get<u32>
A safety measure that asserts an incoming validator set must be at least this large.
Sourcetype PointsPerBlock: Get<u32>
type PointsPerBlock: Get<u32>
Number of points to award a validator per block authored.
Sourcetype MaxOffenceBatchSize: Get<u32>
type MaxOffenceBatchSize: Get<u32>
Maximum number of offences to batch in a single message to AssetHub.
Used during Active
mode to limit batch size when processing buffered offences
in on_initialize
. During Buffered
mode, offences are accumulated without batching.
When transitioning from Buffered
to Active
mode (via on_migration_end
),
buffered offences remain stored and are processed gradually by on_initialize
using this batch size limit to prevent block overload.
Performance characteristics
- Base cost: ~30.9ms (XCM infrastructure overhead)
- Per-offence cost: ~0.073ms (linear scaling)
- At batch size 50: ~34.6ms total (~1.7% of 2-second compute allowance)
Sourcetype SessionInterface: SessionInterface<ValidatorId = Self::AccountId>
type SessionInterface: SessionInterface<ValidatorId = Self::AccountId>
Interface to talk to the local Session pallet.
Sourcetype Fallback: SessionManager<Self::AccountId> + OnOffenceHandler<Self::AccountId, (Self::AccountId, Exposure<Self::AccountId, BalanceOf<Self>>), Weight> + RewardsReporter<Self::AccountId> + EventHandler<Self::AccountId, BlockNumberFor<Self>>
type Fallback: SessionManager<Self::AccountId> + OnOffenceHandler<Self::AccountId, (Self::AccountId, Exposure<Self::AccountId, BalanceOf<Self>>), Weight> + RewardsReporter<Self::AccountId> + EventHandler<Self::AccountId, BlockNumberFor<Self>>
A fallback implementation to delegate logic to when the pallet is in
OperatingMode::Passive
.
This type must implement the historical::SessionManager
and OnOffenceHandler
interface and is expected to behave as a stand-in for this pallet’s core logic when
delegation is active.
Sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Information on runtime weights.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.