From b23e4bd59ab39d96d2ac406cf78baa429679e209 Mon Sep 17 00:00:00 2001 From: Aayush Date: Thu, 22 Feb 2024 13:16:04 -0500 Subject: [PATCH 1/4] FIP-0076: Edit migration details to make it feasible to run --- FIPS/fip-0076.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/FIPS/fip-0076.md b/FIPS/fip-0076.md index e1ed902df..42e18cc32 100644 --- a/FIPS/fip-0076.md +++ b/FIPS/fip-0076.md @@ -579,17 +579,14 @@ The built-in market actor's `ProviderSectors` mapping is initialised from the ex and miner actor state per-sector deal IDs. - For each deal state object in the market actor state that has a terminated epoch set to `-1`: - - find the corresponding deal proposal object and extract the provider's actor ID; - - in the provider's miner state, find the ID of the sector with the corresponding deal ID in sector metadata; - - if such a sector cannot be found, assert that the deal's end epoch has passed and use sector ID `0` [1]; + - find the corresponding deal proposal object; + - if the deal has expired, skip processing this deal + - extract the provider's actor ID, look up the provider's miner state, find the ID of the sector with the corresponding deal ID in sector metadata; - set the new deal state object's sector number to the sector ID found; - - add the deal ID to the `ProviderSectors` mapping for the provider's actor ID and sector number. - For each deal state object in the market actor state that has a terminated epoch set to any other value: - set the deal state object's sector number to `0`. - -[1] It may be impossible to find the sector for a deal that has completed successfully -but not yet been cleaned up in market actor state, -if the corresponding sector has since expired and been compacted out of state. +- For each miner, for each unexpired sector: + - add the deal IDs in the sector to the `ProviderSectors` mapping for the provider's actor ID and sector number. The result includes a value in the `ProviderSectors` mapping for each activated and not yet terminated or expired deal. The built-in market actor's implementation of deal expiration clean-up must be robust to the provider sector mapping From 61eb027953222f6c5a1f60491ce0bd718d54cd2b Mon Sep 17 00:00:00 2001 From: Aayush Date: Thu, 22 Feb 2024 17:08:22 -0500 Subject: [PATCH 2/4] address review --- FIPS/fip-0076.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FIPS/fip-0076.md b/FIPS/fip-0076.md index 42e18cc32..77885faf3 100644 --- a/FIPS/fip-0076.md +++ b/FIPS/fip-0076.md @@ -580,12 +580,12 @@ and miner actor state per-sector deal IDs. - For each deal state object in the market actor state that has a terminated epoch set to `-1`: - find the corresponding deal proposal object; - - if the deal has expired, skip processing this deal + - if the deal has expired, set the sector number to `0`. - extract the provider's actor ID, look up the provider's miner state, find the ID of the sector with the corresponding deal ID in sector metadata; - set the new deal state object's sector number to the sector ID found; - For each deal state object in the market actor state that has a terminated epoch set to any other value: - set the deal state object's sector number to `0`. -- For each miner, for each unexpired sector: +- For each miner, for each unexpired sector (even if the sector has been terminated): - add the deal IDs in the sector to the `ProviderSectors` mapping for the provider's actor ID and sector number. The result includes a value in the `ProviderSectors` mapping for each activated and not yet terminated or expired deal. From 34e483febec4fd8089b7032df5fee832aa1bcffe Mon Sep 17 00:00:00 2001 From: Jiaying Wang <42981373+jennijuju@users.noreply.github.com> Date: Tue, 5 Mar 2024 22:08:29 +0800 Subject: [PATCH 3/4] Update FIPS/fip-0076.md --- FIPS/fip-0076.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FIPS/fip-0076.md b/FIPS/fip-0076.md index 77885faf3..baf313268 100644 --- a/FIPS/fip-0076.md +++ b/FIPS/fip-0076.md @@ -578,7 +578,7 @@ struct GetDealSectorReturn { The built-in market actor's `ProviderSectors` mapping is initialised from the existing deal state and miner actor state per-sector deal IDs. -- For each deal state object in the market actor state that has a terminated epoch set to `-1`: +- For each deal state object in the market actor state that has a slashed epoch set to `-1`: - find the corresponding deal proposal object; - if the deal has expired, set the sector number to `0`. - extract the provider's actor ID, look up the provider's miner state, find the ID of the sector with the corresponding deal ID in sector metadata; From 362f7324fbb0c3d9d956c8015e49658a430a396a Mon Sep 17 00:00:00 2001 From: Jiaying Wang <42981373+jennijuju@users.noreply.github.com> Date: Tue, 5 Mar 2024 22:08:39 +0800 Subject: [PATCH 4/4] Update FIPS/fip-0076.md --- FIPS/fip-0076.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FIPS/fip-0076.md b/FIPS/fip-0076.md index baf313268..aadd503e9 100644 --- a/FIPS/fip-0076.md +++ b/FIPS/fip-0076.md @@ -583,7 +583,7 @@ and miner actor state per-sector deal IDs. - if the deal has expired, set the sector number to `0`. - extract the provider's actor ID, look up the provider's miner state, find the ID of the sector with the corresponding deal ID in sector metadata; - set the new deal state object's sector number to the sector ID found; -- For each deal state object in the market actor state that has a terminated epoch set to any other value: +- For each deal state object in the market actor state that has a slashed epoch set to any other value: - set the deal state object's sector number to `0`. - For each miner, for each unexpired sector (even if the sector has been terminated): - add the deal IDs in the sector to the `ProviderSectors` mapping for the provider's actor ID and sector number.