Skip to content

Commit

Permalink
Remove baseline power check (#1107)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex North <[email protected]>
  • Loading branch information
sudo-shashank and anorth authored Jun 4, 2024
1 parent ea7c454 commit 6d0725a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions actors/reward/src/testing.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{baseline_power_from_prev, State};
use crate::State;
use fil_actors_runtime::MessageAccumulator;
use fvm_shared::{clock::ChainEpoch, econ::TokenAmount};
use num_traits::Signed;
Expand Down Expand Up @@ -52,17 +52,5 @@ pub fn check_state_invariants(
format!("cumsum realized negative ({})", state.cumsum_realized),
);

// Theoretically we should compare effective_baseline_power <= this_epoch_baseline_power but
// because of rounding issues explained and tracked in https://github.com/filecoin-project/builtin-actors/issues/459
// we settled on this workaround.
let next_epoch_baseline_power = baseline_power_from_prev(&state.this_epoch_baseline_power);
acc.require(
state.effective_baseline_power <= next_epoch_baseline_power,
format!(
"effective baseline power ({}) > next_epoch_baseline_power ({})",
state.effective_baseline_power, next_epoch_baseline_power
),
);

(StateSummary::default(), acc)
}

0 comments on commit 6d0725a

Please sign in to comment.