Skip to content

Commit

Permalink
safe arith in upgrade to electra
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Apr 25, 2024
1 parent bd9b179 commit 9ee134d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion consensus/state_processing/src/upgrade/electra.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use safe_arith::SafeArith;
use std::mem;
use types::{
BeaconState, BeaconStateElectra, BeaconStateError as Error, ChainSpec, EpochCache, EthSpec,
Expand All @@ -19,7 +20,7 @@ pub fn upgrade_to_electra<E: EthSpec>(
.map(|v| v.exit_epoch)
.max()
.unwrap_or(epoch)
+ 1;
.safe_add(1)?;

let consolidation_balance_to_consume = pre_state.get_consolidation_churn_limit(spec)?;
let earliest_consolidation_epoch = spec.compute_activation_exit_epoch(epoch)?;
Expand Down

0 comments on commit 9ee134d

Please sign in to comment.