Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {ForkSeq, MIN_SEED_LOOKAHEAD, SLOTS_PER_EPOCH} from "@lodestar/params";
import {ssz} from "@lodestar/types";
import {CachedBeaconStateFulu, EpochTransitionCache} from "../types.js";
import {FLAG_UNSLASHED} from "../util/attesterStatus.js";
import {computeEpochShuffling} from "../util/epochShuffling.js";
import {computeProposerIndices} from "../util/seed.js";

Expand All @@ -26,7 +27,13 @@ export function processProposerLookahead(
// Save shuffling to cache so afterProcessEpoch can reuse it instead of recomputing
cache.nextShuffling = shuffling;

const lastEpochProposerLookahead = computeProposerIndices(fork, state, shuffling, epoch);
const activeIndices =
fork >= ForkSeq.gloas
? // Exclude slashed validators from proposing (EIP-8045)
shuffling.activeIndices.filter((index) => (cache.flags[index] & FLAG_UNSLASHED) !== 0)
: shuffling.activeIndices;

const lastEpochProposerLookahead = computeProposerIndices(fork, state, {activeIndices}, epoch);

state.proposerLookahead = ssz.fulu.ProposerLookahead.toViewDU([
...remainingProposerLookahead,
Expand Down
Loading