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:
Pallet::receivetakes the parachain’s request, which carries the head data plus the hash and length of the code that is coming, and parks it inPendingRegistrations. Only callable by a trusted XCM origin (e.g. the Coretime chain).Pallet::apply_authorized_codetakes 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.
A registration authorization never times out here. The parachain sends
[MessageToRelayV1::CancelRegistration] when the manager gives up, this pallet drops the entry
and confirms, and the parachain releases the deposit. So the relay chain runs no per-block
sweep, and whoever wants the deposit back pays for the round trip. No deposit is taken here.
Code upgrade authorizations do lapse instead: no deposit is at stake, and their validity depends on relay-chain state the parachain does not track.
§Locking
The relay chain also tells the parachain when a para produces a head, so the chain holding the
manager relationship can lock the para. Add this pallet to paras::Config::OnNewHead.
§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
palletmodule in each FRAME pallet hosts the most important items needed to construct this pallet. - weights
- Autogenerated weights for
pallet_registrar_relay
Structs§
- Pending
Registration - A registration the parachain has asked for, waiting on its validation code.
Traits§
Type Aliases§
- Pending
Registration Of PendingRegistrationas this pallet stores it.