Closed JekaMas closed 6 years ago
https://github.com/kowala-tech/kcoin/blob/dev/client/knode/validator/states.go#L44
client/knode/validator/states.go:44
txHash, err := val.consensus.Join(val.walletAccount, val.deposit)
The logic in the consensus state machine is still present. Hovewer, as far as I can see the backend is always trust to atomic flag from the state machine. It's a kind chicken and egg problem.
So we just need to use the value from the smart contract.
Type:
Issue
What happened? / What do you need?:
A validator don't resume validation after process restart.
If it's an issue, how can we reproduce it?:
but
and
So it looks like we should check the actual state of a validator from the smart contract. The same logic already works in https://github.com/kowala-tech/kcoin/blob/dev/client/knode/validator/states.go#L44
In total there're 3 places to do changes: https://github.com/kowala-tech/kcoin/blob/dev/client/cmd/kcoin/main.go#L310 (doesn't check isValidation at all), https://github.com/kowala-tech/kcoin/blob/dev/client/knode/validator/validator.go#L191 (use isValidator from the smart contract) and PrivateValidatorAPI.Start()+Kowala.StartValidating (them should initialize the proper state but don't run start validating contract again).
Affected servers or services:
Priority:
High