Crate diem_key_manager

source ·
Expand description

The purpose of KeyManager is to rotate consensus key (and eventually the network key). It is not responsible for generating the first key and fails if the stores have not been properly setup. During rotation, it first updates the local store, then submits a transaction to rotate to the new key. After some period of time and upon restarts of the process, it will evaluate the current status of the system including:

  • last rotation time, and rotate if it is too long ago
  • if the latest key in the store matches the latest key in the ValidatorConfig, upon mismatch it will try to submit a transaction to update the ValidatorConfig to the current key in the store.
  • if the current key in the ValidatorConfig matches the ValidatorSet, if it does not it evaluates the current time from the last reconfiguration and logs that delta with greater levels of severity depending on the delta.

KeyManager talks to Diem via the DiemInterface that may either be a direct link into DiemDB/Executor, JSON-RPC, or some other concoction. KeyManager talks to its own storage through the `DiemSecureStorage::Storage trait.

Modules

Structs

Enums

  • Defines actions that KeyManager should perform after a check of all associated state.

Functions