Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Latest commit

 

History

History
63 lines (53 loc) · 3.94 KB

File metadata and controls

63 lines (53 loc) · 3.94 KB
title
Introduction

One of the defining features of the Substrate blockchain development framework is its support for forkless runtime upgrades. Forkless upgrades are a means of enhancing a blockchain runtime in a way that is supported and protected by the capabilities of the blockchain itself. A blockchain's runtime defines the state the blockchain can hold and also defines the logic for effecting changes to that state.

node-diagram.png

Substrate makes it possible to deploy enhanced runtime capabilities (including breaking changes(!)) without a hard fork. Because the definition of the runtime is itself an element in a Substrate chain's state, network participants may update this value by way of an extrinsic, specifically the set_code function. Since updates to runtime state are bound by the blockchain's consensus mechanisms and cryptographic guarantees, network participants can use the blockchain itself to trustlessly distribute updated or extended runtime logic without needing to fork the chain or even release a new blockchain client.

This tutorial will use the Substrate Developer Hub Node Template to explore two mechanisms for forkless upgrades of FRAME-based runtimes. First, the sudo_unchecked_weight function from the Sudo pallet will be used to perform an upgrade that adds the Scheduler pallet. Then, the schedule function from the Scheduler pallet will be used to perform an upgrade that increases the existential (minimum) balance for network accounts.

If you have problems with this tutorial, the Substrate community is full of helpful resources! We maintain an active Substrate Technical chat room and monitor the substrate tag on Stack Overflow. You can also use the subport GitHub repository to create an Issue.

Please do note that your problem may already solved on stackoverflow or subport,** do a search first for keywords in your error messages and concepts, and if you found them useful as well, comment to let us know that it's a common issue to escalate for a fix.**

Before You Begin

  1. To get a sense of what they are more concretely, read the runtime upgrade documentation first, or at least have it open as a reference as you progress.

  2. If you haven't already, you should complete these tutorials before this one:

    • Create Your First Substrate Chain - that will guide you through the process of setting up your development environment.
    • Add a Pallet to Your Runtime - that will introduce the FRAME system for runtime development and guide you through the process of extending the capabilities of a FRAME runtime by adding a pallet.

If you're an experienced developer and wish to skip those tutorials, you can clone the Node Template repository and refer to the documentation for local development.