Skip to content

Commit

Permalink
fix: miner: move partitions with expired/terminated sectors (#1455) (#…
Browse files Browse the repository at this point in the history
…1458)

(removed the tests due to conflicts)

Co-authored-by: Aayush Rajasekaran <[email protected]>
  • Loading branch information
Stebalien and arajasek authored Oct 24, 2023
1 parent 7e4cd0e commit 0faa9b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actors/miner/src/deadline_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ impl Deadlines {

let dest_partition_idx = first_dest_partition_idx + i as u64;

// sector_count is both total sector count and total live sector count, since no sector is faulty here.
let sector_count = moving_partition.sectors.len();
let live_sector_count = sector_count - moving_partition.terminated.len();

// start updating orig/dest `Deadline` here

orig_deadline.total_sectors -= sector_count;
orig_deadline.live_sectors -= sector_count;
orig_deadline.live_sectors -= live_sector_count;

dest_deadline.total_sectors += sector_count;
dest_deadline.live_sectors += sector_count;
dest_deadline.live_sectors += live_sector_count;

orig_partitions.set(orig_partition_idx, Partition::new(store)?)?;
dest_partitions.set(dest_partition_idx, moving_partition)?;
Expand Down

0 comments on commit 0faa9b3

Please sign in to comment.