pub type Registrar = Pallet<Runtime>;
Aliased Type§
struct Registrar(/* private fields */);
Implementations
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn register(
origin: <T as Config>::RuntimeOrigin,
id: Id,
genesis_head: HeadData,
validation_code: ValidationCode,
) -> Result<(), DispatchError>
pub fn register( origin: <T as Config>::RuntimeOrigin, id: Id, genesis_head: HeadData, validation_code: ValidationCode, ) -> Result<(), DispatchError>
Register head data and validation code for a reserved Para Id.
§Arguments
origin
: Must be called by aSigned
origin.id
: The para ID. Must be owned/managed by theorigin
signing account.genesis_head
: The genesis head data of the parachain/thread.validation_code
: The initial validation code of the parachain/thread.
§Deposits/Fees
The account with the originating signature must reserve a deposit.
The deposit is required to cover the costs associated with storing the genesis head
data and the validation code.
This accounts for the potential to store validation code of a size up to the
max_code_size
, as defined in the configuration pallet
Anything already reserved previously for this para ID is accounted for.
§Events
The Registered
event is emitted in case of success.
Sourcepub fn force_register(
origin: <T as Config>::RuntimeOrigin,
who: <T as Config>::AccountId,
deposit: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
id: Id,
genesis_head: HeadData,
validation_code: ValidationCode,
) -> Result<(), DispatchError>
pub fn force_register( origin: <T as Config>::RuntimeOrigin, who: <T as Config>::AccountId, deposit: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, id: Id, genesis_head: HeadData, validation_code: ValidationCode, ) -> Result<(), DispatchError>
Force the registration of a Para Id on the relay chain.
This function must be called by a Root origin.
The deposit taken can be specified for this registration. Any ParaId
can be registered, including sub-1000 IDs which are System Parachains.
Sourcepub fn deregister(
origin: <T as Config>::RuntimeOrigin,
id: Id,
) -> Result<(), DispatchError>
pub fn deregister( origin: <T as Config>::RuntimeOrigin, id: Id, ) -> Result<(), DispatchError>
Deregister a Para Id, freeing all data and returning any deposit.
The caller must be Root, the para
owner, or the para
itself. The para must be an
on-demand parachain.
Sourcepub fn swap(
origin: <T as Config>::RuntimeOrigin,
id: Id,
other: Id,
) -> Result<(), DispatchError>
pub fn swap( origin: <T as Config>::RuntimeOrigin, id: Id, other: Id, ) -> Result<(), DispatchError>
Swap a lease holding parachain with another parachain, either on-demand or lease holding.
The origin must be Root, the para
owner, or the para
itself.
The swap will happen only if there is already an opposite swap pending. If there is not, the swap will be stored in the pending swaps map, ready for a later confirmatory swap.
The ParaId
s remain mapped to the same head data and code so external code can rely on
ParaId
to be a long-term identifier of a notional “parachain”. However, their
scheduling info (i.e. whether they’re an on-demand parachain or lease holding
parachain), auction information and the auction deposit are switched.
Sourcepub fn remove_lock(
origin: <T as Config>::RuntimeOrigin,
para: Id,
) -> Result<(), DispatchError>
pub fn remove_lock( origin: <T as Config>::RuntimeOrigin, para: Id, ) -> Result<(), DispatchError>
Remove a manager lock from a para. This will allow the manager of a previously locked para to deregister or swap a para without using governance.
Can only be called by the Root origin or the parachain.
Sourcepub fn reserve(
origin: <T as Config>::RuntimeOrigin,
) -> Result<(), DispatchError>
pub fn reserve( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>
Reserve a Para Id on the relay chain.
This function will reserve a new Para Id to be owned/managed by the origin account.
The origin account is able to register head data and validation code using register
to
create an on-demand parachain. Using the Slots pallet, an on-demand parachain can then
be upgraded to a lease holding parachain.
§Arguments
origin
: Must be called by aSigned
origin. Becomes the manager/owner of the new para ID.
§Deposits/Fees
The origin must reserve a deposit of ParaDeposit
for the registration.
§Events
The Reserved
event is emitted in case of success, which provides the ID reserved for
use.
Sourcepub fn add_lock(
origin: <T as Config>::RuntimeOrigin,
para: Id,
) -> Result<(), DispatchError>
pub fn add_lock( origin: <T as Config>::RuntimeOrigin, para: Id, ) -> Result<(), DispatchError>
Add a manager lock from a para. This will prevent the manager of a para to deregister or swap a para.
Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked.
Sourcepub fn schedule_code_upgrade(
origin: <T as Config>::RuntimeOrigin,
para: Id,
new_code: ValidationCode,
) -> Result<(), DispatchError>
pub fn schedule_code_upgrade( origin: <T as Config>::RuntimeOrigin, para: Id, new_code: ValidationCode, ) -> Result<(), DispatchError>
Schedule a parachain upgrade.
This will kick off a check of new_code
by all validators. After the majority of the
validators have reported on the validity of the code, the code will either be enacted
or the upgrade will be rejected. If the code will be enacted, the current code of the
parachain will be overwritten directly. This means that any PoV will be checked by this
new code. The parachain itself will not be informed explicitly that the validation code
has changed.
Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked.
Sourcepub fn set_current_head(
origin: <T as Config>::RuntimeOrigin,
para: Id,
new_head: HeadData,
) -> Result<(), DispatchError>
pub fn set_current_head( origin: <T as Config>::RuntimeOrigin, para: Id, new_head: HeadData, ) -> Result<(), DispatchError>
Set the parachain’s current head.
Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked.
Trait Implementations
Source§impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T> Benchmarking for Pallet<T>
impl<T> Benchmarking for Pallet<T>
Source§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
Source§fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
instead. Read moreSource§impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
impl<T> IntegrityTest for Pallet<T>where
T: Config,
Source§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
Source§impl<T> Registrar for Pallet<T>where
T: Config,
impl<T> Registrar for Pallet<T>where
T: Config,
Source§fn manager_of(id: Id) -> Option<<T as Config>::AccountId>
fn manager_of(id: Id) -> Option<<T as Config>::AccountId>
Return the manager AccountId
of a para if one exists.
Source§type AccountId = <T as Config>::AccountId
type AccountId = <T as Config>::AccountId
Source§fn parachains() -> Vec<Id>
fn parachains() -> Vec<Id>
ParaId
. On-demand
parachains are not included.Source§fn is_parathread(id: Id) -> bool
fn is_parathread(id: Id) -> bool
ParaId
is a Parathread (on-demand parachain).Source§fn is_parachain(id: Id) -> bool
fn is_parachain(id: Id) -> bool
ParaId
is a lease holding Parachain.Source§fn apply_lock(id: Id)
fn apply_lock(id: Id)
Source§fn remove_lock(id: Id)
fn remove_lock(id: Id)
Source§fn register(
manager: <T as Config>::AccountId,
id: Id,
genesis_head: HeadData,
validation_code: ValidationCode,
) -> Result<(), DispatchError>
fn register( manager: <T as Config>::AccountId, id: Id, genesis_head: HeadData, validation_code: ValidationCode, ) -> Result<(), DispatchError>
who
. Registration may be
delayed by session rotation.Source§fn deregister(id: Id) -> Result<(), DispatchError>
fn deregister(id: Id) -> Result<(), DispatchError>
Source§fn make_parachain(id: Id) -> Result<(), DispatchError>
fn make_parachain(id: Id) -> Result<(), DispatchError>
Source§fn make_parathread(id: Id) -> Result<(), DispatchError>
fn make_parathread(id: Id) -> Result<(), DispatchError>
fn worst_head_data() -> HeadData
fn worst_validation_code() -> ValidationCode
Source§fn execute_pending_transitions()
fn execute_pending_transitions()
Source§fn is_registered(id: Id) -> bool
fn is_registered(id: Id) -> bool
ParaId
is registered in the system.Source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.