referrerpolicy=no-referrer-when-downgrade

Trait Config

Source
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§

Source

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.

Source

type AssetHubOrigin: EnsureOrigin<Self::RuntimeOrigin>

An origin type that ensures an incoming message is from asset hub.

Source

type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>

The origin that can control this pallet’s operations.

Source

type SendToAssetHub: SendToAssetHub<AccountId = Self::AccountId>

Our communication interface to AssetHub.

Source

type MinimumValidatorSetSize: Get<u32>

A safety measure that asserts an incoming validator set must be at least this large.

Source

type UnixTime: UnixTime

A type that gives us a reliable unix timestamp.

Source

type PointsPerBlock: Get<u32>

Number of points to award a validator per block authored.

Source

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)
Source

type SessionInterface: SessionInterface<ValidatorId = Self::AccountId>

Interface to talk to the local Session pallet.

Source

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.

Source

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.

Implementors§