go-ethereum
go-ethereum copied to clipboard
[WIP] consensus, core, eth, miner: use the same insert behavior between proposer and validators
…poser and validators
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 __ ?
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:
- Proposer call
commitNewWork()
to create a block after receivingNewBlockEvent
event - Proposer broadcasts the proposed blocks to other validators
- 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. - If we received 2F+1 commits, we call
writeProposedWork()
to write the committed block into chain db.
This PR changes too many stuffs. We need more tests for this PR before merge
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