From 16473cbd1362b161091de20dfa647f681038de5c Mon Sep 17 00:00:00 2001 From: Taras Alekhin Date: Thu, 26 Sep 2024 17:49:50 +0200 Subject: [PATCH] fix: validator withdrawal calculation --- src/jobs/validators/utils/get-validator-withdrawal-timestamp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobs/validators/utils/get-validator-withdrawal-timestamp.ts b/src/jobs/validators/utils/get-validator-withdrawal-timestamp.ts index b72b775..14b5c69 100644 --- a/src/jobs/validators/utils/get-validator-withdrawal-timestamp.ts +++ b/src/jobs/validators/utils/get-validator-withdrawal-timestamp.ts @@ -34,7 +34,7 @@ export function getValidatorWithdrawalTimestamp( const diff = index.sub(lastWithdrawalValidatorIndex); const percentOfActiveValidators = activeValidatorCount / totalValidatorsCount; const lengthQueueValidators = diff.lt(0) - ? BigNumber.from(activeValidatorCount).sub(lastWithdrawalValidatorIndex).add(index) + ? BigNumber.from(totalValidatorsCount).sub(lastWithdrawalValidatorIndex).add(index) : diff; const slots = lengthQueueValidators.div(BigNumber.from(WITHDRAWALS_VALIDATORS_PER_SLOT));