Closed wgr523 closed 5 years ago
The real bug I found is:
The miner update the best_voter at some chain, that best_voter's proposer parent is L. But he has NOT updated best proposer yet. So he will mine a new voter whose proposer parent is at level L-1. But that new block's voter parent's proposer parent is at level L. This causes bad result inside blockchain.
solved in blockchain/mod.rs unvoted_proposer
function. make it to return Option<>.
Nice catch!
We should simply pass the proposer
and voter
blocks mined by self
through validation. This has very little computational cost and removes this and other unknown bugs from the miner.
100 times YES!
fixed
Higher level of the problem: Miner has two information inside the context, A and B. A, B might be inconsistent with each other.
Problem 1. He call blockchain.get_A to collect some information A. Then call blockchain.get_B to collect some information B. Between two calls, some information is changed inside blockchain.
Problem 2. Since Miner is smart updating, if he just receive the signal of "update A", and not receive the signal to update B (yet). Then he call blockchain.get_A. Now A is updated but B is not.