Since there was a hard fork at block #22156660 on mainnet on 5th Dec around 7AM UTC, some nodes that were running an older version of bor and using the old genesis ended up on a different fork. Here are the instructions to check if your node is on a different fork and to get it back in sync.

Check if the node is on a different fork:

  1. SSH into your node
  2. Check the block hash at height #22156800 and confirm if 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"
  1. If it doesn't match 0x33f08e82cd658d933aec2cf90cf10d7443043c036ac4da030fc5319eba267601, it means you are on a different fork. Please follow the instructions below to upgrade and bring your node back in sync.

Upgrade and sync instructions

First, upgrade bor on your node to the latest version by following the instructions below:

  1. Navigate to bor directory

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

    git fetch
    git checkout v0.2.12-beta3
  3. Build latest changes

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

    cd ~ 
  5. Download the latest genesis file. We are upgrading the genesis contract through changed genesis.

    curl <> --output ~/genesis.json
  6. 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.

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

    sudo service bor start
  9. Once your node is upgraded, rewind the chain to a block behind the hard fork. We are rewinding to block 22156600:

    $ bor attach ~/.bor/data/bor.ipc
    > debug.setHead("0x1521538")
  10. Now wait for the chain to rewind and once the chain is in sync with the blockchain tip, recheck the hash at block #22156800 using the above instructions in "Check if the node is on a different fork" to ensure that your node is in sync with the chain.