-
Notifications
You must be signed in to change notification settings - Fork 42
Unexpected log output - appears to double sign #314
Comments
I should probably have it print out the entire consensus state here rather than just the height. There's also the round and step to consider, which is my guess of what's happening here. |
PR to add height/round/step logging here: https://github.com/tendermint/kms/pull/316/files |
@mdyring that's merged to |
Thanks, I've tested with master and it seems something is fishy:
I am testing this with softsign, but don't believe it makes a difference. Also happy to share config if you'd like. |
Interestingly, on our current production setup, with a single connection from kms -> val, we see two log files for each block - so also not a line for each step as you'd expect:
|
I'm now guessing both validators are submitting an identical block and requesting it be signed, which is allowed under the current logic (and results in an identical signature, as Ed25519 is deterministic): https://github.com/tendermint/kms/blob/master/src/chain/state.rs#L97 I can add the block ID being signed to the log output to confirm this. I think this should be allowed, since it tolerates faults where the KMS signs a block for a validator which goes down. If another validator asks to sign the same block as the original, and the signature algorithm is deterministic, it's really just recomputing the original signature.
Those are the steps of Tendermint consensus: PreVote -> PreCommit -> Commit (where the first two each require a signature) |
PR to add block ID logging and a |
@mdyring want to try it out again with the logging changes from #317 and see what the output is? They now look something like this and will add a
|
Happy to report it is as guessed (identical blocks) :-) Minor detail: it shows [dup] for same PreVote/PreCommit. Since block id is now logged, I think we can safely remove the [dup] logging as it doesn't add that much value.
Thanks for the work on this and it appears we can safely do active/active now with multiple vals and a single KMS. I will increase number of vals for further testing, but feel free to close this issue. |
Btw would be great to add block id logging when there is a problem, such as these:
|
Yeah, the logging isn't correct, and making it correct would require changes to the state file, so I think I'll follow your recommendation and remove it for now, but add more block ID logging. |
Looks great, thanks! Some minor details for consistency:
|
We're testing an active/active setup of two validators connecting to a single tmkms v0.6.0-rc1 process on the gaia-13004 testnet.
AFAICS in the source, "signed at height" is only logged after a signature is created:https://github.com/tendermint/kms/blob/e5dadf1a7bef351ea78c082e1aefab3db44aedfc/src/session.rs#L221
So it appears tmkms is double signing for the same chain id?
Our validator is not getting slashed so far.. Maybe because we have yet to propose a block and have been lucky so far (prevoting/commiting on same data on both vals).
The text was updated successfully, but these errors were encountered: