kowala-tech / kcoin

A stable cryptocurrency that algorithmically targets $1 USD using the Kowala Protocol
https://www.kowala.tech/
Other
18 stars 16 forks source link

Validate block hash and signatures #808

Closed JekaMas closed 5 years ago

JekaMas commented 5 years ago

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:

Cons:

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

yourheropaul commented 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