Skip to content

Commit

Permalink
Merge pull request #109 from filecoin-project/plan/payments
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk authored Jul 7, 2020
2 parents 5aac474 + f46375a commit 6a45211
Show file tree
Hide file tree
Showing 18 changed files with 554 additions and 76 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SHELL = /bin/bash

.DEFAULT_GOAL := download-proofs

download-proofs:
go run github.com/filecoin-project/go-paramfetch/paramfetch 2048 ./docker-images/proof-parameters.json
.PHONY: download-proofs
49 changes: 49 additions & 0 deletions lotus-soup/compositions/composition-paych-stress.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[metadata]
name = "lotus-soup"
author = "raulk"

[global]
plan = "lotus-soup"
case = "paych-stress"
total_instances = 5 # 2 clients + 2 miners + 1 bootstrapper
builder = "exec:go"
runner = "local:exec"

[global.build_config]
enable_go_build_cache = true

[global.run_config]
exposed_ports = { pprof = "6060", node_rpc = "1234", miner_rpc = "2345" }

[global.build]
selectors = ["testground"]

[global.run.test_params]
clients = "2"
miners = "2"
genesis_timestamp_offset = "0"
balance = "30" ## be careful, this is in FIL.
sectors = "10"
random_beacon_type = "mock"
mining_mode = "natural"
lane_count = "8"
increments = "30" ## in FIL

[[groups]]
id = "bootstrapper"
instances = { count = 1 }
[groups.run.test_params]
role = "bootstrapper"

[[groups]]
id = "miners"
instances = { count = 2 }
[groups.run.test_params]
role = "miner"

[[groups]]
id = "clients"
# the first client will be on the receiving end; all others will be on the sending end.
instances = { count = 2 }
[groups.run.test_params]
role = "client"
9 changes: 5 additions & 4 deletions lotus-soup/compositions/composition.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
plan = "lotus-soup"
case = "deals-e2e"
total_instances = 6
builder = "docker:go"
runner = "local:docker"
builder = "exec:go"
runner = "local:exec"

[global.build_config]
enable_go_build_cache = true
Expand All @@ -21,10 +21,11 @@
[global.run.test_params]
clients = "3"
miners = "2"
genesis_timestamp_offset = "100000"
balance = "2000000000"
genesis_timestamp_offset = "0"
balance = "2000000000" ## be careful, this is in FIL.
sectors = "10"
random_beacon_type = "mock"
mining_mode = "natural"

[[groups]]
id = "bootstrapper"
Expand Down
8 changes: 4 additions & 4 deletions lotus-soup/deals_e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ func dealsE2E(t *testkit.TestEnvironment) error {

// select a random miner
minerAddr := cl.MinerAddrs[rand.Intn(len(cl.MinerAddrs))]
if err := client.NetConnect(ctx, minerAddr.PeerAddr); err != nil {
if err := client.NetConnect(ctx, minerAddr.MinerNetAddrs); err != nil {
return err
}
t.D().Counter(fmt.Sprintf("send-data-to,miner=%s", minerAddr.ActorAddr)).Inc(1)
t.D().Counter(fmt.Sprintf("send-data-to,miner=%s", minerAddr.MinerActorAddr)).Inc(1)

t.RecordMessage("selected %s as the miner", minerAddr.ActorAddr)
t.RecordMessage("selected %s as the miner", minerAddr.MinerActorAddr)

time.Sleep(2 * time.Second)

Expand All @@ -82,7 +82,7 @@ func dealsE2E(t *testkit.TestEnvironment) error {

// start deal
t1 := time.Now()
deal := testkit.StartDeal(ctx, minerAddr.ActorAddr, client, fcid)
deal := testkit.StartDeal(ctx, minerAddr.MinerActorAddr, client, fcid)
t.RecordMessage("started deal: %s", deal)

// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
Expand Down
10 changes: 5 additions & 5 deletions lotus-soup/deals_stress.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ func dealStressTest(t *testkit.TestEnvironment) error {

// select a random miner
minerAddr := cl.MinerAddrs[rand.Intn(len(cl.MinerAddrs))]
if err := client.NetConnect(ctx, minerAddr.PeerAddr); err != nil {
if err := client.NetConnect(ctx, minerAddr.MinerNetAddrs); err != nil {
return err
}

t.RecordMessage("selected %s as the miner", minerAddr.ActorAddr)
t.RecordMessage("selected %s as the miner", minerAddr.MinerActorAddr)

time.Sleep(2 * time.Second)

Expand Down Expand Up @@ -92,12 +92,12 @@ func dealStressTest(t *testkit.TestEnvironment) error {
go func(i int) {
defer wg1.Done()
t1 := time.Now()
deal := testkit.StartDeal(ctx, minerAddr.ActorAddr, client, cids[i])
deal := testkit.StartDeal(ctx, minerAddr.MinerActorAddr, client, cids[i])
t.RecordMessage("started storage deal %d -> %s", i, deal)
time.Sleep(2 * time.Second)
t.RecordMessage("waiting for deal %d to be sealed", i)
testkit.WaitDealSealed(t, ctx, client, deal)
t.D().ResettingHistogram(fmt.Sprintf("deal.sealed,miner=%s", minerAddr.ActorAddr)).Update(int64(time.Since(t1)))
t.D().ResettingHistogram(fmt.Sprintf("deal.sealed,miner=%s", minerAddr.MinerActorAddr)).Update(int64(time.Since(t1)))
}(i)
}
t.RecordMessage("waiting for all deals to be sealed")
Expand All @@ -123,7 +123,7 @@ func dealStressTest(t *testkit.TestEnvironment) error {
} else {

for i := 0; i < deals; i++ {
deal := testkit.StartDeal(ctx, minerAddr.ActorAddr, client, cids[i])
deal := testkit.StartDeal(ctx, minerAddr.MinerActorAddr, client, cids[i])
t.RecordMessage("started storage deal %d -> %s", i, deal)
time.Sleep(2 * time.Second)
t.RecordMessage("waiting for deal %d to be sealed", i)
Expand Down
1 change: 1 addition & 0 deletions lotus-soup/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/filecoin-project/oni/lotus-soup
go 1.14

require (
contrib.go.opencensus.io/exporter/prometheus v0.1.0
github.com/davecgh/go-spew v1.1.1
github.com/drand/drand v0.9.2-0.20200616080806-a94e9c1636a4
github.com/filecoin-project/go-address v0.0.2-0.20200504173055-8b6f2fb2b3ef
Expand Down
Loading

0 comments on commit 6a45211

Please sign in to comment.