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 MaximumValidatorsWithPoints: 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 MaxSessionReportRetries: Get<u32>;
}
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 MaximumValidatorsWithPoints: Get<u32>
type MaximumValidatorsWithPoints: Get<u32>
A safety measure that asserts when iterating over validator points (to be sent to AH), we don’t iterate too many times.
Validator may change session to session, and if session reports are not sent, validator
points that we store may well grow beyond the size of the validator set. Yet, a too
large of an upper bound may also exceed the maximum size of a single DMP message.
Consult the test message_queue_sizes
for more information.
Note that in case a single session report is larger than a single DMP message, it might
still be sent over if we use
[pallet_staking_async_rc_client::XCMSender::split_then_send
]. This will make the size
of each individual message smaller, yet, it will still try and push them all to the
queue at the same time.
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. Actual sending
happens on_initialize
. Offences get infinite “retries”, and are never dropped.
A sensible value should be such that sending this batch is small enough to not exhaust
the DMP queue. The size of a single offence is documented in message_queue_sizes
test
(74 bytes).
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 MaxSessionReportRetries: Get<u32>
type MaxSessionReportRetries: Get<u32>
Maximum number of times we try to send a session report to AssetHub, after which, if sending still fails, we drop it.
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.