Harden the freezing procedure against failures (#1323)

* Enable logging in tests

* Migrate states to the freezer atomically
This commit is contained in:
Adam Szkoda
2020-07-03 01:47:31 +02:00
committed by GitHub
parent 9dab928572
commit c7f47af9fb
8 changed files with 147 additions and 53 deletions

View File

@@ -51,6 +51,15 @@ impl<E: EthSpec> KeyValueStore<E> for MemoryStore<E> {
Ok(())
}
fn put_bytes_sync(&self, col: &str, key: &[u8], val: &[u8]) -> Result<(), Error> {
self.put_bytes(col, key, val)
}
fn sync(&self) -> Result<(), Error> {
// no-op
Ok(())
}
/// Return true if some key exists in some column.
fn key_exists(&self, col: &str, key: &[u8]) -> Result<bool, Error> {
let column_key = Self::get_key_for_col(col, key);