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

Get retrieval pricing input should not error out on a deal state fetch #6679

Merged
merged 3 commits into from
Jul 5, 2021

Conversation

aarshkshah1992
Copy link
Contributor

Closes #6678.

We iterate over all storage deals for a payload to see if we have a verified storage deal with the required PieceCID to fetch the input for the retrieval pricing function. This PR introduces a fix so we don't error out in we fail to look up a deal state and just continue iterating over the other deals.

@@ -138,7 +138,8 @@ func (rpn *retrievalProviderNode) GetRetrievalPricingInput(ctx context.Context,
for _, dealID := range storageDeals {
ds, err := rpn.full.StateMarketStorageDeal(ctx, dealID, tsk)
if err != nil {
return resp, xerrors.Errorf("failed to look up deal %d on chain: err=%w", dealID, err)
log.Warnf("failed to look up deal %d on chain: err=%w", dealID, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that if attempting to fetch the state for all deals fails, we return the error (instead of just logging it) so it's clearer what the root cause is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this. Thanks.

@raulk
Copy link
Member

raulk commented Jul 5, 2021

@aarshkshah1992 lint fails.

@aarshkshah1992
Copy link
Contributor Author

@raulk Have addressed your review and lint is now green.

@aarshkshah1992
Copy link
Contributor Author

Note that the CI test failure is a known flaky.

@aarshkshah1992 aarshkshah1992 requested review from magik6k and removed request for magik6k July 5, 2021 10:49
@magik6k magik6k merged commit 5e5de9b into master Jul 5, 2021
@magik6k magik6k deleted the fix/get-retrieval-pricing-input-error branch July 5, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

potential edge case in dynamic retrieval pricing
4 participants