Commit Graph

29 Commits

Author SHA1 Message Date
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
Łukasz Magiera
26399dba70 Update markets, cbor-gen with soft map decoding 2021-02-19 20:11:43 +01:00
Aayush Rajasekaran
4982de89b2 Fix chaos 2020-11-17 19:18:57 -05:00
Steven Allen
bcabe7b3b5 migrate methods to abstracted methods
Method numbers never change anyways. At worst, we'll deprecate old methods and
have to explicitly import them from the correct actors version to use them.
2020-10-21 12:18:37 -07:00
Steven Allen
4e730b5ec8 port to v2 imports 2020-10-21 12:16:23 -07:00
Steven Allen
5f3160cf5b continue expanding vm abstraction layer 2020-09-28 12:48:08 -07:00
Alan Shaw
d9951cdff4
fix: regen 2020-09-21 10:10:31 +01:00
Alan Shaw
c1a9cf7edd
refactor: renames 2020-09-21 10:09:05 +01:00
Alan Shaw
dfaad08a8b
fix: update cbor gen file 2020-09-21 10:09:05 +01:00
Alan Shaw
d607ca6118
refactor: remove IsReceiver branch 2020-09-21 10:09:05 +01:00
Alan Shaw
49a94b7cba
chore: appease linter 2020-09-21 10:09:05 +01:00
Alan Shaw
ab53abf04e
feat: add CallerValidationBranchIsReceiver and tests 2020-09-21 10:09:05 +01:00
Alan Shaw
cfa041ca8a
refactor: chaos caller validation 2020-09-21 10:09:01 +01:00
Frank
bf2e3baa8f fix conformance gen 2020-09-17 11:49:23 +08:00
Alan Shaw
ed4caac9bf
fix: remove network version and total fil 2020-09-15 22:24:09 +01:00
Alan Shaw
ae326ce65d
feat: add inspect runtime method to chaos actor 2020-09-15 15:43:37 +01:00
Steven Allen
32eeb96ce7 Update to specs-actors 0.9.9
This patch changes the runtime interfaces, to make it possible to abstract over them.
2020-09-14 12:47:39 -07:00
Alan Shaw
16f7d5801b fix: chaos tests 2020-09-11 15:25:59 +01:00
Raúl Kripalani
cd9858420f
Merge pull request #3736 from filecoin-project/test/chaos-tests 2020-09-11 12:18:27 +01:00
Aayush Rajasekaran
230ef2484d fix tests 2020-09-10 17:41:55 -04:00
Aayush Rajasekaran
316ac61875 Update to go state types 3ca0d2890090 2020-09-10 17:41:55 -04:00
Alan Shaw
c94ff3430c
refactor: use nil value 2020-09-10 14:51:30 +01:00
Alan Shaw
a214069586
chore: appease linter 2020-09-10 14:30:52 +01:00
Alan Shaw
d4b185be5e
test: add chaos actor tests 2020-09-10 14:23:39 +01:00
Alan Shaw
0e7f14159a
refactor: another rename 2020-09-10 12:06:00 +01:00
Alan Shaw
b755ce9528
refactor: renames 2020-09-10 12:03:13 +01:00
Alan Shaw
f3cae55bd4
feat: chaos abort 2020-09-10 11:31:34 +01:00
Raúl Kripalani
6d2b4ab775 fix lint. 2020-09-09 14:28:56 +01:00
Raúl Kripalani
63cdbef219 temp fix test-vectors import cycle. 2020-09-08 21:50:25 +01:00