Closed JekaMas closed 5 years ago
On the local cluster, I get errors like
WARN [10-22|12:36:11.066] Majority of validators pre-voted nil
WARN [10-22|12:36:11.292] got a proposal block add error err="expected proposed block round 33, got 44" block="\n\tProposal(969333d451f6cc2a35a298d94bc5d425b04e2eb90a877de797133
3ffaed6acf7)\n\tBlock Number:\t\t69\n\tRound:\t \t\t\t44\n\tLocked Block:\t\t0000000000000000000000000000000000000000000000000000000000000000\n\tLocked Round:\t\t0\n\tV: \t\t\t0x2
8\n\tR: \t\t\t0xbabea431231c85c8c130f6661c727c7895168fc2e1fe491557385e88c82842ac\n\tS: \t\t\t0x3a2119e7492f8e8f6168c66e2d39b15801f097443fc89d00c5917ab661be3b63\n\tHex:
\t\t\tf88a452c80a00000000000000000000000000000000000000000000000000000000000000000e201a0000000000000000000000000000000000000000000000000000000000000000028a0babea431231c85c8c130f6661c727c7
895168fc2e1fe491557385e88c82842aca03a2119e7492f8e8f6168c66e2d39b15801f097443fc89d00c5917ab661be3b63\n"
WARN [10-22|12:36:12.678] Proposal's block is nil, voting nil block=true
It's a first iteration fixing our consensus and voting.
When I had added proposed block and block fragments validation, the consensus crushed, panicked and crushed. So I had to make many changes until it started work better.
Main changes:
votingSystem
algorithmvalidator.Start
twice, that was caused incorrect voting, a part ofMerkle proof
errors and allduplicate vote
errors.voting_table
while checking for duplicated votesclient/core/voting_table_test.go
to remove shared state between tests and data racesclient/knode/validator/validator.go
val.round is always 0:init -> val.round = 0
,newRoundState -> if val.round != 0 -> val.round++
. It causes that a part of init doesn't work and votingSystem always gets round=0 (causes duplicate votes). So added a proper round change and inits.Cons:
crush-recovery
doesn't work fine.Closes https://github.com/kowala-tech/kcoin/issues/787 https://github.com/kowala-tech/kcoin/issues/91
Next steps are in https://github.com/kowala-tech/kcoin/issues/837