Validator block backup#2232
Conversation
| let genesis_block_path = genesis_block_directory.join(GENESIS_BLOCK_FILENAME); | ||
| fs_err::write(&genesis_block_path, block_bytes).context("failed to write genesis block")?; | ||
|
|
||
| let _ = BlockStore::bootstrap(data_directory.to_path_buf().join("blocks"), &genesis_block)?; |
There was a problem hiding this comment.
@Mirko-von-Leipzig I was wondering if we should use the store crate's DataDirectory struct for this but there is a discrepancy between the db filepaths atm (validator.sqlite3 vs miden-store.sqlite3).
There was a problem hiding this comment.
I have been wondering if we can't clean things up somehow.. At the moment its not quite an easy split, so maybe what you've got here is fine and we shouldn't force coupling between things that aren't literally the same thing.
We could mimic the struct here with the differences? Or create the struct with a configurable service name e.g. node and validator which would be used to infer the sqlite3 filestem?
But I think lets keep them separate 🤷 They want to store different things over time so maybe its best to keep them decoupled.
| // Ignore errors; we don't want to fail the block validation if the block cannot be backed | ||
| // up. The span of the function will record any errors that occur during backup. | ||
| let _ = self.save_block(&signed_block).await; |
There was a problem hiding this comment.
I'm not too sure about this. Since this is expected to act as a guaranteed block backup system, I think this must fail?
There was a problem hiding this comment.
As long as we are happy to halt the chain on this basis
…-node into sergerad-validator-block-bkp
Stacked PR.
Relates to #2169.
Validator storing blocks via
run-node.sh: