boost icon indicating copy to clipboard operation
boost copied to clipboard

Boost does not take failed snap-deals into account when advertising new indexes or updates

Open LexLuthr opened this issue 2 years ago • 0 comments

We must check the state of the deal itself, before we send the new advertisement updating the unsealed sector state. Otherwise, we might end up keeping the multihashes for failed deals.

Scenario 1:

  1. Deal passed AP, we announce the advertisement.
  2. Sectors failed to seal and unsealed copy is deleted (doesn't happen right now)
  3. UnsealStateManager incorrectly assumed we have a sealed copy of the sector
  4. We do not remove the advertisement and retrievals fail.

Scenario 2: (Extension of 1)

  1. Deal passed AP, we announce the advertisement.
  2. Sectors failed to seal and unsealed copy is deleted (doesn't happen right now)
  3. UnsealStateManager incorrectly assumed we have a sealed copy of the sector
  4. We do not remove the advertisements.
  5. A new deal comes in and now the same sectors is ready for snap-deal again.
  6. Deal is assigned to this sector.
  7. Deal successfully seals and we are now advertising the that we have unsealed copy of the data of failed as well as successful deals for the same unsealed sector.

This problem is further complicated by https://github.com/filecoin-project/boost/issues/1447

Scenario:

  1. Deal passed AP, we fail to index due to some reason.
  2. Sectors failed to seal and unsealed copy is deleted (doesn't happen right now)
  3. Indexing retry fails as we don't have unsealed copy but deal does not fail due to above bug
  4. A new deal comes in and now the same sectors is ready for snap-deal again.
  5. Deal is assigned to this sector and this time everything goes smoothly
  6. Retry indexes old pieceCID with new indexes and new pieceCID with new indexes.
  7. We publish the deal. Now this advertisement will never be removed as new deal is alive and sectors containing it lasts the deal lifetime.

LexLuthr avatar May 15 '23 14:05 LexLuthr