Skip to content

Commit

Permalink
Optimize a skipping condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Nov 30, 2023
1 parent 3d8defc commit cd9c65e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/beacon-node/src/chain/opPools/opPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ export class OpPool {
const slashableIndices = new Set<ValidatorIndex>();
for (let i = 0; i < attesterSlashing.intersectingIndices.length; i++) {
const index = attesterSlashing.intersectingIndices[i];
const validator = state.validators.getReadonly(index);

// If we already have a slashing for this index, we can continue on to the next slashing
if (toBeSlashedIndices.has(index)) {
continue attesterSlashing;
}

const validator = state.validators.getReadonly(index);
if (isSlashableAtEpoch(validator, stateEpoch)) {
slashableIndices.add(index);
}
Expand Down

0 comments on commit cd9c65e

Please sign in to comment.