From 909c12c6b4a4d827b716d21cd515c85b6e48df90 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 29 Jun 2020 17:06:04 +0200 Subject: [PATCH 01/10] sync miners --- lotus-soup/common_roles.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lotus-soup/common_roles.go b/lotus-soup/common_roles.go index 9d5c1d1b7..971203254 100644 --- a/lotus-soup/common_roles.go +++ b/lotus-soup/common_roles.go @@ -3,8 +3,6 @@ package main import ( "context" "fmt" - "math/rand" - "time" "github.com/filecoin-project/lotus/build" "github.com/testground/sdk-go/sync" @@ -54,15 +52,15 @@ func runMiner(t *TestEnvironment) error { stateMineNext := sync.State(fmt.Sprintf("mine-block-%d", i)) t.SyncClient.MustSignalAndWait(ctx, stateMineNext, miners) - // add some random delay to encourage a different miner winning each round - time.Sleep(time.Duration(100 + rand.Intn(int(100*time.Millisecond)))) - + ch := make(chan struct{}) err := miner.MineOne(ctx, func(mined bool) { t.D().Counter(fmt.Sprintf("block.mine,miner=%s", myActorAddr)).Inc(1) + close(ch) }) if err != nil { panic(err) } + <-ch } // signal the last block to make sure no miners are left stuck waiting for the next block signal From 0ec247de8c8dc7f31e6ee12d3a9367ba3949059a Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 29 Jun 2020 17:21:50 +0200 Subject: [PATCH 02/10] fix broken counter --- lotus-soup/common_roles.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lotus-soup/common_roles.go b/lotus-soup/common_roles.go index 971203254..6bb0b9855 100644 --- a/lotus-soup/common_roles.go +++ b/lotus-soup/common_roles.go @@ -54,7 +54,9 @@ func runMiner(t *TestEnvironment) error { ch := make(chan struct{}) err := miner.MineOne(ctx, func(mined bool) { - t.D().Counter(fmt.Sprintf("block.mine,miner=%s", myActorAddr)).Inc(1) + if mined { + t.D().Counter(fmt.Sprintf("block.mine,miner=%s", myActorAddr)).Inc(1) + } close(ch) }) if err != nil { From 50b9a7f212fb3ce1b580f1b18bb9e91ff5d5e351 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 29 Jun 2020 18:38:28 +0200 Subject: [PATCH 03/10] get seq num based on role, not based on group --- .../project-oni-baseline-dashboard.json | 194 ++++++++++++++++-- lotus-soup/node.go | 14 +- 2 files changed, 191 insertions(+), 17 deletions(-) diff --git a/dashboards/project-oni-baseline-dashboard.json b/dashboards/project-oni-baseline-dashboard.json index 2db88c585..ff031bcf3 100644 --- a/dashboards/project-oni-baseline-dashboard.json +++ b/dashboards/project-oni-baseline-dashboard.json @@ -15,8 +15,8 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "id": 16, - "iteration": 1593204217741, + "id": 15, + "iteration": 1593447404131, "links": [], "panels": [ { @@ -111,7 +111,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] } ], "timeFrom": null, @@ -216,7 +222,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] }, { "alias": "all ($tag_run)", @@ -259,7 +271,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] } ], "thresholds": [], @@ -406,7 +424,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] } ], "thresholds": [], @@ -547,7 +571,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] }, { "alias": "find-data.offer - $tag_miner ($tag_run)", @@ -596,7 +626,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] } ], "thresholds": [], @@ -743,7 +779,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] } ], "thresholds": [], @@ -876,7 +918,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "run", + "operator": "=~", + "value": "/^$runid$/" + } + ] } ], "thresholds": [], @@ -956,11 +1004,133 @@ "refresh": 2, "skipUrlSync": false, "type": "interval" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, + "datasource": "influxdb", + "definition": "SHOW TAG VALUES WITH KEY = run", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "runid", + "options": [ + { + "selected": true, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "117f08933310", + "value": "117f08933310" + }, + { + "selected": false, + "text": "17a227f7b637", + "value": "17a227f7b637" + }, + { + "selected": false, + "text": "38d83e95c2b2", + "value": "38d83e95c2b2" + }, + { + "selected": false, + "text": "4df9a41381ca", + "value": "4df9a41381ca" + }, + { + "selected": false, + "text": "55bf4f1e53e0", + "value": "55bf4f1e53e0" + }, + { + "selected": false, + "text": "5fc360f56297", + "value": "5fc360f56297" + }, + { + "selected": false, + "text": "61c25df6a523", + "value": "61c25df6a523" + }, + { + "selected": false, + "text": "81bdea781a27", + "value": "81bdea781a27" + }, + { + "selected": false, + "text": "8bda77016642", + "value": "8bda77016642" + }, + { + "selected": false, + "text": "8e5bdd96afd1", + "value": "8e5bdd96afd1" + }, + { + "selected": false, + "text": "9047c7cc419a", + "value": "9047c7cc419a" + }, + { + "selected": false, + "text": "b29b34b67c9f", + "value": "b29b34b67c9f" + }, + { + "selected": false, + "text": "b81f58a9362d", + "value": "b81f58a9362d" + }, + { + "selected": false, + "text": "c05206ad1ca7", + "value": "c05206ad1ca7" + }, + { + "selected": false, + "text": "c99cadb9e63b", + "value": "c99cadb9e63b" + }, + { + "selected": false, + "text": "dbc87837bf29", + "value": "dbc87837bf29" + }, + { + "selected": false, + "text": "ddf546e35bdd", + "value": "ddf546e35bdd" + }, + { + "selected": false, + "text": "e7c3c5a7806d", + "value": "e7c3c5a7806d" + } + ], + "query": "SHOW TAG VALUES WITH KEY = run", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false } ] }, "time": { - "from": "now-8m", + "from": "now-15m", "to": "now" }, "timepicker": { @@ -979,5 +1149,5 @@ "timezone": "", "title": "Project Oni - Baseline test", "uid": "8em8RXWMz", - "version": 8 + "version": 2 } diff --git a/lotus-soup/node.go b/lotus-soup/node.go index 0375d545b..34d55fea0 100644 --- a/lotus-soup/node.go +++ b/lotus-soup/node.go @@ -75,9 +75,10 @@ var ( clientsAddrsTopic = sync.NewTopic("clientsAddrsTopic", &peer.AddrInfo{}) minersAddrsTopic = sync.NewTopic("minersAddrsTopic", &MinerAddresses{}) - stateReady = sync.State("ready") - stateDone = sync.State("done") - stateStopMining = sync.State("stop-mining") + stateReady = sync.State("ready") + stateDone = sync.State("done") + stateStopMining = sync.State("stop-mining") + stateMinerPickSeqNum = sync.State("miner-pick-seq-num") ) type TestEnvironment struct { @@ -289,7 +290,10 @@ func prepareMiner(t *TestEnvironment) (*Node, error) { return nil, err } - minerAddr, err := address.NewIDAddress(genesis_chain.MinerStart + uint64(t.GroupSeq-1)) + // pick unique sequence number for each miner, no matter in which group they are + seq := t.SyncClient.MustSignalAndWait(ctx, stateMinerPickSeqNum, t.IntParam("miners")) + + minerAddr, err := address.NewIDAddress(genesis_chain.MinerStart + uint64(seq-1)) if err != nil { return nil, err } @@ -308,7 +312,7 @@ func prepareMiner(t *TestEnvironment) (*Node, error) { t.RecordMessage("Miner Info: Owner: %s Worker: %s", genMiner.Owner, genMiner.Worker) - presealMsg := &PresealMsg{Miner: *genMiner, Seqno: t.GroupSeq} + presealMsg := &PresealMsg{Miner: *genMiner, Seqno: seq} t.SyncClient.Publish(ctx, presealTopic, presealMsg) // then collect the genesis block and bootstrapper address From 22ac7debb9360f1400afbc77383c977e4e845029 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 29 Jun 2020 18:42:05 +0200 Subject: [PATCH 04/10] fixup --- .../project-oni-baseline-dashboard.json | 106 +----------------- 1 file changed, 5 insertions(+), 101 deletions(-) diff --git a/dashboards/project-oni-baseline-dashboard.json b/dashboards/project-oni-baseline-dashboard.json index ff031bcf3..4a7e72049 100644 --- a/dashboards/project-oni-baseline-dashboard.json +++ b/dashboards/project-oni-baseline-dashboard.json @@ -15,8 +15,8 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "id": 15, - "iteration": 1593447404131, + "id": 16, + "iteration": 1593448862489, "links": [], "panels": [ { @@ -1019,105 +1019,9 @@ "label": null, "multi": false, "name": "runid", - "options": [ - { - "selected": true, - "text": "All", - "value": "$__all" - }, - { - "selected": false, - "text": "117f08933310", - "value": "117f08933310" - }, - { - "selected": false, - "text": "17a227f7b637", - "value": "17a227f7b637" - }, - { - "selected": false, - "text": "38d83e95c2b2", - "value": "38d83e95c2b2" - }, - { - "selected": false, - "text": "4df9a41381ca", - "value": "4df9a41381ca" - }, - { - "selected": false, - "text": "55bf4f1e53e0", - "value": "55bf4f1e53e0" - }, - { - "selected": false, - "text": "5fc360f56297", - "value": "5fc360f56297" - }, - { - "selected": false, - "text": "61c25df6a523", - "value": "61c25df6a523" - }, - { - "selected": false, - "text": "81bdea781a27", - "value": "81bdea781a27" - }, - { - "selected": false, - "text": "8bda77016642", - "value": "8bda77016642" - }, - { - "selected": false, - "text": "8e5bdd96afd1", - "value": "8e5bdd96afd1" - }, - { - "selected": false, - "text": "9047c7cc419a", - "value": "9047c7cc419a" - }, - { - "selected": false, - "text": "b29b34b67c9f", - "value": "b29b34b67c9f" - }, - { - "selected": false, - "text": "b81f58a9362d", - "value": "b81f58a9362d" - }, - { - "selected": false, - "text": "c05206ad1ca7", - "value": "c05206ad1ca7" - }, - { - "selected": false, - "text": "c99cadb9e63b", - "value": "c99cadb9e63b" - }, - { - "selected": false, - "text": "dbc87837bf29", - "value": "dbc87837bf29" - }, - { - "selected": false, - "text": "ddf546e35bdd", - "value": "ddf546e35bdd" - }, - { - "selected": false, - "text": "e7c3c5a7806d", - "value": "e7c3c5a7806d" - } - ], + "options": [], "query": "SHOW TAG VALUES WITH KEY = run", - "refresh": 0, + "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, @@ -1149,5 +1053,5 @@ "timezone": "", "title": "Project Oni - Baseline test", "uid": "8em8RXWMz", - "version": 2 + "version": 1 } From b47641f1c2abc7e4964f1f9a2d11cf42d6d22934 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 29 Jun 2020 18:48:10 +0200 Subject: [PATCH 05/10] introduce 2 groups of miners --- .../compositions/composition-k8s-10-3.toml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lotus-soup/compositions/composition-k8s-10-3.toml b/lotus-soup/compositions/composition-k8s-10-3.toml index 7110e8114..bc4a44220 100644 --- a/lotus-soup/compositions/composition-k8s-10-3.toml +++ b/lotus-soup/compositions/composition-k8s-10-3.toml @@ -20,7 +20,6 @@ miners = "3" genesis_timestamp_offset = "100000" balance = "2000" - sectors = "10" [[groups]] id = "bootstrapper" @@ -35,16 +34,30 @@ role = "bootstrapper" [[groups]] - id = "miners" + id = "miners-weak" [groups.resources] memory = "8192Mi" cpu = "1000m" [groups.instances] - count = 3 + count = 2 percentage = 0.0 [groups.run] [groups.run.test_params] role = "miner" + sectors = "8" + +[[groups]] + id = "miners-strong" + [groups.resources] + memory = "8192Mi" + cpu = "1000m" + [groups.instances] + count = 1 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + sectors = "24" [[groups]] id = "clients" From 05e5c42f33c025e760b279a9b5e8a1d2c6f6f897 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 29 Jun 2020 19:00:18 +0200 Subject: [PATCH 06/10] fix compositions --- .../compositions/composition-tracer.toml | 28 ++++++------------- lotus-soup/compositions/composition.toml | 25 ++++++----------- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/lotus-soup/compositions/composition-tracer.toml b/lotus-soup/compositions/composition-tracer.toml index ec3e5dc5e..d632d287e 100644 --- a/lotus-soup/compositions/composition-tracer.toml +++ b/lotus-soup/compositions/composition-tracer.toml @@ -12,6 +12,15 @@ [global.build_config] enable_go_build_cache = true +[global.run.test_params] + clients = "3" + miners = "2" + genesis_timestamp_offset = "100000" + balance = "2000000000" + sectors = "10" + random_beacon_type = "mock" + enable_pubsub_tracer = "true" + [[groups]] id = "pubsub-tracer" [groups.instances] @@ -29,12 +38,6 @@ [groups.run] [groups.run.test_params] role = "bootstrapper" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" - enable_pubsub_tracer = "true" [[groups]] id = "miners" @@ -44,13 +47,6 @@ [groups.run] [groups.run.test_params] role = "miner" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" - enable_pubsub_tracer = "true" - [[groups]] id = "clients" @@ -60,9 +56,3 @@ [groups.run] [groups.run.test_params] role = "client" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" - enable_pubsub_tracer = "true" diff --git a/lotus-soup/compositions/composition.toml b/lotus-soup/compositions/composition.toml index 05dc7b688..1b24f3b94 100644 --- a/lotus-soup/compositions/composition.toml +++ b/lotus-soup/compositions/composition.toml @@ -12,6 +12,14 @@ [global.build_config] enable_go_build_cache = true +[global.run.test_params] + clients = "3" + miners = "2" + genesis_timestamp_offset = "100000" + balance = "2000000000" + sectors = "10" + random_beacon_type = "mock" + [[groups]] id = "bootstrapper" [groups.instances] @@ -20,11 +28,6 @@ [groups.run] [groups.run.test_params] role = "bootstrapper" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" [[groups]] id = "miners" @@ -34,12 +37,6 @@ [groups.run] [groups.run.test_params] role = "miner" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" - [[groups]] id = "clients" @@ -49,9 +46,3 @@ [groups.run] [groups.run.test_params] role = "client" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" - From da85855a6bd695dd33bee15ad51e46090b258b03 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 29 Jun 2020 19:32:43 +0300 Subject: [PATCH 07/10] option to turn on natural time mining --- lotus-soup/common_roles.go | 51 +++++++++++++++++++++----------------- lotus-soup/manifest.toml | 3 +++ lotus-soup/node.go | 31 +++++++++++++---------- 3 files changed, 49 insertions(+), 36 deletions(-) diff --git a/lotus-soup/common_roles.go b/lotus-soup/common_roles.go index 6bb0b9855..6c6d7de2c 100644 --- a/lotus-soup/common_roles.go +++ b/lotus-soup/common_roles.go @@ -43,33 +43,38 @@ func runMiner(t *TestEnvironment) error { // mine / stop mining mine := true done := make(chan struct{}) - go func() { - defer close(done) - var i int - for i = 0; mine; i++ { - // synchronize all miners to mine the next block - t.RecordMessage("synchronizing all miners to mine next block [%d]", i) - stateMineNext := sync.State(fmt.Sprintf("mine-block-%d", i)) - t.SyncClient.MustSignalAndWait(ctx, stateMineNext, miners) - ch := make(chan struct{}) - err := miner.MineOne(ctx, func(mined bool) { - if mined { - t.D().Counter(fmt.Sprintf("block.mine,miner=%s", myActorAddr)).Inc(1) + if miner.MineOne != nil { + go func() { + defer close(done) + var i int + for i = 0; mine; i++ { + // synchronize all miners to mine the next block + t.RecordMessage("synchronizing all miners to mine next block [%d]", i) + stateMineNext := sync.State(fmt.Sprintf("mine-block-%d", i)) + t.SyncClient.MustSignalAndWait(ctx, stateMineNext, miners) + + ch := make(chan struct{}) + err := miner.MineOne(ctx, func(mined bool) { + if mined { + t.D().Counter(fmt.Sprintf("block.mine,miner=%s", myActorAddr)).Inc(1) + } + close(ch) + }) + if err != nil { + panic(err) } - close(ch) - }) - if err != nil { - panic(err) + <-ch } - <-ch - } - // signal the last block to make sure no miners are left stuck waiting for the next block signal - // while the others have stopped - stateMineLast := sync.State(fmt.Sprintf("mine-block-%d", i)) - t.SyncClient.MustSignalEntry(ctx, stateMineLast) - }() + // signal the last block to make sure no miners are left stuck waiting for the next block signal + // while the others have stopped + stateMineLast := sync.State(fmt.Sprintf("mine-block-%d", i)) + t.SyncClient.MustSignalEntry(ctx, stateMineLast) + }() + } else { + close(done) + } // wait for a signal from all clients to stop mining err = <-t.SyncClient.MustBarrier(ctx, stateStopMining, clients).C diff --git a/lotus-soup/manifest.toml b/lotus-soup/manifest.toml index 2ee118523..7227fdd35 100644 --- a/lotus-soup/manifest.toml +++ b/lotus-soup/manifest.toml @@ -41,3 +41,6 @@ instances = { min = 1, max = 100, default = 5 } # Params relevant to pubsub tracing enable_pubsub_tracer = { type = "bool", default = false } + + # Mining Mode: synchronized -vs- natural time + mining_mode = { type = "enum", default = "synchronized", options = ["synchronized", "natural"] } diff --git a/lotus-soup/node.go b/lotus-soup/node.go index 34d55fea0..a582df005 100644 --- a/lotus-soup/node.go +++ b/lotus-soup/node.go @@ -397,15 +397,29 @@ func prepareMiner(t *TestEnvironment) (*Node, error) { return nil, err } - mineBlock := make(chan func(bool)) - stop2, err := node.New(context.Background(), + minerOpts := []node.Option{ node.StorageMiner(&n.minerApi), node.Online(), node.Repo(minerRepo), node.Override(new(api.FullNode), n.fullApi), - node.Override(new(*miner.Miner), miner.NewTestMiner(mineBlock, minerAddr)), withMinerListenAddress(minerIP), - ) + } + + if t.StringParam("mining_mode") != "natural" { + mineBlock := make(chan func(bool)) + minerOpts = append(minerOpts, + node.Override(new(*miner.Miner), miner.NewTestMiner(mineBlock, minerAddr))) + n.MineOne = func(ctx context.Context, cb func(bool)) error { + select { + case mineBlock <- cb: + return nil + case <-ctx.Done(): + return ctx.Err() + } + } + } + + stop2, err := node.New(context.Background(), minerOpts...) if err != nil { stop1(context.TODO()) return nil, err @@ -430,15 +444,6 @@ func prepareMiner(t *TestEnvironment) (*Node, error) { panic(err) } - n.MineOne = func(ctx context.Context, cb func(bool)) error { - select { - case mineBlock <- cb: - return nil - case <-ctx.Done(): - return ctx.Err() - } - } - // add local storage for presealed sectors err = n.minerApi.StorageAddLocal(ctx, presealDir) if err != nil { From cced69e4964a264e6a19a1df0f646f5749b388f1 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 29 Jun 2020 19:36:02 +0300 Subject: [PATCH 08/10] add composition for natural time test --- .../compositions/composition-natural.toml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 lotus-soup/compositions/composition-natural.toml diff --git a/lotus-soup/compositions/composition-natural.toml b/lotus-soup/compositions/composition-natural.toml new file mode 100644 index 000000000..750dc4c10 --- /dev/null +++ b/lotus-soup/compositions/composition-natural.toml @@ -0,0 +1,57 @@ +[metadata] + name = "lotus-soup" + author = "" + +[global] + plan = "lotus-soup" + case = "lotus-baseline" + total_instances = 6 + builder = "docker:go" + runner = "local:docker" + +[global.build_config] + enable_go_build_cache = true + +[[groups]] + id = "bootstrapper" + [groups.instances] + count = 1 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "bootstrapper" + clients = "3" + miners = "2" + balance = "2000000000" + sectors = "10" + random_beacon_type = "mock" + +[[groups]] + id = "miners" + [groups.instances] + count = 2 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + clients = "3" + miners = "2" + balance = "2000000000" + sectors = "10" + random_beacon_type = "mock" + mining_mode = "natural" + + +[[groups]] + id = "clients" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "client" + clients = "3" + miners = "2" + balance = "2000000000" + sectors = "10" + random_beacon_type = "mock" From 79246e6ee97091b871325cb0e4a3b820ff6225e7 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 29 Jun 2020 19:49:18 +0300 Subject: [PATCH 09/10] record shutting down message in a more pertinent place --- lotus-soup/common_roles.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lotus-soup/common_roles.go b/lotus-soup/common_roles.go index 6c6d7de2c..f6aa2454f 100644 --- a/lotus-soup/common_roles.go +++ b/lotus-soup/common_roles.go @@ -46,7 +46,9 @@ func runMiner(t *TestEnvironment) error { if miner.MineOne != nil { go func() { + defer t.RecordMessage("shutting down mining") defer close(done) + var i int for i = 0; mine; i++ { // synchronize all miners to mine the next block @@ -83,7 +85,6 @@ func runMiner(t *TestEnvironment) error { } mine = false - t.RecordMessage("shutting down mining") <-done t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount) From 6b44e6d0d8fb59a7b861b77e0e1df89a6668537d Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 29 Jun 2020 20:06:38 +0300 Subject: [PATCH 10/10] update composition-natural.toml --- .../compositions/composition-natural.toml | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/lotus-soup/compositions/composition-natural.toml b/lotus-soup/compositions/composition-natural.toml index 750dc4c10..e82c6a397 100644 --- a/lotus-soup/compositions/composition-natural.toml +++ b/lotus-soup/compositions/composition-natural.toml @@ -12,6 +12,14 @@ [global.build_config] enable_go_build_cache = true +[global.run.test_params] + clients = "3" + miners = "2" + genesis_timestamp_offset = "100000" + balance = "2000000000" + sectors = "10" + random_beacon_type = "mock" + [[groups]] id = "bootstrapper" [groups.instances] @@ -20,11 +28,6 @@ [groups.run] [groups.run.test_params] role = "bootstrapper" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" [[groups]] id = "miners" @@ -34,14 +37,8 @@ [groups.run] [groups.run.test_params] role = "miner" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock" mining_mode = "natural" - [[groups]] id = "clients" [groups.instances] @@ -50,8 +47,3 @@ [groups.run] [groups.run.test_params] role = "client" - clients = "3" - miners = "2" - balance = "2000000000" - sectors = "10" - random_beacon_type = "mock"