kcoin
kcoin copied to clipboard
Duplicate vote errors during the tests for 'nil' proposed block
Type:
Issue
What happened? / What do you need?:
At the moment we ignore all errors in client/knode/validator/validator.go
on val.votingSystem.Add(addressVote)
.
One of the errors is a duplicate vote on prevote and vote stage:
INFO [07-12|09:24:16.428] Pre vote sub-election
ERROR[07-12|09:24:16.430] a duplicate vote in voting table 0. Error:
Vote(ba8890175554d0f62551c453b1fdb988434c1780dc16675c2ea662599dc34ef6)
Block Number: 30
Block Hash: 0000000000000000000000000000000000000000000000000000000000000000
Round: 0
Type: 0
V: 0x27
R: 0xf84e4561a704dd81237ce18cacd0defae2020228bf240df0f5a9780a555079
S: 0x79b753078f4bdaa92eaa0d9cfec8d5697ce237862757b70da1b07bee18edbaab
Hex: f866a000000000000000000000000000000000000000000000000000000000000000001e8080279ff84e4561a704dd81237ce18cacd0defae2020228bf240df0f5a9780a555079a079b753078f4bdaa92eaa0d9cfec8d5697ce237862757b70da1b07bee18edbaab
WARN [07-12|09:24:16.430] Failed to add own vote to voting table err="duplicate vote"
INFO [07-12|09:24:16.430] Waiting for a majority in the pre-vote sub-election
INFO [07-12|09:24:16.430] There's a majority in the pre-vote sub-election!
INFO [07-12|09:24:16.430] Pre commit sub-election
ERROR[07-12|09:24:16.432] a duplicate vote in voting table 1. Error:
Vote(a7f78f200990c886e8ac306cc3dbab553174433cae50d1b408882744ce61a119)
Block Number: 30
Block Hash: 0000000000000000000000000000000000000000000000000000000000000000
Round: 0
Type: 1
V: 0x27
R: 0xc5e163dc0ba10673f55274cd972aedb510ab49546df1f2b5bc0058390940eb96
S: 0x3703c773a58acf4983738905ab050f19da2f146c7beef21ec19bc144be0b06e7
Hex: f867a000000000000000000000000000000000000000000000000000000000000000001e800127a0c5e163dc0ba10673f55274cd972aedb510ab49546df1f2b5bc0058390940eb96a03703c773a58acf4983738905ab050f19da2f146c7beef21ec19bc144be0b06e7
It happens quite a few times during e2e
. And it can cause the reorg chain error:
ERROR[07-12|09:24:11.003] Impossible reorg, please file an issue oldnum=26 oldhash=e2441a…15148c newnum=26 newhash=e2441a…15148c
I'm not sure it is safe to ignore this errors. @rgeraldes Could you advise about that? Is it expected behavior or the issue?
If it's an issue, how can we reproduce it?:
Run e2e tests with proper logging in client/knode/validator/validator.go
Priority:
Medium
Happened here: https://ci.kowala.io/kowala-tech/kcoin/2275/10
'not-nil' vote case is solved in https://github.com/kowala-tech/kcoin/pull/613
reorg error ERROR[07-12|09:24:11.003] Impossible reorg, please file an issue oldnum=26 oldhash=e2441a…15148c newnum=26 newhash=e2441a…15148c
is solved in https://github.com/kowala-tech/kcoin/issues/642
It's happening now in the devnet with 2 validators