pub trait Config: Config {
    type ControlOrigin: EnsureOrigin<Self::RuntimeOrigin>;
    type SignedFilter: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type Currency: Currency<Self::AccountId>;
    type MaxKeyLen: Get<u32>;
    type SignedDepositPerItem: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
    type SignedDepositBase: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
    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. Configurations of this pallet.

Required Associated Types§

source

type ControlOrigin: EnsureOrigin<Self::RuntimeOrigin>

Origin that can control the configurations of this pallet.

source

type SignedFilter: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>

Filter on which origin that trigger the manual migrations.

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

The overarching event type.

source

type Currency: Currency<Self::AccountId>

The currency provider type.

source

type MaxKeyLen: Get<u32>

Maximal number of bytes that a key can have.

FRAME itself does not limit the key length. The concrete value must therefore depend on your storage usage. A frame_support::storage::StorageNMap for example can have an arbitrary number of keys which are then hashed and concatenated, resulting in arbitrarily long keys.

Use the state migration RPC to retrieve the length of the longest key in your storage: https://github.com/paritytech/substrate/issues/11642

The migration will halt with a Halted event if this value is too small. Since there is no real penalty from over-estimating, it is advised to use a large value. The default is 512 byte.

Some key lengths for reference:

For more info see https://www.shawntabrizi.com/substrate/querying-substrate-storage-via-rpc/

source

type SignedDepositPerItem: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>

The amount of deposit collected per item in advance, for signed migrations.

This should reflect the average storage value size in the worse case.

source

type SignedDepositBase: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>

The base value of Config::SignedDepositPerItem.

Final deposit is items * SignedDepositPerItem + SignedDepositBase.

source

type WeightInfo: WeightInfo

The weight information of this pallet.

Implementors§