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:
- By caching the original data, reduced the data transfer back and forth, and speeded up the upload or download speed;
- Optimized protocol processing, the time-consuming read and write protocols are placed in one thread, so as to avoid blocking other protocols;
- 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;
- Optimized the synchronization between storage nodes, limiting each storage file to open up to 3 threads to write data;
- Fixed the problem of "resource temporarily unavailable" due to multi-threaded operation of Leveldb when the network is particularly slow.
- 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;
- Fixed the issue that occasionally crashed due to simultaneous reading and writing of node state variables by multiple coroutines in the PBFT consensus;
- 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.