Squashed reset to unstable

This commit is contained in:
Daniel Knopik
2025-03-13 12:50:29 +01:00
committed by Daniel Knopik
parent b71b5f2231
commit f61f0b654c
416 changed files with 13195 additions and 38478 deletions

View File

@@ -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),

View File

@@ -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),

View File

@@ -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 },

View File

@@ -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.