Skip to content

Commit

Permalink
Do Not Calculate Churn With 0 Exits (#12976)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas authored Oct 2, 2023
1 parent d8b2d90 commit 46b2442
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beacon-chain/core/blocks/exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func ProcessVoluntaryExits(
beaconState state.BeaconState,
exits []*ethpb.SignedVoluntaryExit,
) (state.BeaconState, error) {
// Avoid calculating the epoch churn if no exits exist.
if len(exits) == 0 {
return beaconState, nil
}
maxExitEpoch, churn := v.ValidatorsMaxExitEpochAndChurn(beaconState)
var exitEpoch primitives.Epoch
for idx, exit := range exits {
Expand Down

0 comments on commit 46b2442

Please sign in to comment.