Commit 43c11ee 1 parent 92300ad commit 43c11ee Copy full SHA for 43c11ee
File tree 3 files changed +6
-7
lines changed
packages/state-transition/src
3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import {toRootHex} from "@lodestar/utils";
14
14
import { CachedBeaconStateCapella , CachedBeaconStateElectra } from "../types.js" ;
15
15
import {
16
16
decreaseBalance ,
17
- getValidatorMaxEffectiveBalance ,
17
+ getMaxEffectiveBalance ,
18
18
hasEth1WithdrawalCredential ,
19
19
hasExecutionWithdrawalCredential ,
20
20
isCapellaPayloadHeader ,
@@ -173,8 +173,7 @@ export function getExpectedWithdrawals(
173
173
} ) ;
174
174
withdrawalIndex ++ ;
175
175
} else if (
176
- effectiveBalance ===
177
- ( isPostElectra ? getValidatorMaxEffectiveBalance ( withdrawalCredentials ) : MAX_EFFECTIVE_BALANCE ) &&
176
+ effectiveBalance === ( isPostElectra ? getMaxEffectiveBalance ( withdrawalCredentials ) : MAX_EFFECTIVE_BALANCE ) &&
178
177
balance > effectiveBalance
179
178
) {
180
179
// capella partial withdrawal
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {EpochCacheImmutableData} from "../cache/epochCache.js";
18
18
import { processDeposit } from "../block/processDeposit.js" ;
19
19
import { increaseBalance } from "../index.js" ;
20
20
import { computeEpochAtSlot } from "./epoch.js" ;
21
- import { getActiveValidatorIndices , getValidatorMaxEffectiveBalance } from "./validator.js" ;
21
+ import { getActiveValidatorIndices , getMaxEffectiveBalance } from "./validator.js" ;
22
22
import { getTemporaryBlockHeader } from "./blockRoot.js" ;
23
23
import { newFilledArray } from "./array.js" ;
24
24
import { getNextSyncCommittee } from "./syncCommittee.js" ;
@@ -195,7 +195,7 @@ export function applyDeposits(
195
195
const balance = balancesArr [ i ] ;
196
196
const effectiveBalance = Math . min (
197
197
balance - ( balance % EFFECTIVE_BALANCE_INCREMENT ) ,
198
- getValidatorMaxEffectiveBalance ( validator . withdrawalCredentials )
198
+ getMaxEffectiveBalance ( validator . withdrawalCredentials )
199
199
) ;
200
200
201
201
validator . effectiveBalance = effectiveBalance ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export function getConsolidationChurnLimit(epochCtx: EpochCache): number {
75
75
return getBalanceChurnLimit ( epochCtx ) - getActivationExitChurnLimit ( epochCtx ) ;
76
76
}
77
77
78
- export function getValidatorMaxEffectiveBalance ( withdrawalCredentials : Uint8Array ) : number {
78
+ export function getMaxEffectiveBalance ( withdrawalCredentials : Uint8Array ) : number {
79
79
// Compounding withdrawal credential only available since Electra
80
80
if ( hasCompoundingWithdrawalCredential ( withdrawalCredentials ) ) {
81
81
return MAX_EFFECTIVE_BALANCE_ELECTRA ;
@@ -85,7 +85,7 @@ export function getValidatorMaxEffectiveBalance(withdrawalCredentials: Uint8Arra
85
85
}
86
86
87
87
export function getActiveBalance ( state : CachedBeaconStateElectra , validatorIndex : ValidatorIndex ) : number {
88
- const validatorMaxEffectiveBalance = getValidatorMaxEffectiveBalance (
88
+ const validatorMaxEffectiveBalance = getMaxEffectiveBalance (
89
89
state . validators . getReadonly ( validatorIndex ) . withdrawalCredentials
90
90
) ;
91
91
You can’t perform that action at this time.
0 commit comments