Commit Graph

150 Commits

Author SHA1 Message Date
Łukasz Magiera
30fccaa0bd fix lint 2021-09-02 18:45:18 +02:00
Łukasz Magiera
95b128b7bc chain: Cleanup consensus logic 2021-09-02 18:09:37 +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
Łukasz Magiera
9bd312881d VMSys doesn't belong in chainstore 2021-07-27 15:30:23 +02:00
frrist
0519c77c24 polish(stmgr): define ExecMonitor for message applicaiton callback 2021-06-07 11:03:18 -07: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
21b4741e30 Fix randomness fetching around null blocks 2021-05-26 21:06:06 -04:00
Łukasz Magiera
cf96ad4fdb fix lint 2021-04-06 14:30:49 +02:00
Łukasz Magiera
eee50caaf1 Fix buildall 2021-04-05 20:12:47 +02:00
Raúl Kripalani
7f0f7d0b36 Merge branch 'master' into refactor/lib/blockstore 2021-02-28 19:55:23 +00:00
Łukasz Magiera
26399dba70 Update markets, cbor-gen with soft map decoding 2021-02-19 20:11:43 +01:00
Raúl Kripalani
b0cbc932bd consolidate all blockstores in blockstore package. 2021-01-29 20:01:00 +00:00
Raúl Kripalani
cd032d5418 tvx extract: more tipset extraction goodness.
- ability to extract a tipset range into individual vectors.
- ability to extract a tipset range and squash into a single multi-tipset vector.
- mark statediff output deterministically, so it can be extracted by tooling.
- ability to execute callbacks between tipsets in the driver.
- implement save-balances callback.
2020-12-27 18:58:35 +00:00
Raúl Kripalani
2af1283c65 tvx exec: flag to fallback to API blockstore. 2020-12-15 17:44:56 +00:00
Raúl Kripalani
446b1cc883 tvx command to extract tipset vectors. 2020-12-15 16:56:01 +00:00
Aayush Rajasekaran
68a16afeda Merge branch 'master' into release/v1.2.0 2020-11-17 19:40:05 -05:00
Aayush Rajasekaran
4982de89b2 Fix chaos 2020-11-17 19:18:57 -05:00
Raúl Kripalani
0c6072a1a0 chainstore lifecycle: close via Close() instead of context. 2020-11-16 22:28:59 +00:00
Raúl Kripalani
d7b4f92f1f add context to ChainStore. 2020-11-16 15:52:19 +00:00
Łukasz Magiera
a1e1b03ca4 Optionally allow bitswap for chainstore 2020-11-03 23:44:44 +01:00
Łukasz Magiera
29cda82eac
Merge pull request #4449 from austinabell/austin/confcircsupplyfix
Fix circ supply default in conformance
2020-10-22 18:53:10 +02: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
austinabell
70e2170e3e
Fix circ supply default in conformance 2020-10-16 21:14:36 -04:00
Raúl Kripalani
45cd510da1 conformance: support multiple protocol versions.
This PR introduces support for running multiple variants of a vector,
each of which targets a unique protocol version.

tvx tooling has been adapted to produce and parse the new version
of the schema.
2020-10-14 14:39:43 +01:00
Steven Allen
748d2e82a7 unshare the journal
Motivation:

* Run lotus with the race detector enabled (primary motivation).
* Allow multiple lotus nodes in a process (not a high priority).

Previously, the journal was shared between all lotus instances, but it was
initialized for every new node. This caused safety problems in tests (at a
minimum).

This patch explicitly passes the journal to all services that need it.
2020-10-09 13:23:07 -07:00
Raúl Kripalani
98d702fb5a add signature imports. 2020-10-08 16:44:20 +01:00
Raúl Kripalani
3201e0eb8f Merge branch 'master' into conformance/rm-faked-syscalls 2020-10-08 15:17:26 +01:00
Raúl Kripalani
8d2d74438b
Merge pull request #4221 from filecoin-project/conformance/randomness 2020-10-08 15:16:32 +01:00
Raúl Kripalani
4937ca1a96 conformance: remove usage of fake syscalls. 2020-10-08 14:55:03 +01:00
Raúl Kripalani
c02daca9e9 work around #4223. 2020-10-07 20:12:35 +01:00
Raúl Kripalani
5bd6a3cdad conformance: record randomness in tvx; replay in driver. 2020-10-07 19:57:42 +01:00
Steven Allen
df4b068d0e Merge branch 'master' into next 2020-10-07 11:55:00 -07:00
Raúl Kripalani
d3dc560f53 conformance: minor refactors. 2020-10-07 13:01:08 +01:00
Steven Allen
16243b97aa make state diffing work with partial state trees 2020-10-05 17:03:28 -07:00
Steven Allen
89b88c1e0d fix conformance tests 2020-10-05 17:03:28 -07:00
Steven Allen
4989b1cc90 Merge branch 'master' into asr/spec-v1 2020-09-30 09:19:12 -07:00
Raúl Kripalani
eb6191d0ff tvx: precursor selection modes; canonical message fetching; basefee. 2020-09-30 11:02:10 +01:00
Raúl Kripalani
4b3b35c9de conformance: record and feed circulating supply. 2020-09-28 23:04:52 +01:00
Steven Allen
5f3160cf5b continue expanding vm abstraction layer 2020-09-28 12:48:08 -07:00
Raúl Kripalani
a0dffb44d3 tvx/extract: perform sanity check on receipt. 2020-09-28 13:11:34 +01:00
Raúl Kripalani
fe869c9c22 address review comments; lint. 2020-09-27 21:06:07 +01:00
Raúl Kripalani
f5f23f7291 driver: option for VM flushing. 2020-09-27 20:55:09 +01:00
Raúl Kripalani
e5c56da321 move conformance tvx tool to lotus. 2020-09-27 20:10:05 +01:00
Steven Allen
8b35f480c4 initial vm conversion
We're probably going to want to change some of these design decisions down the
road, but this is a good starting point.

