mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-16 18:28:42 +00:00
Merge branch 'gloas-alpha-spec-9' of https://github.com/eserilev/lighthouse into gloas-alpha-spec-9
This commit is contained in:
@@ -61,8 +61,7 @@ pub enum Error {
|
||||
/// attestation is valid or not.
|
||||
UnknownHeadBlock { beacon_block_root: Hash256 },
|
||||
/// The block referenced by `data.beacon_block_root` is not at slot `data.slot`, i.e. the
|
||||
/// PTC member's assigned slot was empty (the message references the last canonical block at
|
||||
/// an earlier slot).
|
||||
/// PTC member's assigned slot was likely empty.
|
||||
///
|
||||
/// ## Peer scoring
|
||||
///
|
||||
|
||||
@@ -1398,15 +1398,10 @@ impl<E: EthSpec> BeaconState<E> {
|
||||
|
||||
// Post-Gloas, slashed validators are excluded from proposer selection
|
||||
if self.fork_name_unchecked().gloas_enabled() {
|
||||
if self.slashings_cache_is_initialized() {
|
||||
let slashings_cache = self.slashings_cache();
|
||||
indices.retain(|&index| !slashings_cache.is_slashed(index));
|
||||
} else {
|
||||
// Fallback incase the slashing cache isnt initialized for the current slot.
|
||||
// The slashing cache may be cold during block replay or state reconstruction.
|
||||
// This fallback makes the slashing checks infallible.
|
||||
indices.retain(|&index| self.validators().get(index).is_some_and(|v| !v.slashed));
|
||||
}
|
||||
let latest_block_slot = self.latest_block_header().slot;
|
||||
let slashings_cache = self.slashings_cache();
|
||||
slashings_cache.check_initialized(latest_block_slot)?;
|
||||
indices.retain(|&index| !slashings_cache.is_slashed(index));
|
||||
}
|
||||
|
||||
let preimage = self.get_seed(epoch, Domain::BeaconProposer, spec)?;
|
||||
|
||||
Reference in New Issue
Block a user