Matic Mainnet - Bor Upgrade v0.2.6

Hi All,

We have released a new version of Bor - v0.2.6. This is a maintenance release. Major changes are as follows:

  • Latest changes from geth v1.10.3
  • Added overrideStateSyncRecords to genesis
  • Added flag for disabling bor logs

The instructions to upgrade your Mainnet nodes to use the latest version of bor are as follows:

  1. Navigate to bor code directory

    cd ~/bor
    
  2. Fetch latest changes and use Bor v0.2.6:

    git fetch
    git checkout v0.2.6
    
  3. Stop the bor service

    sudo service bor stop
    
  4. Build latest changes

    make bor-all
    

    Now check bor version. This should print —

    Bor
    Version: 1.10.3-stable
    Git Commit: d33ce83cba5e1a1078e339882c048b9a8b210c69
    
  5. Go back to home directory

    cd ~
    
  6. Download the new genesis file:

    curl https://raw.githubusercontent.com/maticnetwork/launch/master/mainnet-v1/sentry/sentry/bor/genesis.json > ~/genesis.json
    
  7. Init bor with new genesis file. Make sure you specify the correct data directory. If you have used ansible, it will be at ~/.bor/data by default. If you are not using the defaults, please modify the datadir in the following command:

    bor --datadir ~/.bor/data init ~/genesis.json
    

    This should print “Successfully wrote genesis state” on your console. That means it was successful.

  8. Start the bor service

    sudo service bor start
    
  9. Check for bor logs if everything is working fine

    journalctl -u bor -f
    

Reach out to us in case you are facing any issues during or after the upgrade.

Thank you!

3 Likes

Upgraded, thanks :slight_smile:

Just a reminder: Found deprecated node list file /home/ubuntu/.bor/data/bor/static-nodes.json, please use the TOML config file instead

2 Likes

Where i can get TOML config file for ubuntu?
Thanks

no, the blockchain data is the same, your node will stay synced after upggrade

Hi, after upgrade to v0.2.6, can i use syncmode=snap and snapshot=true ?

Thanks @gaia for pointing this. We will take care of this in the next release.

Since v0.2.5, snapshot=true by default, unless you explicitly set it as false.

We wouldn’t recommend using syncmode=snap as we have seen some issues with it. The node doesn’t sync the states and block number shows up as 0 always, even after syncing completely. So the recommended setting is ‘full’. But if you are syncing a new node from scratch, then you can use snap mode to sync till latest block quickly and then change it back to full and restart.

Thanks for the reply. Offline state pruning is a fancy feature for me but snap sync is needed.

Hi. If I set --snapshot=true, my nodes can’t catch the latest block. So I set --snapshot=flase.

Does it matter I set --snapshot=false on all my nodes (sentry and validator)?

Hi @blackbear10000 ,

If your node is not able to catchup, this is what I would suggest:

  1. Make --snapshot=false and --syncmode ‘snap’ and restart bor.
  2. This will ensure that your node catches up to the latest block pretty quickly.
  3. Once your node is caught up, remove the option --snapshot=false and change to --syncmode ‘full’ and restart bor.

It is important for all nodes to have snapshot enabled and that’s the reason that geth has made it the default option.

Running into errors on step 7 above

ubuntu@ip-xxx:~$ curl https://raw.githubusercontent.com/maticnetwork/launch/master/mainnet-v1/sentry/sentry/bor/genesis.json > ~/genesis.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 68446  100 68446    0     0   354k      0 --:--:-- --:--:-- --:--:--  353k
ubuntu@ip-xxx:~$ bor --datadir ~/.bor/data init ~/genesis.json
Fatal: invalid genesis file: json: cannot unmarshal object into Go struct field BorConfig.config.bor.period of type uint64

Are these steps still necessary for setting up a full node? The docs Matic Mainnet Node - Sentry & Validator | Matic Network | Documentation talk about bootnode -nodekey ~/.bor/data/bor/nodekey -writeaddress while there is no directory ~/.bor/data/bor/.

Does it need to be created or has it moved? The official Polygon docs are not up to date