Skip to content

Commit

Permalink
Remove baseline power check
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-shashank committed Jan 25, 2023
1 parent dfe0676 commit 0c98215
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 0c98215

Please sign in to comment.