Commit Graph

74 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
Anton Evangelatov
9ad408a0ba add SealProof in sector builder 2021-07-21 16:45:57 +02:00
Anton Evangelatov
b572c2b7bc fix IsUnsealed 2021-07-06 17:40:03 +02:00
Anton Evangelatov
10dc90f7fe addressing comments 2021-07-06 17:33:47 +02:00
Anton Evangelatov
ff2772a58c resolved conflicts 2021-07-06 16:00:41 +02:00
Anton Evangelatov
9839d5701b fix SectorsStatus to query full node for on-chain data 2021-07-06 15:41:14 +02:00
aarshkshah1992
add113f585 use multierror 2021-07-05 16:08:51 +05:30
aarshkshah1992
44985722d2 changes as per review 2021-07-05 15:53:41 +05:30
aarshkshah1992
8ecdc929b4 get retrieval pricing input should not error out on a deal state fetch 2021-07-05 09:34:56 +05:30
Anton Evangelatov
5e10d53ca8 wip 2021-06-22 12:16:21 +02:00
Anton Evangelatov
6720463799 resolve merge conflicts 2021-06-22 11:28:23 +02:00
Anton Evangelatov
c0feb36e70 add missing debug 2021-06-14 11:31:55 +02:00
aarshkshah1992
3d086dfb43 changes as per review 2021-06-14 09:40:34 +05:30
Anton Evangelatov
9f3ec82cc1 initial resolution of conflicts 2021-06-08 13:01:22 +02:00
aarshkshah1992
670835fca0 bypass task scheduler for reading unsealed pieces 2021-06-07 15:02:04 +05:30
Anton Evangelatov
7f234809fc make linter happy 2021-06-04 15:44:13 +02:00
Anton Evangelatov
88756f3ebf fix TestAPIDeal tests 2021-06-04 15:41:38 +02:00
aarshkshah1992
dc6dbc9a11 dpr changes and test based on new unsealing PR 2021-05-22 22:40:21 +05:30
aarshkshah1992
2a40c802ea bypass task scheduler for reading unsealed pieces 2021-05-20 15:25:46 -06:00
Anton Evangelatov
cb603c62d9 update retrievaladapter ; add piece_provider 2021-05-20 12:49:53 +02:00
Dirk McCormick
61344644a4 feat: add more debug logging for unsealing 2021-04-22 11:33:28 +02:00
Łukasz Magiera
81bd27911f Propagate StateMsg api changes 2021-04-05 19:56:53 +02:00
Łukasz Magiera
deb2b90b6a Fix lotus/miner build 2021-04-05 13:23:46 +02:00
dirkmc
14ede9b0e6
Fix unseal comment 2021-03-22 14:39:03 +01:00
Dirk McCormick
73d5225f3c fix: better logging when unsealing fails 2021-03-22 10:23:58 +01:00
Steven Allen
931979809f get lotus building 2020-11-16 19:03:30 +01:00
Steven Allen
233d8a9b72 update even more imports 2020-09-28 14:25:58 -07:00
hannahhoward
48e47ddc23 fix(paych): fix paych status command line 2020-09-14 18:42:10 -07:00
hannahhoward
5ad8e23eae feat(markets): use new api 2020-09-07 15:48:42 -04:00
hannahhoward
2db4b57013 feat(markets): upgrade markets 0.6.0 2020-09-07 15:48:42 -04:00
Aayush Rajasekaran
39755a294a Update to specs v0.9.6 2020-09-07 15:48:41 -04:00
Dirk McCormick
2c98bf0cc7 feat: PaychAvailableFunds API method 2020-09-02 14:31:32 +02:00
Raúl Kripalani
862bafc63a fix lint errors. 2020-08-17 14:39:33 +01:00
Raúl Kripalani
efdc428d5d keep storage-fsm (renamed to storage-sealing) and sector-storage in extern. 2020-08-17 14:26:18 +01:00
Raúl Kripalani
3c17cd655e integrate extern/sector-storage into lotus proper. 2020-08-16 11:09:58 +01:00
hannahhoward
78aa615b4d fix(markets): fix unsealing bug
when commD hasn't been set, just pass cid.Undef
2020-08-06 13:22:45 -07:00
hannahhoward
b048fcd7c1 feat(markets): update for new paych logic
Update adapter to use wait methods provided by paych adapter
2020-08-06 12:07:13 -04:00
hannahhoward
a89c290f62 feat(markets): update to 0.5.4 2020-08-05 15:35:59 -07:00
Aayush Rajasekaran
9d987280c9 remove unused imports 2020-07-31 01:51:40 -04:00
whyrusleeping
146e59fe56 wire through new retrieval apis 2020-07-31 01:47:37 -04:00
Łukasz Magiera
4d328cad54 Get things to mostly work 2020-07-30 14:31:50 +02:00
Łukasz Magiera
f9f0d86ddf
Merge pull request #1913 from acruikshank/feat/1853-confirmations-in-StateWaitMsg2
Add confidence and timeout to message wait
2020-06-04 23:23:15 +02:00
acruikshank
da960a9de4 more import rearrangement 2020-06-04 09:54:37 -04:00
acruikshank
04f0130530 remove timeout 2020-06-03 17:42:06 -04:00
acruikshank
5574e4f11b add confidence and timeout to message wait 2020-06-03 15:38:37 -04:00
Łukasz Magiera
e5c24ff32b Update sector-storage with ReadPiece impl 2020-05-29 19:53:35 +02:00
shannonwells
28c5697578 separate lock/unlock and do independent waiting per PR comments 2020-04-21 16:19:40 -07:00
shannonwells
a9c98eab8d call paychmgr wait funcs, make sure tests are passing 2020-04-21 16:19:40 -07:00
shannonwells
fd7f4ef080 begin implementing funcs to support latest go-fil-markest retrieval market API 2020-04-21 16:19:40 -07:00
Łukasz Magiera
afdfc8807d api: Single method for static miner info 2020-04-16 19:36:36 +02:00