weihaopeng / W3-POC

A large-scale P2P application protocol testbed based on IPFS and Libp2p for testing W3 which is a consensusless blockchain.
MIT License
7 stars 1 forks source link

Facts & BP Sync Strategies #12

Open ericwangqing opened 2 years ago

ericwangqing commented 2 years ago

W3 should use the best efforts to sync  local facts, bps and blocks and to guarantee theirs legitimate at the same time. W3 uses an optimistic strategy while adding a new block, but a pessimistic one while making or witnessing a block proposal.      

  1. Sync with Best Effort: In making a bp, the maker node only use txs collected before its collecting_end_time, not including txs received in its collecting_sync_time.
  2. Guardedly Witness: In witnessing a bp, the witness node checks all txs of the bp against its local facts,  any unfound tx in the local facts will be marked as unfound and therefore be dropped while finally minted into a block.
  3. Sync with Best Effort: In adding new block, no matter the block is final added or not (because losing in comparing against the current epoch block), all txs within it will be added into the witness' local facts.