The goal of this manual is to provide a help to the xDai bridge validators with update of the TokenBridge contracts. The new version of the bridge contract supports usage of the Dai Savings Rate contract through the Chai token to earn the interest for tokens deposited on the bridge balance.
It is important to note that the new bridge contract had no external security audit. The new bridge contracts has been reviewed by the POA Network R&D team only.
Upgrade of the oracle software is mandatory due to the following changes on the bridge contracts:
- a new approach to encode the list of signatures to confirm withdraw operations (xDai to Dai transfers).
- a new worker is implemented to swap Dai tokens to Chai tokens as soon as they appeared on the bridge balance.
The automation script used in the the instructions below hides the following actions and by doing so simplifies the upgrade process significantly:
- generate the new new docker compose environment to introduce new worker
- pull the new TokenBridge oracle docker image
The instructions for upgrade:
- Login to the node where the TokenBridge oracle serving the xDai bridge is run. The next actions will assume that the user is able to run commands with the privileged permissions (either the user is
rootor it is able to call
- Stop the
systemctl stop poabridge
- Download and invoke the upgrade script, checks that no issues appears during the script execution:
curl -sSfL https://github.com/poanetwork/tokenbridge/releases/download/2.0.0/oracle-upgrade-1.2.0-to-2.0.0.sh | sudo bash
- Start the service:
systemctl start poabridge
Wait for 3-5 minutes and check the logs of the oracle’s components (e.g.
/var/log/docker/transfer_1/docker.log). Make sure that there are no errors and restarts.