Add a cache for public keys to BeaconState

This allows for a fast lookup of "is this public key already in the
validator registry".
This commit is contained in:
Paul Hauner
2019-03-13 16:40:28 +11:00
parent bfa2e71b46
commit 6cd3c4bd1a
8 changed files with 109 additions and 13 deletions

View File

@@ -294,6 +294,8 @@ impl_into_with_index_without_beacon_error!(
pub enum DepositValidationError {
/// Validation completed successfully and the object is invalid.
Invalid(DepositInvalid),
/// Encountered a `BeaconStateError` whilst attempting to determine validity.
BeaconStateError(BeaconStateError),
}
/// Describes why an object is invalid.
@@ -313,7 +315,8 @@ pub enum DepositInvalid {
BadMerkleProof,
}
impl_into_with_index_without_beacon_error!(DepositValidationError, DepositInvalid);
impl_from_beacon_state_error!(DepositValidationError);
impl_into_with_index_with_beacon_error!(DepositValidationError, DepositInvalid);
/*
* `Exit` Validation