Skip to content

Commit

Permalink
FIP-0076: Edit migration details to make it feasible to run (#950)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
arajasek and jennijuju authored Mar 5, 2024
1 parent 990e4d6 commit fe22c24
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions FIPS/fip-0076.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe22c24

Please sign in to comment.