Commit Graph

218 Commits

Author SHA1 Message Date
Łukasz Magiera
0c884734a3
Merge pull request #7673 from filecoin-project/chore/DM-level-tests_plus_merkle-proof-cars
Chore/dm level tests plus merkle proof cars
2021-11-24 20:43:39 +01:00
Łukasz Magiera
bd4927b494 retrieval: Cleanup some comments 2021-11-24 20:13:49 +01:00
Peter Rabbitson
46937a1b9f Add tests cementing the DM-level behavior on simple paths 2021-11-24 15:31:15 +01:00
Łukasz Magiera
78949d6c05 retrieval: Fix deadlock in ClientGetRetrievalUpdates 2021-11-23 18:32:56 +01:00
Łukasz Magiera
407c2ed114 retrieval: Drop the RootSelector hack 2021-11-23 17:42:43 +01:00
Łukasz Magiera
25e89d3a7a retrieval: require unixfs exports to be aligned on block boundary 2021-11-22 13:29:09 +01:00
Łukasz Magiera
2c583b03ff retrieval: Support DM-paths in ls 2021-11-22 12:46:29 +01:00
Łukasz Magiera
74f645a098 retrieval: Fix parseDagSpec root check 2021-11-22 12:46:29 +01:00
Łukasz Magiera
597b72e286 retrieval: Fix lint, cli docsgen 2021-11-22 12:46:29 +01:00
Łukasz Magiera
9c119bfdad retrieval: Make the ls command work 2021-11-22 12:46:17 +01:00
Łukasz Magiera
450d0687da retrieval: REST export endpoint 2021-11-22 12:46:17 +01:00
Łukasz Magiera
b83a9b902a gofmt 2021-11-22 12:46:17 +01:00
Łukasz Magiera
b26906963b retrieval: Support multi-root export 2021-11-22 12:46:17 +01:00
Łukasz Magiera
b9bd061bdd fix unixfs selector root node selection 2021-11-22 12:46:04 +01:00
Łukasz Magiera
b868769ec8 more retrieval api work 2021-11-22 12:46:02 +01:00
Łukasz Magiera
89138bab4d Simplify retrieval APIs 2021-11-22 12:45:42 +01:00
Łukasz Magiera
60ea33b1c7 client: cleanup clientRetrieve 2021-11-22 12:45:42 +01:00
Łukasz Magiera
08e297a217 client: Support json selectors in retrieval 2021-11-22 12:45:42 +01:00
Peter Rabbitson
a40aa9f90b Normlize selector use within lotus 2021-10-07 11:01:29 +02:00
Peter Rabbitson
f8ac98bf46 Adjust error wording 2021-10-05 18:16:14 +02:00
Peter Rabbitson
5e6aceeb0e Merge remote-tracking branch 'origin/master' into feat/datamodel-selector-retrieval 2021-10-05 18:15:51 +02:00
Rod Vagg
97c2cdb8d6 traversals: limit link load count for SelectiveCar use as well 2021-10-05 10:47:49 +02:00
Peter Rabbitson
af0d9b650d Error on corner cases with corresponding negative tests 2021-10-04 23:21:24 +02:00
Peter Rabbitson
0444435589 Expose basic text-based datamodel selector on retrieval
Syntaxt of selection is located at
https://pkg.go.dev/github.com/ipld/go-ipld-selector-text-lite#SelectorSpecFromPath

Example use, assuming that:
  - The root of the deal is a plain dag-pb unixfs directory
  - The directory is not sharded
  - The user wants to retrieve the first entry in that directory

  lotus client retrieve --miner f0XXXXX --datamodel-path-selector 'Links/0/Hash' bafyROOTCID ~/output

