V0.2.12-beta3 Upgrade for Bor Mainnet post block #22156660

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

  1. Stop the bor service

    sudo service bor stop
    
  2. Navigate to bor directory

    cd ~/bor
    
  3. Fetch the latest changes and use Bor v0.2.12-beta3:

    git fetch
    git checkout v0.2.12-beta3
    
  4. Build the latest changes

    make bor-all
    
  5. Go back to the home directory

    cd ~ 
    
  6. 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
    
  7. 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.

  8. 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=...
    ...
    ...
    
  9. Start the bor service

    sudo service bor start
    
  10. 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"
    
  11. 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")
    
  12. Once the chain is back in sync, repeat step (10) to ensure that your node is in sync with the main chain.

1 Like