From cd9c65ea6554dad1e8fed3f4cd83b5718a8107fb Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Thu, 30 Nov 2023 19:03:28 +0100 Subject: [PATCH] Optimize a skipping condition --- packages/beacon-node/src/chain/opPools/opPool.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/beacon-node/src/chain/opPools/opPool.ts b/packages/beacon-node/src/chain/opPools/opPool.ts index b2a49ae4c07c..54457dc9e52d 100644 --- a/packages/beacon-node/src/chain/opPools/opPool.ts +++ b/packages/beacon-node/src/chain/opPools/opPool.ts @@ -196,12 +196,12 @@ export class OpPool { const slashableIndices = new Set(); 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); }