referrerpolicy=no-referrer-when-downgrade

Crate pallet_registrar_relay

Crate pallet_registrar_relay 

Source
Expand description

§Relay-chain registrar pallet

Relay half of the parachain registrar. Runs on the relay chain, applying registrations authorized on a parachain (pallet-registrar-para) and driving the relay’s legacy paras state.

§Two-phase registration

Pushing a multi-megabyte validation code through XCM would be wasteful when the parachain can commit to the exact bytes and let anybody upload them here directly, so registration arrives in two pieces:

  1. Pallet::authorize_code takes the parachain’s request, which carries the head data plus the hash and length of the code that is coming, and parks it in PendingRegistrations. Only callable by a trusted XCM origin (e.g. the Coretime chain).
  2. Pallet::apply_authorized_code takes the blob itself. It needs no signature: anybody may push the code, because a pending entry already pins down exactly which bytes are acceptable, and the parachain has already made the manager pay for them. If the blob matches, the para is onboarded and the outcome is reported back to the parachain.

An authorization does not time out here. If the code never turns up, missing the deadline is the manager’s problem, not this chain’s: the parachain sends Pallet::cancel_authorization when it gives up, this pallet drops the entry and confirms, and the parachain releases the deposit. So no per-block sweep runs on the relay chain, and whoever wants the deposit back pays for the round trip. No deposit is ever taken here.

§Runtime requirement

apply_authorized_code authorizes itself through frame_support::pallet_macros::authorize, so the runtime must carry frame_system::AuthorizeCall in its transaction extension pipeline.

Re-exports§

pub use weights::WeightInfo;
pub use pallet::*;

Modules§

pallet
The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
weights
Autogenerated weights for pallet_registrar_relay

Structs§

PendingRegistration
A registration the parachain has asked for, waiting on its validation code.

Traits§

SendToPara

Functions§

head_data_len
How much head data a message carries, for weighing Pallet::authorize_code.

Type Aliases§

PendingRegistrationOf
PendingRegistration as this pallet stores it.