You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a part of D-Day scenario, when governance systems are migrated to the AssetHub/Collectives. If a parachain (AssetHub or Collectives) stalls, recovery currently requires issuing paras::force_set_current_code(para_id, new_code) on the relay chain, e.g.:
// from Collectives to rescue AssetHub
pallet_xcm::send(relaychain, Transact(paras::force_set_current_code(1000, new_ah_code)))
// from AssetHub to rescue Collectives
pallet_xcm::send(relaychain, Transact(paras::force_set_current_code(1002, new_ah_code)))
However, there’s a major limitation:
paras::force_set_current_code requires sending the entire runtime binary via XCM.
The current max upward message size on the Collectives (parachainSystem.hostConfiguration.maxUpwardMessageSize = 65,531) is too small.
Example: penpal_runtime.compact.compressed.wasm = 1,299,474 bytes, which far exceeds the limit.
Solution
To avoid sending the entire runtime wasm code, we can split the process off-chain:
New Extrinsic:paras::authorize_force_set_current_code_hash(para_id, code_hash)
Only callable by governance (Root).
Stores the approved code hash on the relay chain.
New Extrinsic:paras::apply_authorized_force_set_current_code(para_id, code)
Open for anyone to call (no origin check).
Checks if code matches the pre-approved hash before applying the upgrade.
If code matches the stored code_hash, the relay chain executes force_set_current_code(para, code).
Relates to: #5588 (comment)
Context
As a part of D-Day scenario, when governance systems are migrated to the AssetHub/Collectives. If a parachain (AssetHub or Collectives) stalls, recovery currently requires issuing
paras::force_set_current_code(para_id, new_code)
on the relay chain, e.g.:However, there’s a major limitation:
paras::force_set_current_code
requires sending the entire runtime binary via XCM.parachainSystem.hostConfiguration.maxUpwardMessageSize = 65,531
) is too small.penpal_runtime.compact.compressed.wasm = 1,299,474 bytes
, which far exceeds the limit.Solution
To avoid sending the entire runtime wasm code, we can split the process off-chain:
New Extrinsic:
paras::authorize_force_set_current_code_hash(para_id, code_hash)
New Extrinsic:
paras::apply_authorized_force_set_current_code(para_id, code)
code
matches the pre-approved hash before applying the upgrade.code
matches the storedcode_hash
, the relay chain executesforce_set_current_code(para, code)
.This aligns with @rphmeier’s suggestion in this comment.
The text was updated successfully, but these errors were encountered: