authorize_upgrade
Call v151 → current #9Authorize a future runtime upgrade by code hash (root only).
View calls on chainCall Workflow
This diagram shows the call execution flow: starting with authorize_upgrade, passing through validation
(signature, nonce, mortality, fee payment), then pre-dispatch checks, followed by dispatch which emits events: UpgradeAuthorized and modifies storage: AuthorizedUpgrade, and finally post-dispatch where ExtrinsicSuccess is emitted and fees are settled.
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Click items to navigate. Pan and zoom to explore.
Used by: validatorsdevelopers
The Big Picture
Separates upgrade authorization from execution. Root authorizes, anyone can apply.
Use Cases
- Pre-authorize upgrades
- Governance-approved upgrades with delayed execution
From Chain Metadata
Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied later. This call requires Root origin.
Input Parameters
| # | Name | Type | Description |
|---|---|---|---|
| 0 | code_hash | H256 | code_hash (H256) |
Permissions
Origin
Unknown
Required Role
Permission data inferred from metadata. May be incomplete.
Requirements
- Caller is root/sudo
- Valid code hash
Effects
Events Emitted
Storage Modified
Postconditions
- Upgrade authorized
- UpgradeAuthorized event emitted
- AuthorizedUpgrade storage set
Side Effects
- Anyone can later apply the upgrade with matching code
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Build authorize_upgrade call
const code_hash = 0 as any /* H256 */;
const call = api.tx[stringCamelCase("System")][stringCamelCase("authorize_upgrade")](
code_hash
);Runtime Info
- Pallet Index
- 0
- Call Index
- 9
- First Version
- v151
- Current Version
- v393