A new version for Bor on Polygon PoS mainnet was made available on 5th Dec around 7:00 AM UTC. Nodes running an older version of Bor may have gone out of sync after block 22156660
. Here are the instructions to upgrade bor and get your node back in sync.
Please note that this upgrade requires a genesis update. So please ensure that you complete steps (6) and (7) below.
Upgrade and Sync Instructions
-
Stop the bor service
sudo service bor stop
-
Navigate to bor directory
cd ~/bor
-
Fetch the latest changes and use Bor v0.2.12-beta3:
git fetch git checkout v0.2.12-beta3
-
Build the latest changes
make bor-all
-
Go back to the home directory
cd ~
-
Download the latest genesis file. We are upgrading the genesis contract through changed genesis.
curl https://raw.githubusercontent.com/maticnetwork/launch/ea7ef12751291f7331b383506e5a714703f37362/mainnet-v1/sentry/sentry/bor/genesis.json --output ~/genesis.json
-
Init bor with the new genesis file
bor --datadir ~/.bor/data init ~/genesis.json
If you are using a non-default
datadir
, please ensure you input the correct one you have been using. -
You should see the output as follows:
... ... INFO [12-03|19:57:02.531] Successfully wrote genesis state database=chaindata hash=... ... INFO [12-03|19:57:02.556] Successfully wrote genesis state database=lightchaindata hash=... ... ...
-
Start the bor service
sudo service bor start
-
Check the block hash at height #22156800 and confirm that the output matches
0x33f08e82cd658d933aec2cf90cf10d7443043c036ac4da030fc5319eba267601
:curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1521600", false],"id":1}' localhost:8545 | jq ".result.hash"
-
If it doesn’t match the above output, rewind the chain to a block. We are rewinding to block 22156600:
$ bor attach ~/.bor/data/bor.ipc > debug.setHead("0x1521538")
-
Once the chain is back in sync, repeat step (10) to ensure that your node is in sync with the main chain.