Race condition fix + Reliability improvements around forks pruning (#1132)

* Improve error handling in block iteration

* Introduce atomic DB operations

* Fix race condition

An invariant was violated:  For every block hash in head_tracker, that
block is accessible from the store.
This commit is contained in:
Adam Szkoda
2020-05-16 05:23:32 +02:00
committed by GitHub
parent 1cb274008d
commit 59ead67f76
9 changed files with 163 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
use crate::chunked_vector::ChunkError;
use crate::hot_cold_store::HotColdDBError;
use ssz::DecodeError;
use types::BeaconStateError;
use types::{BeaconStateError, Hash256};
#[derive(Debug, PartialEq)]
pub enum Error {
@@ -12,6 +12,7 @@ pub enum Error {
HotColdDBError(HotColdDBError),
DBError { message: String },
RlpError(String),
BlockNotFound(Hash256),
}
impl From<DecodeError> for Error {