mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 13:28:33 +00:00
Squashed reset to unstable
This commit is contained in:
committed by
Daniel Knopik
parent
b71b5f2231
commit
f61f0b654c
@@ -27,7 +27,7 @@ pub const SLASHING_PROTECTION_FILENAME: &str = "slashing_protection.sqlite";
|
||||
/// The attestation or block is not safe to sign.
|
||||
///
|
||||
/// This could be because it's slashable, or because an error occurred.
|
||||
#[derive(PartialEq, Debug, Clone)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum NotSafe {
|
||||
UnregisteredValidator(PublicKeyBytes),
|
||||
DisabledValidator(PublicKeyBytes),
|
||||
|
||||
@@ -10,7 +10,7 @@ pub struct SignedAttestation {
|
||||
}
|
||||
|
||||
/// Reasons why an attestation may be slashable (or invalid).
|
||||
#[derive(PartialEq, Debug, Clone)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum InvalidAttestation {
|
||||
/// The attestation has the same target epoch as an attestation from the DB (enclosed).
|
||||
DoubleVote(SignedAttestation),
|
||||
|
||||
@@ -9,7 +9,7 @@ pub struct SignedBlock {
|
||||
}
|
||||
|
||||
/// Reasons why a block may be slashable.
|
||||
#[derive(PartialEq, Debug, Clone)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum InvalidBlock {
|
||||
DoubleBlockProposal(SignedBlock),
|
||||
SlotViolatesLowerBound { block_slot: Slot, bound_slot: Slot },
|
||||
|
||||
@@ -1113,7 +1113,7 @@ fn max_or<T: Copy + Ord>(opt_x: Option<T>, y: T) -> T {
|
||||
///
|
||||
/// If prev is `None` and `new` is `Some` then `true` is returned.
|
||||
fn monotonic<T: PartialOrd>(new: Option<T>, prev: Option<T>) -> bool {
|
||||
new.is_some_and(|new_val| prev.map_or(true, |prev_val| new_val >= prev_val))
|
||||
new.is_some_and(|new_val| prev.is_none_or(|prev_val| new_val >= prev_val))
|
||||
}
|
||||
|
||||
/// The result of importing a single entry from an interchange file.
|
||||
|
||||
Reference in New Issue
Block a user