From 2e3db8a6e681d4edfb4af99b09864cc39f26fb30 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 24 Oct 2023 13:23:45 -0400 Subject: [PATCH] fix: miner: move partitions with expired/terminated sectors (#1455) (removed the tests due to conflicts) --- actors/miner/src/deadline_state.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actors/miner/src/deadline_state.rs b/actors/miner/src/deadline_state.rs index be6ed791f..00ff28115 100644 --- a/actors/miner/src/deadline_state.rs +++ b/actors/miner/src/deadline_state.rs @@ -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)?;