-
Notifications
You must be signed in to change notification settings - Fork 537
Upgrade process
Marko Petrlić edited this page Oct 11, 2023
·
2 revisions
Substrate development framework supports forkless upgrades of the runtime. Update is triggered when spec_version
field of RuntimeVersion
in runtimeime/src/lib.rs
is incremented.
Since we have block size limits, runtime upgrade is a three step process. Preferred way to upgrade runtime is through governance/democracy feature. For each step, submit preimage with changes, and use preimage hash to submit proposal. Steps are:
- Submit
dataAvailability/submit_block_length_proposal
proposal with increased block size limits (eg. 512 rows x 256 columns) - Submit
system/set_code
proposal with uploadedda_runtime.compact.wasm
- Submit
dataAvailability/submit_block_length_proposal
proposal with block limits reverted to initial setting
For development purposes, its possible to use sudo calls with unchecked weight to increase block size limits and upload new runtime. In that case, steps are:
- Use
sudo/sudoCall
to invokedataAvailability/submit_block_length_proposal
with increased block limits (eg. 512 rows x 256 columns) - Use
sudo/sudoUncheckedWeight(call, weight)
with 0 weight to invokesystem/set_code
and uploadda_runtime.compact.compressed.wasm
- Use
sudo/sudoCall
to invokedataAvailability/submit_block_length_proposal
and revert block limits to initial setting
To check if runtime is upgraded, query system/version:SpVersionRuntimeVersion
constant. This should return latest version values.