Commit Graph

85 Commits

Author SHA1 Message Date
hannahhoward
cddf63efe9 feat(storageminer): add api for transfer diagnostics
Add API + CLI for inspecting in depth diagnostics on graphsync transfers with a given peer
2021-12-22 13:41:29 -08: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
vyzo
ebbaf23af8 support out-of-chain reference protection 2021-07-20 09:02:40 +03:00
Łukasz Magiera
837322ea59
Merge pull request #6356 from filecoin-project/nonsense/split-market-miner-processes
Support standalone miner-market process
2021-07-13 17:16:07 +02:00
vyzo
5cca29d1db hook noop blockstore for splitstore in DI 2021-07-04 18:38:28 +03:00
Anton Evangelatov
9e85492b85 fix test 2021-07-02 12:24:07 +02:00
Anton Evangelatov
4f0a96c9c7 resolved conflicts 2021-06-30 13:16:52 +02:00
Anton Evangelatov
9ec7cd7239 enable libp2p options 2021-06-30 12:55:43 +02:00
Łukasz Magiera
c3480dc0e8 Merge remote-tracking branch 'origin/releases' into chore/merge-release 2021-06-24 09:39:11 +02:00
Łukasz Magiera
9521c0b773 Add miner-side MaxDealStartDelay config 2021-06-23 19:45:13 +02:00
aarshkshah1992
16166504f4 merged master 2021-06-08 09:17:40 +05:30
Lion
e4588aed5c Fix the doc errors of the sealing config funcs 2021-06-07 12:35:43 +08:00
aarshkshah1992
dc6dbc9a11 dpr changes and test based on new unsealing PR 2021-05-22 22:40:21 +05:30
Łukasz Magiera
7e4cb9da84 Fix fallback chainstore 2021-04-09 16:11:02 +02:00
vyzo
a586d42c3b make hot store DI injectable in the split store, default to badger. 2021-03-05 14:46:17 +02:00
vyzo
622b4f7d9d hook splitstore into DI 2021-03-05 14:46:17 +02:00
Raúl Kripalani
3795cc2bd2 segregate chain and state blockstores.
This paves the way for better object lifetime management.

Concretely, it makes it possible to:
- have different stores backing chain and state data.
- having the same datastore library, but using different parameters.
- attach different caching layers/policies to each class of data, e.g.
  sizing caches differently.
- specifying different retention policies for chain and state data.

This separation is important because:
- access patterns/frequency of chain and state data are different.
- state is derivable from chain, so one could never expunge the chain
  store, and only retain state objects reachable from the last finality
  in the state store.
2021-02-28 22:49:44 +00:00
Raúl Kripalani
b0cbc932bd consolidate all blockstores in blockstore package. 2021-01-29 20:01:00 +00:00
Aayush Rajasekaran
370817eb60 Allow miners to filter (un)verified deals 2020-12-02 01:32:34 -05:00
Peter Rabbitson
29817b6617 Remove all Chain GC wrappings/types
There is no practical way to do GC against the chainstore given the current
state of affairs: remove all GC-related types for the time being.
2020-11-12 06:49:53 +01:00
Łukasz Magiera
a1e1b03ca4 Optionally allow bitswap for chainstore 2020-11-03 23:44:44 +01:00
Łukasz Magiera
ae7889f830 Config for default max gas fee 2020-10-29 20:50:11 +01:00
Ingar Shu
0b7dc6971d
Rebasing 2020-10-15 09:33:01 -07:00
Jakub Sztandera
64fa6fd9e5 Draw the rest of the owl
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-09-10 17:41:55 -04:00
Raúl Kripalani
b33db9c1ab Merge branch 'master' into blocksync-refactor 2020-09-08 14:22:43 +01:00
Aayush Rajasekaran
39755a294a Update to specs v0.9.6 2020-09-07 15:48:41 -04:00
Raúl Kripalani
878ffafb51 rename other Chain{Exchange=>Bitswap}; fix ChainBlock{s=>S}ervice(). 2020-09-07 20:20:23 +01:00
Łukasz Magiera
baf91f08a1 Unbreak tests 2020-08-18 18:27:18 +02:00
Łukasz Magiera
65ffde9e4b fsm: Config for max WaitDeals sectors 2020-08-18 16:20:31 +02:00
Jakub Sztandera
a45febc065
Fix MpoolLocker
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-08-11 19:32:31 +02:00
hannahhoward
3cac1080cc feat(retrievalstoremgr): add retrievalstoremgr
add manager for retrievals to handle different cases for IPFS/non-ipfs
2020-07-31 14:16:18 -07:00
Łukasz Magiera
fc3c91b738 Support external deal decision logic 2020-07-31 20:29:16 +02:00
Łukasz Magiera
4cb4e7c2c2 Merge remote-tracking branch 'origin/master' into next 2020-07-31 14:02:04 +02:00
vyzo
d8ca29dd52 support extended pubsub peer scores 2020-07-31 11:27:22 +03:00
Łukasz Magiera
09b90773d8 Merge remote-tracking branch 'origin/next' into feat/cid-builder 2020-07-28 16:06:06 +02:00
hannahhoward
5a623cccb5 feat(markets): update markets mulitple deal stores 2020-07-27 23:13:28 -07:00
hannahhoward
dd885b7302 feat(multistore): extract multistore code to repo
Extract multistore + multiread blockstore to a seperate repo
2020-07-24 14:47:22 -07:00
Steven Allen
b7a4dbb07f Support inline CIDs
And use the new CidBuilder from the spec actors.

This patch does not switch over to inline CIDs by default, but paves the way.
2020-07-23 23:12:32 -07:00
Jakub Sztandera
ff5ff4d294
Add multiple drand configs
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-07-23 18:45:08 +02:00
Aayush Rajasekaran
a5ef629cef Add expected seal duration to custom deal logic, reject deals that start too early 2020-07-15 17:31:50 -04:00
Frank
14ec9a2068 update storage miner and seal worker document 2020-07-11 16:55:13 +08:00
Łukasz Magiera
66237415c5 Merge remote-tracking branch 'origin/next' into feat/client-multi-bstore 2020-07-08 22:48:47 +02:00
Aayush Rajasekaran
411c82ae8f Update storage-FSM, add API to set sector seal delay 2020-07-07 15:23:23 -04:00
Łukasz Magiera
47f0898ce9 Wire up client import manager 2020-07-07 10:52:19 +02:00
Łukasz Magiera
8942967223 Client Import manager 2020-07-07 10:52:04 +02:00
laser
b9180a99d4 toggle consideration of offline storage/retrieval deal proposals 2020-06-26 12:27:41 -07:00
laser
e910a045d0 big rename to allow for later introducing the "consider offline" config 2020-06-26 10:50:54 -07:00
laser
4c760ec1b1 lint: update comments to match type declarations 2020-06-24 08:08:10 -07:00
laser
ef0abf2b98 disable/enable retrieval deal consideration via config 2020-06-24 08:07:12 -07:00
Yusef Napora
b448de422e improve DrandConfig dependency injection 2020-06-23 16:01:10 -04:00