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

announce indices for deals (rebased on main) #319

Merged
merged 23 commits into from Mar 11, 2022

Conversation

nonsense
Copy link
Member

@nonsense nonsense commented Mar 9, 2022

Should be able to announce indices and serve indices for Boost deals and legacy markets deals.
Markets PR at filecoin-project/go-fil-markets#691.

TODO

  • Boost should start after markets so the index provider callback isn't overwritten.
  • Test Market deals announcement on Sofia Miner.
  • Test Boost deal announcement on Sofia Miner.
  • Test the AnnounceAllDeals CLI on Sofia Miner.

cmd/boost/index.go Outdated Show resolved Hide resolved
}

func (w *Wrapper) IndexerAnnounceAllDeals(ctx context.Context) error {
log.Info("will announce all Boost deals to Indexer")
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not very informative, maybe downgrade to Debug ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's just once per that CLI command. Harmless but nice to have when going through logs

@aarshkshah1992 aarshkshah1992 mentioned this pull request Mar 10, 2022
4 tasks
@dirkmc dirkmc force-pushed the nonsense/announce-indices-for-deals branch from 53a52f3 to 221c8eb Compare March 11, 2022 03:16
cmd/boost/index.go Outdated Show resolved Hide resolved

func (w *Wrapper) IndexerAnnounceAllDeals(ctx context.Context) error {
log.Info("will announce all Markets deals to Indexer")
err := w.legacyProv.AnnounceAllDealsToIndexer(ctx)
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't seem to be doing anything with that error, maybe check it and have a WARN log message if it is != nil ?

annCid, err := p.ip.AnnounceBoostDeal(ctx, deal)
if err != nil && !xerrors.Is(err, provider.ErrAlreadyAdvertised) {
return fmt.Errorf("failed to announce deal to index provider: %w", err)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't we check for err != nil (i.e. when the err is provider.ErrAlreadyAdvertised), before saying that deal is successfully announced?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey Anton, if the error is provider.ErrAlreadyAdvertised, we have nothing to worry about and can consider announcement to be successful given how the index provider stuff works.

Copy link
Member Author

Choose a reason for hiding this comment

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

Returning both a result and an error is certainly not idiomatic behaviour and somewhat confusing - this is why I mentioned the comment. We basically end up with an error and with the result (annCid), which is really not what one expects unless they know the full stack.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see what you mean. Have fixed this.

Comment on lines 468 to 470
// We start Boost in this way because we want to ensure Boost is started after the legacy markets Provider.
// We want to do this so that the index provider callback registered by Boost can overwrite the index
// provider callback registered by legacy markets as legacy markets does NOT know about Boost storage deals.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment still correct? It looks like we're starting the index provider in HandleIndexProvider

Copy link
Collaborator

Choose a reason for hiding this comment

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

Removed.

aarshkshah1992 and others added 2 commits March 11, 2022 15:46
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
@nonsense nonsense merged commit d0bd50d into main Mar 11, 2022
@nonsense nonsense deleted the nonsense/announce-indices-for-deals branch March 22, 2022 16:41
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.

None yet

3 participants