Commit Graph

59 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
Aayush Rajasekaran
39755a294a Update to specs v0.9.6 2020-09-07 15:48:41 -04: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
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
e5c24ff32b Update sector-storage with ReadPiece impl 2020-05-29 19:53:35 +02:00
Łukasz Magiera
afdfc8807d api: Single method for static miner info 2020-04-16 19:36:36 +02:00
laser
650a31b050 remove all lotus types from sealing package in preparation for extraction
events adapter

implement StateWaitMsg and StateComputeDataCommitment

implement StateGetSectorPreCommitOnChainInfo

implement ChainHead and SendMsg

implement remaining methods
2020-04-06 12:57:55 -07:00
Łukasz Magiera
95ee1c1cde Extract sector-storage 2020-03-28 01:32:39 +01:00
Łukasz Magiera
e050e0307e Cleanup after dropping sectorbuilder 2020-03-26 20:35:16 +01:00
Łukasz Magiera
4be54a976c Merge sectorbuilder into sectorstorage 2020-03-26 03:51:06 +01:00
Łukasz Magiera
5e4a7e54df Rename agvmgr+sealmgr to sectorstorage 2020-03-23 12:47:10 +01:00
Łukasz Magiera
d43f2a2e3b workers: Address review 2020-03-22 22:39:06 +01:00
Łukasz Magiera
1ed7779701 Merge remote-tracking branch 'origin/testnet/3' into feat/new-workers 2020-03-19 03:28:55 +01:00
laser
6622576cf8 update retrieval provider node adapter to new API 2020-03-18 10:53:06 -07:00
Łukasz Magiera
5f2caffb51 Fix tests after specs-storage changes 2020-03-18 02:08:11 +01:00
Łukasz Magiera
d8ce5078d9 Use new specs-storage interface 2020-03-17 21:19:52 +01:00
Łukasz Magiera
4e46d00eb6 Merge remote-tracking branch 'origin/testnet/3' into feat/4stage-seal 2020-03-04 04:01:13 +01:00
Łukasz Magiera
a0dbb6bdd6 Storage Manager refactor 2020-03-03 23:19:22 +01:00
hannahhoward
bda5315866 fix(paychmr): decode address correctly, pass wallet 2020-02-28 19:26:33 -08:00