Contatract Weekly Update (Mar. 8, 2020)

This week we tested and optimized the consensus mechanism and the storage subnet. An important result of the test is that the upload and download speeds of the distributed nodes have reached the highest network speed, that is, the bottleneck is no longer in the program but in the bandwidth. So speed is not the bottleneck of distributed storage.

Storage subnet optimization:

  1. By caching the original data, reduced the data transfer back and forth, and speeded up the upload or download speed;
  2. Optimized protocol processing, the time-consuming read and write protocols are placed in one thread, so as to avoid blocking other protocols;
  3. Fixed the problem that when the storage node claims space, the data is required to be read by other storage nodes before the data is written;
  4. Optimized the synchronization between storage nodes, limiting each storage file to open up to 3 threads to write data;
  5. Fixed the problem of "resource temporarily unavailable" due to multi-threaded operation of Leveldb when the network is particularly slow.

Consensus testing:

  1. Fix the problem that the block cannot continue to be generated due to the rigorous verification of messages in the confirmation phase in the PBFT consensus;
  2. Fixed the issue that occasionally crashed due to simultaneous reading and writing of node state variables by multiple coroutines in the PBFT consensus;
  3. In the PBFT consensus, fixed the occasional disorder of the block's direction in the confirmation phase, the potential issue of the block cannot be continued.