kaistshadow / blockchain-sim

Scalable blockchain simulator/emulator running on shadow simulator
MIT License
9 stars 1 forks source link

Add PoW consensus bundle as a module within BLEEP library #318

Closed ygnkim closed 3 years ago

ygnkim commented 3 years ago

To give a PoW bundle for the users of BLEEP, it is required to implement PoW module within a BLEEP library.

Tentatively, following tasks are required for adding a PoW module.

ygnkim commented 3 years ago

PoW is successfully implemented as a module within BLEEPlib. Appropriate modules (classes) are added within BL3_protocol directory. In other words, PoW is implemented as a protocol in BL3 layer (operating upon a Peer(BL2) layer).

First of all, basic block data structure is implemented (called POWBlock). Then, in order to share the POWBlock among different nodes, and to synchronize the ordering of the blocks among nodes, additional data structure which represents full snapshot of the blocks is implemented. (called BlockTree) Then, the propagation&synchronization protocol is implemented. (using protocol messages such as POWBlockGossipInventory, POWBlockGossipGetBlocks, POWBlockGossipGetData, POWBlockGossipBlk)

I have confirmed that PoW blocks are synchronized successfully among 10 different nodes (see BLEEPlib-pow-treesync-2 in regtest/3_BLEEPlib/3_PoW_treesync).

ygnkim commented 3 years ago

Merged to develop branch by PR #324