filecoin-project / filecoin-project/boost

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

Open
#1,448 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
121
Forks
79
Avg merge
10d 14h
Merged PRs (30d)
1

Description

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](https://github.com/filecoin-project/lotus/issues/10869))
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](https://github.com/filecoin-project/lotus/issues/10869))
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](https://github.com/filecoin-project/lotus/issues/10869))
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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the UnsealStateManager path that sends new advertisements or updates unsealed-sector state, then review the failed snap-deal scenarios and the related issue 1447. Confirm how deal state is checked before advertising and how retries handle old piece CIDs. Done means failed deals do not remain advertised while successful deals continue to be indexed and published.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.