Skip to content

Commit

Permalink
fix: enrol miner in cron for niporep
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed May 27, 2024
1 parent eaecc1c commit 308f0c0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions actors/miner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2206,6 +2206,7 @@ impl Actor {
.collect::<Vec<SectorOnChainInfo>>();

let total_pledge = BigInt::from(sectors_to_add.len()) * initial_pledge;
let mut needs_cron = false;

rt.transaction(|state: &mut State, rt| {
let current_balance = rt.current_balance();
Expand Down Expand Up @@ -2250,9 +2251,21 @@ impl Actor {
.check_balance_invariants(&rt.current_balance())
.map_err(balance_invariants_broken)?;

needs_cron = !state.deadline_cron_active;
state.deadline_cron_active = true;

Ok(())
})?;

if needs_cron {
let new_dl_info = state.deadline_info(rt.policy(), curr_epoch);
enroll_cron_event(
rt,
new_dl_info.last(),
CronEventPayload { event_type: CRON_EVENT_PROVING_DEADLINE },
)?;
}

Ok(())
}

Expand Down

0 comments on commit 308f0c0

Please sign in to comment.