Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail OnDealSectorCommitted if the publish message can't be found #3472

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions markets/storageadapter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,22 @@ func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, si
return big.Mul(bounds.Min, big.NewInt(clientOverestimation)), bounds.Max, nil
}

func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealId abi.DealID, cb storagemarket.DealSectorCommittedCallback) error {
func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealId abi.DealID, publishCid cid.Cid, cb storagemarket.DealSectorCommittedCallback) error {
checkFunc := func(ts *types.TipSet) (done bool, more bool, err error) {
sd, err := stmgr.GetStorageDeal(ctx, c.StateManager, dealId, ts)

if err != nil {
// TODO: This may be fine for some errors
msgTs, _, _, err := c.StateManager.SearchForMessage(ctx, publishCid)
if err != nil {
return false, false, xerrors.Errorf("client: failed to search for publish message on chain: %w", err)
}
if msgTs == nil {
// the publish message probably got reorged out, just proceed
// TODO: Eventually give up
return false, true, nil
}

// TODO: This may be fine for some other errors
return false, false, xerrors.Errorf("client: failed to look up deal on chain: %w", err)
}

Expand Down