* We may want to use a more general test for "is actor valid at epoch". Maybe
just a function?
* I'd like to push some of the actor metadata down into the actor types
themselves. Ideally, we'd be able to register actors with a simple
`Register(validation, manyActors...)` call.
2020-09-25 12:49:39 -07:00
Raúl Kripalani
87b48c94a6 conformance: supply network version to driver. 2020-09-24 17:58:34 +01:00
Łukasz Magiera
f7934b083c Merge remote-tracking branch 'origin/master' into refactor/net-upgrade 2020-09-21 19:10:18 +02: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
Łukasz Magiera
70faa36b7f Merge remote-tracking branch 'origin/master' into refactor/net-upgrade 2020-09-18 19:29:06 +02:00
Łukasz Magiera
6eda53565f Most tests passing 2020-09-17 17:30:24 +02: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
2a3743ff84 invoke the statediff command properly. 2020-09-09 14:08:54 +01:00
Raúl Kripalani
a5afd83c7b Merge branch 'master' into fix/test-vectors-import-cycle 2020-09-09 13:04:41 +01:00
Raúl Kripalani
e8d1bab914 make the runner call statediff as a binary. 2020-09-09 13:03:43 +01:00
Raúl Kripalani
63cdbef219 temp fix test-vectors import cycle. 2020-09-08 21:50:25 +01:00
whyrusleeping
8a8f0ab3ec pass tipset through upgrade logic 2020-09-08 13:45:44 -07:00
Aayush Rajasekaran
d678fe4bfa Fix tests 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
Alan Shaw
ada5e6ae68 refactor: remove puppet actor from conformance tests
The puppet actor has been subsumed into the chaos actor and test-vector tests no longer use it.
2020-09-03 23:19:53 +01:00
Raúl Kripalani
8e7a8d8c97 conformance: tipset-class driver: allow actor msgs, dummy-sign secp msgs. 2020-09-03 22:54:19 +01:00
Raúl Kripalani
0962292f92 conformance: add driver for tipset-class vectors. 2020-09-02 14:09:12 +01:00
Łukasz Magiera
fa6bae988e
Revert "conformance: add driver for tipset-class vectors." 2020-09-02 14:49:55 +02:00
Raúl Kripalani
ec5903ca19 fix lint error. 2020-09-02 12:28:55 +01:00
Raúl Kripalani
ad5793e446 update test-vectors commit. 2020-09-01 20:01:41 +01:00
Raúl Kripalani
3321f36b51 update test-vectors commit. 2020-09-01 16:35:26 +01:00
Raúl Kripalani
64bdd620ac conformance: add driver for tipset-class vectors. 2020-09-01 15:35:19 +01:00
austinabell
679a8e0c24
Add in return value check in test-vector runner 2020-08-27 11:42:01 -04:00
Raúl Kripalani
75e0387be2 fix ffiwrapper import. 2020-08-26 21:49:55 +01:00
Raúl Kripalani
4709e231b8 drop aurora as dep; upgrade test-vectors. 2020-08-26 18:35:41 +01:00
Raúl Kripalani
dabe14889d
actually apply all messages. 2020-08-26 16:48:47 +01:00
Raúl Kripalani
cba5ae81ed call out to filecoin-project/statediff upon state mismatches. 2020-08-26 15:09:33 +01:00
Alan Shaw
a89faa72ea
feat(conformance): skip incorrect tests (#3310)
Fixes https://github.com/filecoin-project/test-vectors/issues/72
2020-08-26 11:45:34 +01:00
Raúl Kripalani
6ed1c9e905 register the puppet actor conditionally. 2020-08-21 11:51:50 +01:00
Raúl Kripalani
04e4bab313 register chaos actor only if selector says to do so. 2020-08-19 18:10:56 +01:00
Raúl Kripalani
dddf7951ef update test-vectors commit. 2020-08-19 17:33:30 +01:00
Raúl Kripalani
a21234cd54 deploy the chaos actor. 2020-08-19 14:31:34 +01:00
Raúl Kripalani
f1c452754f separate conformance suite on CI. 2020-08-16 22:50:00 +01:00
Raúl Kripalani
b9d67296ef small adjustments to runner. 2020-08-16 22:15:12 +01:00
Raúl Kripalani
a0c0d9c98a small fixes. 2020-08-16 00:37:16 +01:00
Raúl Kripalani
322b33197c introduce interoperable vector-based conformance testing.
This commit introduces a new package `conformance` containing:

 1. the test driver to exercise Lotus against interoperable
    test vectors, and
 2. the test runner, which integrates go test with the test vector
    corpus hosted at https://github.com/filecoin-project/conformance-vectors.

The corpus is mounted via a git submodule.

Right now, only message-class test vectors are supported. In the
next week, this support will be extended to tipset-class, chain-class,
and block sequence-class vectors.
2020-08-16 00:15:52 +01:00