lotus/testplans
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
..
composer bump docker golang version to 1.15:buster 2020-11-23 20:00:20 +01:00
dashboards merge filecoin-project/oni subtree in testplans/ 2020-11-06 21:02:06 +01:00
docker-images testplans: lotus-soup: new images with filecoin-ffi ; use default WPoStChallengeWindow 2021-06-07 11:28:24 +02:00
graphsync add .sec scale to measurements; humanize for metric tags 2020-11-24 17:52:37 +01:00
lotus-soup integrate DAG store and CARv2 in deal-making (#6671) 2021-08-16 23:34:32 +01:00
notes merge filecoin-project/oni subtree in testplans/ 2020-11-06 21:02:06 +01:00
DELVING.md merge filecoin-project/oni subtree in testplans/ 2020-11-06 21:02:06 +01:00
Makefile testplans: lotus-soup: new images with filecoin-ffi ; use default WPoStChallengeWindow 2021-06-07 11:28:24 +02:00
README-old-from-oni.md update Dockerfiles; integrate lotus-soup and graphsync in Lotus CI; update go.mod and references 2020-11-06 21:04:11 +01:00
README.md update Dockerfiles; integrate lotus-soup and graphsync in Lotus CI; update go.mod and references 2020-11-06 21:04:11 +01:00

Testground testplans for Lotus

This directory consists of testplans built to be run on Testground that exercise Lotus on TaaS.

Table of Contents

Testing topics

  • storage and retrieval deals:
    • end-to-end flows where clients store and retrieve pieces from miners, including stress testing the system.
  • payment channels:
    • stress testing payment channels via excessive lane creation, excessive payment voucher atomisation, and redemption.

Running the test cases

If you are unfamiliar with Testground, we strongly suggest you read the Testground Getting Started guide in order to learn how to install Testground and how to use it.

You can find various composition files describing various test scenarios built as part of Project Oni at lotus-soup/_compositions directory.

We've designed the test cases so that you can run them via the local:exec, local:docker and the cluster:k8s runners. Note that Lotus miners are quite resource intensive, requiring gigabytes of memory. Hence you would have to run these test cases on a beafy machine (when using local:docker and local:exec), or on a Kubernetes cluster (when using cluster:k8s).

Here are the basics of how to run the baseline deals end-to-end test case:

Running the baseline deals end-to-end test case

  1. Compile and Install Testground from source code.

  2. Run a Testground daemon

testground daemon
  1. Download required Docker images for the lotus-soup test plan
make pull-images

Alternatively you can build them locally with

make build-images
  1. Import the lotus-soup test plan into your Testground home directory
testground plan import --from ./lotus-soup
  1. Run a composition for the baseline deals end-to-end test case
testground run composition -f ./lotus-soup/_compositions/baseline-docker-5-1.toml