Fast preload database with trusted node

Objective: add backup and preload database feature.

Length: 1 month
Resources: @lam @0xkumi

Key results:
** Backup database at the end of each epoch (1 week)
** Preload database (if need) when joining committee (1 week)
** Deploy on testnet 31 July

– Occasionally, the network must upgrade database version which requires clear database and sync block from zero again. To improve the stability of the network, we should provide a fast mechanism to help Node catch up with the network as soon as possible.

  • In this proposal, we add a feature for a fullnode to backup its database at every epoch, and a node can point to this trusted fullnode to preload the latest backup database.
  • This preload feature could be applied in our Node community with our trusted backup fullnode.

Feature Development Update:

:white_check_mark: Coding is completed.

:clock7: waiting to be deployed on testnet along with other features for testing.


Final Update:

The code is merged and ready to ship in the next deployment.

Benchmark report (server with SSD). Current beacon mainnet with over 4GB of data:
Backup: 1m30s
Restore: 20s (only decompress time, not include transfer time)

It means Node can catch up with the network within a couple of minutes, instead of 5 hours!!! YAY!


  • Although the restore is fast, we must consider the network latency between the trusted node and the restore node. For Node community usage, we need to do some further step (for example push backup file to cloud), so that we can support a large number of running Node.
  • A security warning is this feature should be run with a trusted node, please don’t preload database from untrusted sources, those sources can contain wrong information!