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: markets: Integrate index ingest protocol and retrieve by any CID #7313

Merged
merged 113 commits into from
Mar 3, 2022

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Sep 10, 2021

Related Issues

The motivation for this work is to solve content routing in Filecoin network, and facilitate retrieval of content by any CID.

Fixes:

Proposed Changes

The work here integrates the indexing ingestion protocol into lotus using the default implementation.

As a result, the multihashes contained in successful deals are announced onto indexer ingest gossipsub topic. Similarly, multihashes that belonged to slashed or expired deals are advertised as no longer available. The work exposes an endpoint on the markets process to allow indexer nodes to sync the list of multihashes for processing. The indexers use this information to then provider a service where a user can look up which SP provides a given CID or Multihash.

The work also introduces a peer protection API that allows dynamic change to the list of peer IDs the connection to which is protected by the daemon process. This is introduced so that: 1) there is no need to restart the daemon in order to make changes to this config parameter, and 2) automatically protect connections from markets to daemon process to allow indexing gossip messages to propagate through the network via Damon's connection to Filecoin bootstrap peers.

The lotus CLI is expanded to provide a set of utility commands that allow bulk announcements of all deals to indexers, along with functionality to list and modify peer IDs protected by the daemon process.

Additional Info

Discussion:

Integrates indexing integration work done in go-fil-markets:

Additionally, a range of work is done in filecoin-project/dagstore to accommodate the indexing integration as well as rolling out a new CARv2 index, that stores the multihash code as well as the multihash digest in the CARv2 indices.

The core index provider functionality integrated is implemented in filecoin-project/index-provider. The Indexing protocol and indexer node can be found in filecoin-project/storetheindex.

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@aarshkshah1992 aarshkshah1992 force-pushed the feat/cid-to-piece-idx branch 2 times, most recently from 3148e0b to 25fa97e Compare September 17, 2021 07:31
@codecov
Copy link

codecov bot commented Sep 20, 2021

Codecov Report

Merging #7313 (4c8015c) into master (6b06c1b) will decrease coverage by 0.20%.
The diff coverage is 32.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7313      +/-   ##
==========================================
- Coverage   40.67%   40.46%   -0.21%     
==========================================
  Files         666      675       +9     
  Lines       72932    73500     +568     
==========================================
+ Hits        29662    29741      +79     
- Misses      38071    38527     +456     
- Partials     5199     5232      +33     
Impacted Files Coverage Δ
api/api_storage.go 0.00% <ø> (ø)
cli/net.go 8.48% <0.00%> (-1.52%) ⬇️
cmd/lotus-miner/index_provider.go 0.00% <0.00%> (ø)
cmd/lotus-miner/main.go 4.20% <0.00%> (-0.04%) ⬇️
lib/oldpath/oldresolver/resolver.go 0.00% <0.00%> (ø)
lib/oldpath/path.go 0.00% <0.00%> (ø)
markets/idxprov/mesh.go 0.00% <0.00%> (ø)
metrics/metrics.go 100.00% <ø> (ø)
node/builder.go 76.47% <ø> (ø)
node/builder_chain.go 100.00% <ø> (ø)
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b06c1b...4c8015c. Read the comment docs.

@magik6k
Copy link
Contributor

magik6k commented Feb 25, 2022

Are there any setup docs you could link in this PR?

@willscott
Copy link
Contributor

#8087 has a lot of docs around it, currently

ZenGround0 and others added 2 commits February 28, 2022 12:57
- Add comment to clarify the reason for loop in testkit
- Trim common prefix in state printed in CLI commands for better
  readability
- Upgrade to a tagged release of `go-fil-markets` that includes indexing
  work; see: filecoin-project/go-fil-markets#673
- Fix typo in CLI usage.
- Add comments to note that it is safe to use fx `OnStart` context when
  starting the provider engine.
- Fix string concatenation in error message formatting.
@masih masih assigned masih and unassigned aarshkshah1992 Mar 2, 2022
@masih masih changed the title retrieve by any cid, and storage index provider feat: markets: Integrate index ingest protocol and retrieve by any CID Mar 2, 2022
Integrate the latest `index-provider` and reflect the changes to engine
configuration. Note that this commit disables announcements of indices
on the network by default as requested for initial merge to master.

Introduce dedicated index provider configuration parameters with
documentation and defaults that match the defaults in index-provider.

Re-generate code as needed.
Copy link
Contributor

@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.

Feels very close to landing. CI is failing.

Looks like there is an unintentional ffi update pushed.

go.mod Outdated Show resolved Hide resolved
chain/store/snapshot.go Outdated Show resolved Hide resolved
Upgrade to the latest `go-fil-markets` that integrates concrete
multicodec for the indexing metadata.
The dependency was used in the chain API. Integrated the new fetcher
factory.
node/impl/full/chain.go Outdated Show resolved Hide resolved
Update dependency to go-fil-markets in `lotus-soup` module and remove
the redundant replace directive.
@magik6k magik6k merged commit 5416ce5 into master Mar 3, 2022
@magik6k magik6k deleted the feat/cid-to-piece-idx branch March 3, 2022 16:50
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.

10 participants