Skip to content

Staging for MainNet 2.2.0 Upgrade

Joe Sacher edited this page Mar 16, 2026 · 9 revisions

Protocol version 2.2.0 upgrade will occur at Era 21742, around 2026-03-23 16:02 UTC.

Summary of changes in this upgrade: https://github.com/casper-network/casper-node/releases/tag/v2.2.0

Staging the Upgrade

Run:

sudo -u casper casper-node-util stage_protocols casper.conf

Note: the latest version of casper-node-launcher installs casper-node-util this can also be installed with sudo apt install casper-node-util, without restarting the node. If you do not want to install, you can still use the deprecated /etc/casper/node_util.py with sudo -u casper /etc/casper/node_util.py stage_protocols casper.conf.

This should show 2_1_1 already staged and 2_2_0 now staging.

casper-node-util watch

Should show: Next Upgrade: {'activation_point': 21742, 'protocol_version': '2.2.0'}

Token Changes with CVV-008

global_state.toml

Included in the upgrade is global_state.toml file:

# The below entry will write the value into an account purse balance.
#
# Key fd37afc9c5c70f04300e55977a07db92eada2f0b3538840752afb8cade90ed3b is the main purse
# for CA Treasury 1 account 02033c97db0328743d0a3b7654751efab570caa6e6c011869f34e65560dc011a348c
#
# Value AAkAAAAIutchOy3mGUII is base64 encoding of 4763091162861000634 motes in U512 data type.
# This represents 33% of the supply at block 6972606 (14433609569450460644)
# plus 4942348218 motes - the current balance of this account.
[[entries]]
key = "balance-fd37afc9c5c70f04300e55977a07db92eada2f0b3538840752afb8cade90ed3b"
value = "AAkAAAAIutchOy3mGUII"

This encoding can be checked with the following script: value_encode.py:

#!/usr/bin/env python3
import sys
import base64

def base64_u512(val):
    return base64.b64encode(bytes(cl_value_u512(val))).decode('utf-8')

def cl_value_u512(val):
    value = u512_bytes(val)
    output = [0, len(value), 0, 0, 0]
    output.extend(value)
    output.extend([8])
    return output

def u512_bytes(val):
    value = int(val)
    if value == 0:
        return [0]
    output_bytes = []
    mask = 255
    while value > 0:
        low_byte = value & mask
        output_bytes.append(low_byte)
        value = value >> 8
    output_bytes.insert(0, len(output_bytes))
    return output_bytes

if __name__ == '__main__':
    val = sys.argv[1]
    print(base64_u512(val))

Make executable and run:

$./value_encode.py 4763091162861000634 
AAkAAAAIutchOy3mGUII

Changes for sustain in chainspec.toml

The following was added to chainspec.toml for CVV-008 sustain functionality:

# purse uref-5bd5c35f2897844b307b9efbb2d7f01f4d51a2ecea8d8b88abd4e3c3a4594693-007 belongs to
# CA Ecosystem Sustainability account 020245b32289d807f3fcd5f9dbec94ff51ee57857f4b39a3b9d6fb99305317d18a32
rewards_handling =  { type = 'sustain', ratio = [2,8], purse_address = "uref-5bd5c35f2897844b307b9efbb2d7f01f4d51a2ecea8d8b88abd4e3c3a4594693-007" }

Clone this wiki locally