Double-signing prevention (MVP for launch) #60
Description
This is a tracking issue for KMS double-signing prevention.
Launch goal: attempt to prevent validator bugs or data loss from causing the validator to double sign by making the KMS aware of the current block height.
Longer-term goal: provide defensive capabilities / survive compromise of validator hosts. See #115 for discussion of post-launch double signing improvements.
Previous discussion:
- Accidental double-signing mitigation #11
- Proposal: Use Raft (or other) for fault-tolerant validator processes tendermint#1185
Current Status
- The main blocker for implementing this right now is Access control: validator AuthN and signing key AuthZ #111 - every key in the KMS needs to be tagged with a tendermint::chain::Id, so the KMS can look up the tendermint::block::Height for that particular chain.
signatory-ledger-cosval
signer can track current block height (i.e. it passes the current block height to the Cosmos app running on the Ledger hardware device which persists the previous signed block height), and will refuse to double-sign.
Launch Plan
Add support to the KMS for a user-configurable subcommand for obtaining the current block height. This can be used to "bootstrap" a block height value when a KMS process is started. From there, the KMS can track the last block it signed.
For example, the KMS could call out to a shell script which hits the /status
RPC endpoint for a validator's sentries, piping the output through e.g. jq
to extract "latest_block_height"
and sort
ing the results, taking the highest value. An example script can be included in the KMS repo which people can customize to their needs.
This should allow validators to choose whatever mechanism they like for providing the KMS with the current block height, and implement e.g. storing the current block height in external databases as proposed in #11.
Longer-Term Plan
See #115.