Closed olwee closed 4 years ago
-1
is not a valid step
value according to the KMS's current interpretation of these values:
https://github.com/tendermint/kms/blob/b361d15/src/session.rs#L252
If the issue is the block_id
being assigned a value at h/r/s 1/0/0 and therefore triggering the double signing detection logic, I think the better solution would be to only write out the initial state file after signing an initial proposal/vote, rather than initializing it to an (otherwise invalid) default value.
Sounds like a better idea to not write to disk until it signs something if it does not find an existing state file.
FYI, I implemented a fix closer to what @olwee originally proposed on #373 (now using a default block height of 0
)
Versions Tested: Current Master (b361d1584f080807118b50059b08bd1cb1e35b43) , Commits that must be included:
Description:
tmkms creates a blank file (priv_valdiator_state.json) when no such file is present. Contents:
{"height":"1","round":"0","step":0,"block_id": null}
When a request for SignProposal is sent to tmkms ( It has a step of 0 ), tmkms checks the current state file for
step
and finds 0, which is the int forSignProposal
This gives the following error:Fix: It should create a blank file with step - 1 Contents:
{"height":"1","round":"0","step":-1,"block_id": null}