Set session keys for a validator. Keys are validated on AssetHub and forwarded to RC.
On the first call, a deposit of KeyDeposit is held from the stash. Subsequent calls
do not charge again. The deposit is released on purge_keys.
Validation on AssetHub:
Keys are decoded as T::RelayChainSessionKeys to ensure they match RC's expected
format.
Ownership proof is validated using OpaqueKeys::ownership_proof_is_valid.
If validation passes, only the validated keys are sent to RC (with empty proof),
since RC trusts AH's validation.
Fees:
The actual cost of this call is higher than what the weight-based fee estimate shows.
In addition to the local transaction weight fee, the stash account is charged an XCM
fee (delivery + RC execution cost) via XcmExecutor::charge_fees. The relay chain
uses UnpaidExecution, so the full remote cost is charged upfront on AssetHub.
When called via a staking proxy, the proxy pays the transaction weight fee,
while the stash (delegating account) pays the XCM fee.
Max Fee Limit:
Users can optionally specify max_delivery_and_remote_execution_fee to limit the
delivery + RC execution fee. This does not include the local transaction weight fee. If
the fee exceeds this limit, the operation fails with FeesExceededMax. Pass None for
unlimited (no cap).
NOTE: unlike the current flow for new validators on RC (bond -> set_keys -> validate),
users on Asset Hub MUST call bond and validate BEFORE calling set_keys. Attempting to
set keys before declaring intent to validate will fail with NotValidator.
Set session keys for a validator. Keys are validated on AssetHub and forwarded to RC.
On the first call, a deposit of
KeyDepositis held from the stash. Subsequent calls do not charge again. The deposit is released onpurge_keys.Validation on AssetHub:
T::RelayChainSessionKeysto ensure they match RC's expected format.OpaqueKeys::ownership_proof_is_valid.If validation passes, only the validated keys are sent to RC (with empty proof), since RC trusts AH's validation.
Fees: The actual cost of this call is higher than what the weight-based fee estimate shows. In addition to the local transaction weight fee, the stash account is charged an XCM fee (delivery + RC execution cost) via
XcmExecutor::charge_fees. The relay chain usesUnpaidExecution, so the full remote cost is charged upfront on AssetHub.When called via a staking proxy, the proxy pays the transaction weight fee, while the stash (delegating account) pays the XCM fee.
Max Fee Limit: Users can optionally specify
max_delivery_and_remote_execution_feeto limit the delivery + RC execution fee. This does not include the local transaction weight fee. If the fee exceeds this limit, the operation fails withFeesExceededMax. PassNonefor unlimited (no cap).NOTE: unlike the current flow for new validators on RC (bond -> set_keys -> validate), users on Asset Hub MUST call bond and validate BEFORE calling set_keys. Attempting to set keys before declaring intent to validate will fail with NotValidator.