chore: Validator block backup and key check#2230
Conversation
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
Thank you, LGTM.
Once this stack is in, we should consider what key rotation might look like. Probably possible with this method as well, but maybe we want to keep a history of the public keys we've used in a separate table.. but also maybe not. Likely depends on what comes out of the TEE/privacy/multiple validators discussions.
| for item in secrets.as_account_files(&genesis_state) { | ||
| let AccountFileWithName { account_file, name } = item?; | ||
| let account_path = accounts_directory.join(name); | ||
| let account_path = dirs.accounts_dir().expect("bootstrap directories").join(name); |
There was a problem hiding this comment.
I think we should restrict DataDirectory to only handle the data directory. As in, not be an enum.
Account output directory and genesis output directory are a separate matter. We could simplify these into a single --output-directory argument? Though that would be a technically breaking change right now, so maybe we punt on that, though we can prepare for it so long by making this a single struct.
There was a problem hiding this comment.
Can be cleaned up in a follow up PR.
|
|
||
| /// Creates a validator database seeded with a genesis block whose `validator_key` is the public key | ||
| /// of `key`. Returns the database handle and the genesis block header. | ||
| async fn setup_db_with_genesis(key: &SigningKey) -> (miden_node_db::Db, BlockStore, BlockHeader) { |
There was a problem hiding this comment.
It would be better if this used the actual bootstrapping method to prevent drift. I think that's already possible now? We could even add that as a method to the actual object instead, that does the temp dir stuff etc.
This can be done in a follow up PR though.
Closes #2207.
Changelog