[Shipped] Improve Node Performance

Objective: reduce 2x data write to disk for every block.

Length: 1 month
Resources: @hyng , @trungtin2qn1 @0xkumi

Key results:
** Profile current testnet Disk I/O by 12 June
** Implement new View backup and restore process by 30 June
** Deploy on testnet 7 July

– In Incognito node, we store new state (view) into disk. When node sync block and create new state, this process will impact disk I/O.
– With the help of statedb(dbv2), we only need to store state root hash, and then able to construct the state using those root hash.
– In this improvement, we reduce the size of the view so that node will not write much data into disk. We expect this could reduce disk I/O data twice and help node sync faster.



Update progress:
For both beacon and shard view, we had

  • Reduced bestblock field
  • Reduced committee-related info
  • Reduced reward receiver info

The written data is reduced 2 times and sync 2x faster than previous version. Next week, we continue to remove remaining fields (stakingtx, autostaking).


We finish the implementation of reducing beacon/shard view. As planned before, it will take 2 more weeks to debug and testing on testnet.

Here, we report the current view size when written to disk every block

Chain Size (bytes) Size After Reduce
Beacon 63872 3603
Shard 0 7622 1616

The sync time of current testnet on a VPS (8CPU, 16GB, 160GB SSD).

Chain 0-500K blocks 500K-1000K blocks
Beacon 2:38:04 3:31:00
Shard 0 2:54:31 3:02:22

The sync time of testnet after reducing view state will be updated later, after well-test code is finished.


Update 10 July 2020

We already have the complete version ready for deploying on the Testnet so the QC team can check the quality.
Over the past two weeks, we have thoroughly tested the new code version as follows:

  1. Synchronize the data on the Testnet and Mainnet to ensure that they work correctly on old data.
  2. Run a local network to ensure that it generates accurate data and does not adversely affect the basic functions of the Network.
  3. Benchmarking the performance of this new version with the Testnet’s data to evaluate what we have done.

Our results are quite good, passing tests 1 and 2, with the benchmark test, here are the results we achieved:

Chain 0-500K blocks 500K-1000K blocks
Beacon 0:21:06 0:24:07
Shard 0 0:41:47 0:31:03

In summary, we have reduced the time to insert data beacon about 87,61% and 79,51% of the time of insert data shard 0. Now, the speed of data insertion has caught up with the speed of data synchronization via Highway, providing a better experience for node owners.


@hyng Should I wait for this week’s update? I keep a close eye on what you’re doing! This is great!

1 Like

Hi @raf, we have finished the development phase, and the code is tested by our QC team. This feature will be run on testnet next week, and mainnet at the end of next month.
You could expect that new Node version will sync the network at least 4 times faster than the old one.

1 Like