Skip to content

Commit 0dee422

Browse files
committed
chore: add more comments
1 parent 7ea1a8b commit 0dee422

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/state-transition/src/epoch/processPendingDeposits.ts

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ function applyPendingDeposit(
109109
addValidatorToRegistry(ForkSeq.electra, state, pubkey, withdrawalCredentials, amount);
110110
const newValidatorIndex = state.validators.length - 1;
111111
cache.isCompoundingValidatorArr[newValidatorIndex] = hasCompoundingWithdrawalCredential(withdrawalCredentials);
112+
// set balance, so that the next deposit of same pubkey will increase the balance correctly
113+
// this is to fix the double deposit issue found in mekong
114+
// see https://github.com/ChainSafe/lodestar/pull/7255
112115
if (cachedBalances) {
113116
cachedBalances[newValidatorIndex] = amount;
114117
}

0 commit comments

Comments
 (0)