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

feat: index provider #182

Merged
merged 15 commits into from
Sep 17, 2024
Merged

feat: index provider #182

merged 15 commits into from
Sep 17, 2024

Conversation

LexLuthr
Copy link
Contributor

@LexLuthr LexLuthr commented Aug 29, 2024

This PR breaks IPNI advertisement and publishing into separate modules. If IPNI is enabled:

  1. ipni_task: creates IPNI task for all deals which are not marked as complete. All deals are processed on storage server side and ads are stored in DB.
  2. ipni-provider: This module publishes ads for each provider every 10 minutes. It is also responsible for providing data to IPNI during sync. New provider should be created during main market HTTP server startup and sub-router in the package can be attached to the main mux of the HTTP server.

@LexLuthr LexLuthr force-pushed the feat/index-provider branch from 6db560e to 3d82c0c Compare August 30, 2024 14:27
deps/config/types.go Outdated Show resolved Hide resolved
deps/config/types.go Outdated Show resolved Hide resolved
lib/ipni/chunker/chunker.go Outdated Show resolved Hide resolved
lib/ipni/chunker/chunker.go Outdated Show resolved Hide resolved
lib/ipni/chunker/chunker.go Outdated Show resolved Hide resolved
lib/ipni/ipni-provider/ipni-provider.go Outdated Show resolved Hide resolved
lib/ipni/ipni-provider/ipni-provider.go Outdated Show resolved Hide resolved
tasks/indexing/task_ipni.go Show resolved Hide resolved
tasks/indexing/task_ipni.go Outdated Show resolved Hide resolved
tasks/indexing/task_ipni.go Show resolved Hide resolved
@LexLuthr LexLuthr requested review from gammazero, snadrus and magik6k and removed request for gammazero August 30, 2024 16:25
@LexLuthr LexLuthr changed the base branch from market-migration to main September 6, 2024 08:17
@LexLuthr LexLuthr changed the base branch from main to market-migration September 6, 2024 08:17
Copy link
Collaborator

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

In progress review, I imagine this will still change noticeably


func (p *Provider) GetEntry(block cid.Cid, provider string) ([]byte, error) {
// We should use background context to avoid early exit
// while chunking as first attempt will always fail
Copy link
Collaborator

Choose a reason for hiding this comment

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

What? Why?

db *harmonydb.DB
pieceProvider *pieceprovider.PieceProvider
entriesChunker *chunker.Chunker
cache *lru.Cache[ipld.Link, datamodel.Node]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we get rid of this cache and build/stream entries on the fly?

Base automatically changed from market-migration to feat/market September 17, 2024 15:06
CREATE INDEX ipni_provider_ad_cid ON ipni(provider, ad_cid);


CREATE TABLE ipni_head (
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO (me): Maybe this doesn't need to exist and can just be max(ipni.order_number)

// corresponding CAR offset. The order is maintained consistently regardless of
// the underlying IterableIndex implementation. Returns error if duplicate
// offsets detected.
func CarMultihashIterator(idx index.IterableIndex) (*SliceMhIterator, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO (me): Kill this with fire

Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO (me): Seems like this snuck back into here again

@magik6k magik6k marked this pull request as ready for review September 17, 2024 21:36
Copy link
Collaborator

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Will work on this on top of the main branch

@magik6k magik6k merged commit 839e185 into feat/market Sep 17, 2024
8 of 9 checks passed
@magik6k magik6k deleted the feat/index-provider branch September 17, 2024 21:36
@bajtos
Copy link

bajtos commented Dec 4, 2024

FYI: I am working on a FRC to document the Retrieval Checking Requirements, see filecoin-project/FIPs#1089

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.

4 participants