For a much more elaborate example see the top of ./itests/deals_partial_retrieval_test.go
2021-09-10 09:44:11 +02:00
Peter Rabbitson
2c5f4386ba Prepare the retrieval codepath for selectors
Slight import-name shuffle, no functional changes
2021-09-09 12:42:58 +02:00
Aarsh Shah
d7076778e2
integrate DAG store and CARv2 in deal-making (#6671)
This commit removes badger from the deal-making processes, and
moves to a new architecture with the dagstore as the cental
component on the miner-side, and CARv2s on the client-side.

Every deal that has been handed off to the sealing subsystem becomes
a shard in the dagstore. Shards are mounted via the LotusMount, which
teaches the dagstore how to load the related piece when serving
retrievals.

When the miner starts the Lotus for the first time with this patch,
we will perform a one-time migration of all active deals into the
dagstore. This is a lightweight process, and it consists simply
of registering the shards in the dagstore.

Shards are backed by the unsealed copy of the piece. This is currently
a CARv1. However, the dagstore keeps CARv2 indices for all pieces, so
when it's time to acquire a shard to serve a retrieval, the unsealed
CARv1 is joined with its index (safeguarded by the dagstore), to form
a read-only blockstore, thus taking the place of the monolithic
badger.

Data transfers have been adjusted to interface directly with CARv2 files.
On inbound transfers (client retrievals, miner storage deals), we stream
the received data into a CARv2 ReadWrite blockstore. On outbound transfers
(client storage deals, miner retrievals), we serve the data off a CARv2
ReadOnly blockstore.

Client-side imports are managed by the refactored *imports.Manager
component (when not using IPFS integration). Just like it before, we use
the go-filestore library to avoid duplicating the data from the original
file in the resulting UnixFS DAG (concretely the leaves). However, the
target of those imports are what we call "ref-CARv2s": CARv2 files placed
under the `$LOTUS_PATH/imports` directory, containing the intermediate
nodes in full, and the leaves as positional references to the original file
on disk.

Client-side retrievals are placed into CARv2 files in the location:
`$LOTUS_PATH/retrievals`.

A new set of `Dagstore*` JSON-RPC operations and `lotus-miner dagstore`
subcommands have been introduced on the miner-side to inspect and manage
the dagstore.

Despite moving to a CARv2-backed system, the IPFS integration has been
respected, and it continues to be possible to make storage deals with data
held in an IPFS node, and to perform retrievals directly into an IPFS node.

NOTE: because the "staging" and "client" Badger blockstores are no longer
used, existing imports on the client will be rendered useless. On startup,
Lotus will enumerate all imports and print WARN statements on the log for
each import that needs to be reimported. These log lines contain these
messages:

- import lacks carv2 path; import will not work; please reimport
- import has missing/broken carv2; please reimport

At the end, we will print a "sanity check completed" message indicating
the count of imports found, and how many were deemed broken.

Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Co-authored-by: Dirk McCormick <dirkmdev@gmail.com>

Co-authored-by: Raúl Kripalani <raul@protocol.ai>
Co-authored-by: Dirk McCormick <dirkmdev@gmail.com>
2021-08-16 23:34:32 +01:00
Anton Evangelatov
fe31956713 fetch peer id from chain 2021-07-21 11:43:19 +02:00
hannahhoward
92ec239202 fix(node): ClientRetrieve stops on cancel
When a deal is cancelled, any in progress calls to ClientRetrieve or ClientRetrieveWithEvents should
return
2021-07-12 14:46:18 -07:00
Łukasz Magiera
3f3336340f Fix wallet error messages 2021-06-25 10:48:47 +02:00
Łukasz Magiera
a7746961fb Merge remote-tracking branch 'origin/master' into feat/list-retrievals 2021-06-04 20:49:01 +02:00
Łukasz Magiera
ffa47659a1 Merge remote-tracking branch 'origin/feat/nv13' into feat/nv13-1.11 2021-05-31 21:38:34 +02:00
Aayush Rajasekaran
fba5c65ffd Extend the default deal start epoch delay 2021-05-28 12:35:48 -04:00
hannahhoward
19b6dc8d1e feat(cli): add a list retrievals command
Currently, there is no way to inspect retrievals on a client. This adds said command, allow with
corresponding APIs
2021-05-27 11:48:25 -07:00
Aayush Rajasekaran
d9e86afa24 Tweak client calcDealExpiration to consider genesis miners 2021-05-26 21:46:37 -04:00
Peter Rabbitson
6f71eab8ce Adjust lp2p retry params 2021-05-11 04:26:04 +02:00
Peter Rabbitson
e648b72d8d Merge remote-tracking branch 'origin/master' into feat/stateless-offline-dealflow 2021-05-06 15:57:10 +02:00
Reskorey
58bee65bcb go fmt 2021-04-23 16:10:51 +08:00
Reskorey
7738886936
fix full node painc
fix: full node painc  when calling  RPC  Filecoin.ClientRetrieve without the order.Tatol pecified.
2021-04-23 15:43:41 +08:00
Peter Rabbitson
b79be2a2c2 Merge remote-tracking branch 'origin/master' into feat/stateless-offline-dealflow 2021-04-05 16:06:44 +02:00
Peter Rabbitson
7fddbb528d Introduce stateless offline dealflow, bypassing the FSM/deallists
This is aproposal for an additional flag --manual-stateless-deal and a
corresponding API endpoint ClientStatelessDeal. This allows firing off
an offline-style deal against a miner without keeping further track of
it locally.

Not keeping any local state introduces the limitation of requiring free
storage deals, as there is nothing to tie the payment channel setup to.

Rationale/need for this type of flow is the case of incredibly large
sets of data nd deals, where the client and providers have prearranged
payment ahead of time, and the client has a separate-from-lotus database
of deal inventory. This way the client can use their lotus node merely
as a network gateway, without running into any limitations currently
present in both lotus as a whole and go-fil-markets in particular.

Specific context for this work is filecoin-discover, where the requirement
is to onboard ~ 12,000,000 individual deals against a pool of miners
with whom the client has prearranged a relationship.
2021-04-05 13:11:10 +02:00
Łukasz Magiera
4538550999 Merge remote-tracking branch 'origin/master' into feat/local-retrieval 2021-04-02 12:36:28 +02:00
Anton Evangelatov
df003d44d2 include Stages and DealStages only on ClientDealInfo, not on ClientListDeals 2021-04-01 17:08:01 +03:00
Anton Evangelatov
967fbf52c6 resolve conflicts 2021-03-31 23:14:29 +03:00
Łukasz Magiera
dfe8a1c1e2 client: Set the client var in the correct scope 2021-03-31 19:38:02 +02:00
Łukasz Magiera
f2ab316fb1 Local retrieval support 2021-03-30 21:32:06 +02:00
Raúl Kripalani
fd91c095c4 rename command to cancel-retrieval; rename args to follow Lotus style. 2021-03-26 16:37:46 +00:00
Dirk McCormick
b13f6a3209 fix: cancel retrieval deal - disallow negative deal ID 2021-03-26 09:51:07 +01:00
Anton Evangelatov
a202f9d19e add cancel-retrieval-deal cmd 2021-03-24 18:18:49 +02:00
Anton Evangelatov
86772a09c7 use new channelmonitor.Config 2021-03-19 13:53:03 +02:00
Anton Evangelatov
9d6c77d93f remove interactive UX; add inspect-deal cmd 2021-03-18 14:53:03 +02:00