go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

[WIP] consensus, core, eth, miner: use the same insert behavior between proposer and validators

Open markya0616 opened this issue 7 years ago • 4 comments

…poser and validators

markya0616 avatar Jul 17 '17 06:07 markya0616

Please elaborate what the major difference from previous implementation is. What we did before and what we do right now.

For example, previously proposer inserts the block through __ and validator insert the block through __. And now, proposer and validators are the same. They call commitProposedWork during __ step to __? And call writeProposedWork during __ step for __ ?

yutelin avatar Jul 21 '17 03:07 yutelin

OK. In previous implementation, we only verify block's header in Verify() and call InsertChain to insert committed blocks. We don't check the correctness of the block body in Verfiy(), so we may try to lock or commit a block with incorrect body. In this PR, we created an Istanbul worker to improve system performance and check block body (i.e., transactions) in Verify(). The procedure are as follows:

  1. Proposer call commitNewWork() to create a block after receiving NewBlockEvent event
  2. Proposer broadcasts the proposed blocks to other validators
  3. After validators received the proposed block, they call commitProposedWork() and then apply the transactions in the block to check the correctness of the block's body and header.
  4. If we received 2F+1 commits, we call writeProposedWork() to write the committed block into chain db.

markya0616 avatar Jul 24 '17 06:07 markya0616

This PR changes too many stuffs. We need more tests for this PR before merge

markya0616 avatar Aug 08 '17 01:08 markya0616

Where can I report issues with Istanbul? I found one that might be slightly related to this change.

It's explained here in more detail: https://github.com/ethereum/EIPs/issues/650#issuecomment-360085474

stevenroose avatar Jan 24 '18 10:01 stevenroose