Tutorial for Node Upgrade - 6th Dec 2023

We have released a great upgrade for node, now you can upgrade and use it!

What changed this time

Two major upgrades happened to the node this time.

A. In terms of database format, starting from this update, we officially recommend everyone to use the paritydb version.

B. Due to the upstream upgrade, we updated the startup starting parameters for the node.

The two upgrades mentioned above can be operated separately. The specific upgrade steps will be introduced one by one below.

Whom are involved in this upgrade

Only the miners whom use the docker compose directly can join this upgrade.

Worker managers whom use the solo mining scripts, please wait for more time and we will announce again once we finished the upgrade for solo scripts.

How to upgrade

A. Upgrade for the db format

There are two kinds of database of Phala node, Rocksdb and Paritydb. Rocksdb is a general database format, while paritydb is a database format specifically designed by the Parity team for the Polkadot ecosystem.

In the past, the default database format for nodes was rocksdb. However, based on official feedback from Parity, they will not be dealing with rocksdb bugs in the future, but will only be responsible for matters related to paritydb. Therefore, we highly recommend you choose an appropriate time to switch to paritydb in the future.

Please note, the Node data for Rocksdb and Paritydb cannot be used interchangeably - you cannot switch database formats on the same node. When you need to make changes, your only option is to resynchronize from scratch.

How to confirm the database version in use? It depends on the docker image you are using. We made different docker images based on different database formats:

Type Phala Khala
Paritydb phalanetwork/phala-node-with-launcher:v0.1.26 phalanetwork/khala-node-with-launcher:v0.1.26
Rocksdb phalanetwork/phala-node:v0.1.26 phalanetwork/khala-node:v0.1.26

The docker images which contains “with-launcher” are using the Paritydb

In addition, we recommend that devices running Paritydb use ext4 filesystems. Because the headers-cache is known to work worse on btrfs or zfs systems. Please check the file system before adjusting.

B. Upgrade for parameters

Please change the docker image and do some adjustments to the ports. Here is an example for the node docker compose:

version: "3"
services:
  node:
    image: phalanetwork/phala-node-with-launcher:latest
    container_name: node
    hostname: node
    restart: always
    ports:
     - "9944:9944"
     - "9945:9945"
     - "30333:30333"
     - "30334:30334"
    environment:
     - NODE_NAME=PNODE
     - NODE_ROLE=MINER
     - PARACHAIN_EXTRA_ARGS=--max-runtime-instances 32 --runtime-cache-size 8
     - RELAYCHAIN_EXTRA_ARGS=--max-runtime-instances 32 --runtime-cache-size 8
    volumes:
     - /var/phala/node-data:/root/data

Note: in this case, we are using the paritydb.