parallel-finance / parallel

A decentralized lending & staking protocol built on top of the Polkadot ecosystem.
https://parallel.fi
GNU General Public License v3.0
120 stars 35 forks source link

Upgrade heiko & parallel to v177 #1318

Closed GopherJ closed 2 years ago

mclyk commented 2 years ago

Parallel Runtime Test

Refer to #1195
Here is the config file config.yml that we used to initial our network: the current node-version on relaychain is v0.9.17 (onfinality-node), link the current node-version on parachain is v1.7.7, link the current wasm-version on parachain is v1.7.6. link

relaychain:
  image: parity/polkadot:v0.9.17
  chain: rococo-local
  env:
      RUST_LOG: xcm=trace
  flags:
    - --rpc-methods=unsafe
    - --wasm-execution=compiled
    - --execution=wasm
    - --state-cache-size=0
  nodes:
    - name: alice
    - name: bob
    - name: charlie

parachains:
  - image: parallelfinance/parallel:v1.7.6-rc4
    chain:
      base: parallel-dev
      collators:
        - alice
        - bob
        - charlie
      sudo: dave
    id: 2012
    parachain: true
    flags:
      - --rpc-methods=unsafe
      - --force-authoring
      - --wasm-execution=compiled
      - --execution=wasm
      - --state-cache-size=0
    relaychainFlags:
      - --wasm-execution=compiled
      - --execution=wasm
      - --state-cache-size=0
    env:
      RUST_LOG: xcm=trace,loans=trace,liquidStaking=trace,crowdloans=trace,amm=trace
    nodes:
      - flags:
          - --alice
      - flags:
          - --bob
      - flags:
          - --charlie
mclyk commented 2 years ago

Initial network

1.1 Build docker config file

# use above config.yml, not use config.yml in repo
$ sudo parachain-launch generate config.yml
# parachain node may be down, ignore it and modify parachain node to v0.9.17
$ sudo docker-compose -f output/docker-compose.yml up -d --build

1.2 Upgrade parachain node to v0.9.17 change from parallelfinance/parallel:v1.7.6-rc4 to parallelfinance/parallel:v1.7.7-rc0, which means changed nodes from v0.9.16 to v0.9.17

$ nano output/parachain-2012.Dockerfile
>>> FROM parallelfinance/parallel:v1.7.7-rc0

1.3 upgrade collator node version

$ sudo docker-compose -f output/docker-compose.yml up -d --build parachain-2012-0
$ sudo docker-compose -f output/docker-compose.yml up -d --build parachain-2012-1
$ sudo docker-compose -f output/docker-compose.yml up -d --build parachain-2012-2

1.4 Parachain success produce blocks image

# shutdown the service
$ sudo docker-compose -f output/docker-compose.yml down
$ sudo docker volume prune -f
$ sudo docker network prune -f
$ sudo docker rmi -f $(sudo docker images | grep output | awk '{print $3}')
mclyk commented 2 years ago

Runtime upgrade

1.1 compile wasm-v1.7.7 Based on this commit

sudo srtool build -p parallel-runtime

1.2 parachainSystem.authorizedUpgrade image

1.3 parachainSystem.enactAuthorizedUpgrade image

1.4 success (runtime upgrade& migration) image

mclyk commented 2 years ago

Heiko Runtime Test

Refer to #1094 Here is the config file config.yml that we used to initial our network: the current node-version on relaychain is v0.9.17 (onfinality-node), link the current node-version on parachain is v1.7.7, link the current wasm-version on parachain is v1.7.6. link

relaychain:
  image: parity/polkadot:v0.9.17
  chain: rococo-local
  env:
      RUST_LOG: xcm=trace
  flags:
    - --rpc-methods=unsafe
    - --wasm-execution=compiled
    - --execution=wasm
    - --state-cache-size=0
  nodes:
    - name: alice
    - name: bob
    - name: charlie

parachains:
  - image: parallelfinance/parallel:v1.7.6-rc4
    chain:
      base: heiko-dev
      collators:
        - alice
        - bob
        - charlie
      sudo: dave
    id: 2085
    parachain: true
    flags:
      - --rpc-methods=unsafe
      - --force-authoring
      - --wasm-execution=compiled
      - --execution=wasm
      - --state-cache-size=0
    relaychainFlags:
      - --wasm-execution=compiled
      - --execution=wasm
      - --state-cache-size=0
    env:
      RUST_LOG: xcm=trace,loans=trace,liquidStaking=trace,crowdloans=trace,amm=trace
    nodes:
      - flags:
          - --alice
      - flags:
          - --bob
      - flags:
          - --charlie

error logs while start parachain node under 176 Error: Service(Other("Failed to get runtime version: RuntimeConstruction(Other(\"host doesn't provide such function: env:ext_storage_root_version_2\"))"))

Follow the guide in Parallel runtime, just ignore the down node and directly upgrade parachain node to 1.7.7

$ nano output/parachain-2085.Dockerfile
>>> FROM parallelfinance/parallel:v1.7.7-rc0

$ sudo docker-compose -f output/docker-compose.yml up -d --build parachain-2085-0
$ sudo docker-compose -f output/docker-compose.yml up -d --build parachain-2085-1
$ sudo docker-compose -f output/docker-compose.yml up -d --build parachain-2085-2

Success

image

GopherJ commented 2 years ago
  1. parallel-dev worked
image
  1. heiko-dev worked
image