From fe22c240f2e8129ee53e926566b6c29c618cf193 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 5 Mar 2024 13:16:30 -0500 Subject: [PATCH] FIP-0076: Edit migration details to make it feasible to run (#950) * FIP-0076: Edit migration details to make it feasible to run * address review * Update FIPS/fip-0076.md * Update FIPS/fip-0076.md --------- Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com> --- FIPS/fip-0076.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/FIPS/fip-0076.md b/FIPS/fip-0076.md index e1ed902df..aadd503e9 100644 --- a/FIPS/fip-0076.md +++ b/FIPS/fip-0076.md @@ -578,18 +578,15 @@ 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`: - - 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]; +- 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; - 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: +- 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`. - -[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 (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. The built-in market actor's implementation of deal expiration clean-up must be robust to the provider sector mapping