filecoin-project / filecoin-project/boost

Deal sector monitoring should be moved to a goroutine

Open
#1,447 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

Current Boost deal flow:

Deal -> Publish -> AP -> IndexandAnnounce (Add Piece Store -> Register with Dagstore -> Announce) -> Watch the sealing pipeline

Retry Deal flow(After AP):

Add Piece Store -> Register with Dagstore (No error if shard already exists) -> Announce -> Watch the sealing pipeline

Problem scenario:

1. For a deal AP is done, dagstore registration failed (some access error) and deal is being sealed in a sector (snap-deal).
2. The deal will show a retry button to IndexandAnnounce but no action is taken
3. Before a sectors update message could land on chain, a failed wdPost results in sectors going to "not Proving" state. The sectors update will fail in this case and it will be reverted to a CC sector. Miner will clean up the unsealed packed copy of the sector.
4. Now, we retry the deal and it will stay stuck at IndexandAnnounce stage and will never go to the stage where we check the for sector status to fail the deal.

Recommended Fix:
1. We should start monitoring the sealing pipeline in a goroutine instead of normal deal flow. It would make sense to fail the deal in above scenario but deal execution will never reach required code for that.
2. We should also try to recover a shard when we retry IndexandAnnounce
```
// register with dagstore
err = p.registerShardSync(ctx, pc)

if err != nil {
if !errors.Is(err, dagstore.ErrShardExists) {
return &dealMakingError{
retry: types.DealRetryAuto,
error: fmt.Errorf("failed to register deal with dagstore: %w", err),
}
}
**********Insert a Recover here with no error check or maybe an error check with already recovering***********
p.dealLogger.Infow(deal.DealUuid, "deal has previously been registered in dagstore")

```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the deal flow through IndexandAnnounce, the sealing-pipeline status check, and registerShardSync during retry. The issue describes two completion conditions: sealing should be monitored independently of normal deal execution, and retrying IndexandAnnounce should attempt shard recovery; verify both paths against the reported stuck-deal scenario.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.