From e7d4c29b5ec78171793fc1b4cacf29b6b64a1266 Mon Sep 17 00:00:00 2001 From: Nhu Viet Nguyen Date: Mon, 5 Sep 2022 11:48:39 +0200 Subject: [PATCH 1/6] feat: implement compositions for tc-002 Renamed sync_nodes to appropriate naming --- .../100-100-50-1000/320-100mib-0ms.toml | 37 +++++++++++++++++++ .../100-100-50-1000/320-100mib-100ms.toml | 36 ++++++++++++++++++ .../100-100-50-1000/320-100mib-200ms.toml | 36 ++++++++++++++++++ .../40-40-20-100/256-100mib-0ms.toml | 36 ++++++++++++++++++ .../40-40-20-100/320-100mib-100ms.toml | 36 ++++++++++++++++++ .../40-40-20-100/320-100mib-200ms.toml | 36 ++++++++++++++++++ tests/app-sync/run_validator.go | 1 - tests/node-sync/run_app.go | 23 ++++++++++++ tests/node-sync/run_bridge.go | 16 ++++---- tests/node-sync/run_full.go | 8 +++- tests/node-sync/run_light.go | 7 +++- tests/{sync_nodes.go => tc-002-da-sync.go} | 0 12 files changed, 260 insertions(+), 12 deletions(-) create mode 100644 compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml create mode 100644 compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml create mode 100644 compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml create mode 100644 compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml create mode 100644 compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml create mode 100644 compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml rename tests/{sync_nodes.go => tc-002-da-sync.go} (100%) diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml new file mode 100644 index 00000000..56e61f9b --- /dev/null +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml @@ -0,0 +1,37 @@ +[metadata] + name = "001-val-large-txs-80-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "001-val-large-txs" + total_instances = 80 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + latency = "0" + bandwidth = "320Mib" + validator = "80" + persistent-peers = "10" + submit-times = "10" + msg-size = "50000" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 80 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + artifact = "" diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml new file mode 100644 index 00000000..349582ca --- /dev/null +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml @@ -0,0 +1,36 @@ +[metadata] + name = "001-val-large-txs-80-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "001-val-large-txs" + total_instances = 80 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + latency = "100" + bandwidth = "320Mib" + persistent-peers = "10" + submit-times = "10" + msg-size = "50000" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 80 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + artifact = "" diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml new file mode 100644 index 00000000..e4d0b351 --- /dev/null +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml @@ -0,0 +1,36 @@ +[metadata] + name = "001-val-large-txs-80-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "001-val-large-txs" + total_instances = 80 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + latency = "200" + bandwidth = "320Mib" + persistent-peers = "10" + submit-times = "10" + msg-size = "50000" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 80 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + artifact = "" diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml new file mode 100644 index 00000000..e2add8c4 --- /dev/null +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml @@ -0,0 +1,36 @@ +[metadata] + name = "001-val-large-txs-40-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "001-val-large-txs" + total_instances = 40 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + latency = "0" + bandwidth = "256Mib" + persistent-peers = "10" + submit-times = "10" + msg-size = "100000" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 40 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + artifact = "" diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml new file mode 100644 index 00000000..aae9af21 --- /dev/null +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml @@ -0,0 +1,36 @@ +[metadata] + name = "001-val-large-txs-40-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "001-val-large-txs" + total_instances = 40 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + latency = "100" + bandwidth = "320Mib" + persistent-peers = "10" + submit-times = "10" + msg-size = "100000" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 40 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + artifact = "" diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml new file mode 100644 index 00000000..bf43590e --- /dev/null +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml @@ -0,0 +1,36 @@ +[metadata] + name = "001-val-large-txs-40-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "001-val-large-txs" + total_instances = 40 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + latency = "200" + bandwidth = "320Mib" + persistent-peers = "10" + submit-times = "10" + msg-size = "100000" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 40 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + artifact = "" diff --git a/tests/app-sync/run_validator.go b/tests/app-sync/run_validator.go index 90f12121..a301faab 100644 --- a/tests/app-sync/run_validator.go +++ b/tests/app-sync/run_validator.go @@ -57,7 +57,6 @@ func RunValidator(runenv *runtime.RunEnv, initCtx *run.InitContext) error { // // wait for a new block to be produced time.Sleep(1 * time.Minute) - // If all 3 validators submit pfd - it will take too long to produce a new block for i := 0; i < runenv.IntParam("submit-times"); i++ { runenv.RecordMessage("Submitting PFD with %d bytes random data", runenv.IntParam("msg-size")) err = appcmd.PayForData( diff --git a/tests/node-sync/run_app.go b/tests/node-sync/run_app.go index 94608eb7..d4728242 100644 --- a/tests/node-sync/run_app.go +++ b/tests/node-sync/run_app.go @@ -2,9 +2,11 @@ package nodesync import ( "context" + "net" "time" "github.com/celestiaorg/test-infra/testkit" + "github.com/celestiaorg/test-infra/testkit/appkit" "github.com/celestiaorg/test-infra/tests/common" "github.com/testground/sdk-go/network" "github.com/testground/sdk-go/run" @@ -74,6 +76,27 @@ func RunAppValidator(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } + for i := 0; i < runenv.IntParam("submit-times"); i++ { + runenv.RecordMessage("Submitting PFD with %d bytes random data", runenv.IntParam("msg-size")) + err = appcmd.PayForData( + appcmd.AccountAddress, + runenv.IntParam("msg-size"), + "test", + appcmd.GetHomePath(), + ) + if err != nil { + runenv.RecordFailure(err) + return err + } + + s, err := appkit.GetLatestsBlockSize(net.ParseIP("127.0.0.1")) + if err != nil { + runenv.RecordMessage("err in last size call, %s", err.Error()) + } + + runenv.RecordMessage("latest size on iteration %d of the block is - %d", i, s) + } + _, err = syncclient.SignalAndWait(ctx, testkit.FinishState, runenv.TestInstanceCount) if err != nil { return err diff --git a/tests/node-sync/run_bridge.go b/tests/node-sync/run_bridge.go index 1f846ddc..7cb185e1 100644 --- a/tests/node-sync/run_bridge.go +++ b/tests/node-sync/run_bridge.go @@ -67,10 +67,8 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { select { case err = <-sub.Done(): if err != nil { - return nil, err + return nil, fmt.Errorf("no app has been sent for this bridge to connect to remotely") } - case <-ctx.Done(): - return nil, fmt.Errorf("no app has been sent for this bridge to connect to remotely") case appInfo := <-appInfoCh: if (appInfo.ID % total) == (int(initCtx.GlobalSeq) % total) { return appInfo, nil @@ -110,12 +108,12 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(3)) + eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(2)) if err != nil { return err } - runenv.RecordMessage("Reached Block#3 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + runenv.RecordMessage("Reached Block#2 contains Hash: %s", eh.Commit.BlockID.Hash.String()) //create a new subscription to publish bridge's multiaddress to full/light nodes addrs, err := peer.AddrInfoToP2pAddrs(host.InfoFromHost(nd.Host)) @@ -141,11 +139,15 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { runenv.RecordMessage("Finished published bridgeID Addr %d", int(initCtx.GlobalSeq)) - eh, err = nd.HeaderServ.GetByHeight(ctx, uint64(8)) + eh, err = nd.HeaderServ.GetByHeight(ctx, uint64(13)) if err != nil { return err } - runenv.RecordMessage("Reached Block#8 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + runenv.RecordMessage("Reached Block#13 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + + if nd.HeaderServ.IsSyncing() { + runenv.RecordFailure(fmt.Errorf("bridge node is still syncing the past")) + } err = nd.Stop(ctx) if err != nil { diff --git a/tests/node-sync/run_full.go b/tests/node-sync/run_full.go index f3b13170..bfbbc1f5 100644 --- a/tests/node-sync/run_full.go +++ b/tests/node-sync/run_full.go @@ -80,11 +80,15 @@ func RunFullNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(6)) + eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(12)) if err != nil { return err } - runenv.RecordMessage("Reached Block#6 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + runenv.RecordMessage("Reached Block#12 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + + if nd.HeaderServ.IsSyncing() { + runenv.RecordFailure(fmt.Errorf("full node is still syncing the past")) + } err = nd.Stop(ctx) if err != nil { diff --git a/tests/node-sync/run_light.go b/tests/node-sync/run_light.go index 0cf40794..38142a6a 100644 --- a/tests/node-sync/run_light.go +++ b/tests/node-sync/run_light.go @@ -80,12 +80,15 @@ func RunLightNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(6)) + eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(12)) if err != nil { return err } + runenv.RecordMessage("Reached Block#12 contains Hash: %s", eh.Commit.BlockID.Hash.String()) - runenv.RecordMessage("Reached Block#6 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + if nd.HeaderServ.IsSyncing() { + runenv.RecordFailure(fmt.Errorf("full node is still syncing the past")) + } err = nd.Stop(ctx) if err != nil { diff --git a/tests/sync_nodes.go b/tests/tc-002-da-sync.go similarity index 100% rename from tests/sync_nodes.go rename to tests/tc-002-da-sync.go From 1eeaf24d987a26665b18e991ef3d2263a0ad3628 Mon Sep 17 00:00:00 2001 From: Nhu Viet Nguyen Date: Tue, 6 Sep 2022 12:19:57 +0200 Subject: [PATCH 2/6] feat: introduction of role assignments --- .../40-40-20-100/256-100mib-0ms.toml | 79 +++++++++++++++++-- manifest.toml | 5 +- tests/tc-002-da-sync.go | 15 ++-- 3 files changed, 84 insertions(+), 15 deletions(-) diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml index e2add8c4..a8d62a4f 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml @@ -1,21 +1,23 @@ [metadata] - name = "001-val-large-txs-40-set" + name = "tc-002-da-sync-40-40-20-100-set" author = "Bidon15" [global] plan = "celestia" - case = "001-val-large-txs" - total_instances = 40 + case = "tc-002-da-sync" + total_instances = 200 builder = "docker:generic" runner = "cluster:k8s" disable_metrics = false [global.run.test_params] - latency = "0" - bandwidth = "256Mib" persistent-peers = "10" submit-times = "10" msg-size = "100000" + validator = "40" + bridge = "40" + full = "20" + light = "100" [[groups]] id = "validators" @@ -33,4 +35,69 @@ go_version = "1.18" [groups.build] [groups.run] - artifact = "" + [groups.run.test_params] + latency = "0" + bandwidth = "256Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 40 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "256Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 20 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "256Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "2" + [groups.instances] + count = 100 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "100Mib" \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 2d147671..6e32f315 100644 --- a/manifest.toml +++ b/manifest.toml @@ -28,8 +28,8 @@ instances = { min = 1, max = 100, default = 3 } msg-size = { type = "int", default = 10000} [[testcases]] -name = "node-sync" -instances = { min = 4, max = 100, default = 12 } +name = "tc-002-da-sync" +instances = { min = 4, max = 3000, default = 12 } [testcases.params] latency = { type = "int", default = 0} bandwidth = { type = "string", default = "256Mib"} @@ -38,3 +38,4 @@ instances = { min = 4, max = 100, default = 12 } bridge = { type = "int", default = 3} full = { type = "int", default = 3} light = { type = "int", default = 3} + role = { type = "string" } diff --git a/tests/tc-002-da-sync.go b/tests/tc-002-da-sync.go index e987af3b..0ee0d618 100644 --- a/tests/tc-002-da-sync.go +++ b/tests/tc-002-da-sync.go @@ -7,21 +7,22 @@ import ( "github.com/testground/sdk-go/runtime" ) -func SyncNodes(runenv *runtime.RunEnv, initCtx *run.InitContext) error { - var err error - +func SyncNodes(runenv *runtime.RunEnv, initCtx *run.InitContext) (err error) { vn := runenv.IntParam("validator") bn := runenv.IntParam("bridge") fn := runenv.IntParam("full") ln := runenv.IntParam("light") - if int(initCtx.GlobalSeq) <= vn { + // TODO(@Bidon15): how do we assign LN per BN with non-detirministic assignment of GlobalSeq + // due to roles and compositions + switch runenv.StringParam("role") { + case "validator": err = nodesync.RunAppValidator(runenv, initCtx) - } else if int(initCtx.GlobalSeq) > vn && int(initCtx.GlobalSeq) <= (vn+bn) { + case "bridge": err = nodesync.RunBridgeNode(runenv, initCtx) - } else if int(initCtx.GlobalSeq) > (vn+bn) && int(initCtx.GlobalSeq) <= (vn+bn+fn) { + case "full": err = nodesync.RunFullNode(runenv, initCtx) - } else if int(initCtx.GlobalSeq) > (vn+bn+fn) && int(initCtx.GlobalSeq) <= (vn+bn+fn+ln) { + case "light": err = nodesync.RunLightNode(runenv, initCtx) } From 9284f02f2025ea31ed10749b9c8c629cd691b22a Mon Sep 17 00:00:00 2001 From: Nhu Viet Nguyen Date: Thu, 8 Sep 2022 16:18:38 +0200 Subject: [PATCH 3/6] feat: add compositions to TC#002 Rework id assignments from group sequences, not global ones anymore --- compositions/cluster-k8s/node-sync-15.toml | 38 ------- .../100-100-50-1000/320-100mib-0ms.toml | 84 ++++++++++++-- .../100-100-50-1000/320-100mib-100ms.toml | 83 ++++++++++++-- .../100-100-50-1000/320-100mib-200ms.toml | 83 ++++++++++++-- .../40-40-20-100/320-100mib-100ms.toml | 79 +++++++++++++- .../40-40-20-100/320-100mib-200ms.toml | 79 +++++++++++++- compositions/local-docker/002-da-sync-12.toml | 103 ++++++++++++++++++ compositions/local-docker/node-sync.toml | 38 ------- tests/node-sync/run_app.go | 2 +- tests/node-sync/run_bridge.go | 8 +- tests/node-sync/run_full.go | 2 +- tests/node-sync/run_light.go | 2 +- 12 files changed, 481 insertions(+), 120 deletions(-) delete mode 100644 compositions/cluster-k8s/node-sync-15.toml create mode 100644 compositions/local-docker/002-da-sync-12.toml delete mode 100644 compositions/local-docker/node-sync.toml diff --git a/compositions/cluster-k8s/node-sync-15.toml b/compositions/cluster-k8s/node-sync-15.toml deleted file mode 100644 index f7380c69..00000000 --- a/compositions/cluster-k8s/node-sync-15.toml +++ /dev/null @@ -1,38 +0,0 @@ -[metadata] - name = "app-and-node" - author = "Bidon15" - -[global] - plan = "celestia" - case = "node-sync" - total_instances = 15 - builder = "docker:generic" - runner = "cluster:k8s" - disable_metrics = false - -[global.run.test_params] - latency = "0" - bandwidth = "320Mib" - validator = "3" - persistent-peers = "3" - bridge = "4" - full = "4" - light = "4" - -[[groups]] - id = "instance" - builder = "docker:generic" - [groups.resources] - memory = "6Gi" - cpu = "4" - [groups.instances] - count = 15 - percentage = 0.0 - [groups.build_config] - build_base_image = "golang:1.18.3" - enable_go_build_cache = true - enabled = true - go_version = "1.18" - [groups.build] - [groups.run] - artifact = "" diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml index 56e61f9b..597df18b 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml @@ -1,22 +1,23 @@ [metadata] - name = "001-val-large-txs-80-set" + name = "tc-002-da-sync-100-100-50-1000-set" author = "Bidon15" [global] plan = "celestia" - case = "001-val-large-txs" - total_instances = 80 + case = "tc-002-da-sync" + total_instances = 2250 builder = "docker:generic" runner = "cluster:k8s" disable_metrics = false [global.run.test_params] - latency = "0" - bandwidth = "320Mib" - validator = "80" persistent-peers = "10" submit-times = "10" - msg-size = "50000" + msg-size = "40000" + validator = "100" + bridge = "100" + full = "50" + light = "1000" [[groups]] id = "validators" @@ -25,7 +26,7 @@ memory = "4Gi" cpu = "3" [groups.instances] - count = 80 + count = 100 percentage = 0.0 [groups.build_config] build_base_image = "golang:1.18.3" @@ -34,4 +35,69 @@ go_version = "1.18" [groups.build] [groups.run] - artifact = "" + [groups.run.test_params] + latency = "0" + bandwidth = "320Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 100 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "320Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 50 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "320Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "2" + [groups.instances] + count = 1000 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "100Mib" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml index 349582ca..80b1677a 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml @@ -1,21 +1,23 @@ [metadata] - name = "001-val-large-txs-80-set" + name = "tc-002-da-sync-100-100-50-1000-set" author = "Bidon15" [global] plan = "celestia" - case = "001-val-large-txs" - total_instances = 80 + case = "tc-002-da-sync" + total_instances = 2250 builder = "docker:generic" runner = "cluster:k8s" disable_metrics = false [global.run.test_params] - latency = "100" - bandwidth = "320Mib" persistent-peers = "10" submit-times = "10" - msg-size = "50000" + msg-size = "40000" + validator = "100" + bridge = "100" + full = "50" + light = "1000" [[groups]] id = "validators" @@ -24,7 +26,7 @@ memory = "4Gi" cpu = "3" [groups.instances] - count = 80 + count = 100 percentage = 0.0 [groups.build_config] build_base_image = "golang:1.18.3" @@ -33,4 +35,69 @@ go_version = "1.18" [groups.build] [groups.run] - artifact = "" + [groups.run.test_params] + latency = "100" + bandwidth = "320Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 100 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "100" + bandwidth = "320Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 50 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "100" + bandwidth = "320Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "2" + [groups.instances] + count = 1000 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "100" + bandwidth = "100Mib" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml index e4d0b351..1fc7e324 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml @@ -1,21 +1,23 @@ [metadata] - name = "001-val-large-txs-80-set" + name = "tc-002-da-sync-100-100-50-1000-set" author = "Bidon15" [global] plan = "celestia" - case = "001-val-large-txs" - total_instances = 80 + case = "tc-002-da-sync" + total_instances = 2250 builder = "docker:generic" runner = "cluster:k8s" disable_metrics = false [global.run.test_params] - latency = "200" - bandwidth = "320Mib" persistent-peers = "10" submit-times = "10" - msg-size = "50000" + msg-size = "40000" + validator = "100" + bridge = "100" + full = "50" + light = "1000" [[groups]] id = "validators" @@ -24,7 +26,7 @@ memory = "4Gi" cpu = "3" [groups.instances] - count = 80 + count = 100 percentage = 0.0 [groups.build_config] build_base_image = "golang:1.18.3" @@ -33,4 +35,69 @@ go_version = "1.18" [groups.build] [groups.run] - artifact = "" + [groups.run.test_params] + latency = "200" + bandwidth = "320Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 100 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "200" + bandwidth = "320Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 50 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "200" + bandwidth = "320Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "2" + [groups.instances] + count = 1000 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "200" + bandwidth = "100Mib" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml index aae9af21..e3a5587d 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml @@ -1,21 +1,23 @@ [metadata] - name = "001-val-large-txs-40-set" + name = "tc-002-da-sync-40-40-20-100-set" author = "Bidon15" [global] plan = "celestia" - case = "001-val-large-txs" - total_instances = 40 + case = "tc-002-da-sync" + total_instances = 200 builder = "docker:generic" runner = "cluster:k8s" disable_metrics = false [global.run.test_params] - latency = "100" - bandwidth = "320Mib" persistent-peers = "10" submit-times = "10" msg-size = "100000" + validator = "40" + bridge = "40" + full = "20" + light = "100" [[groups]] id = "validators" @@ -33,4 +35,69 @@ go_version = "1.18" [groups.build] [groups.run] - artifact = "" + [groups.run.test_params] + latency = "100" + bandwidth = "320Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 40 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "100" + bandwidth = "320Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 20 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "100" + bandwidth = "320Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "2" + [groups.instances] + count = 100 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "100" + bandwidth = "100Mib" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml index bf43590e..31ebac89 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml @@ -1,21 +1,23 @@ [metadata] - name = "001-val-large-txs-40-set" + name = "tc-002-da-sync-40-40-20-100-set" author = "Bidon15" [global] plan = "celestia" - case = "001-val-large-txs" - total_instances = 40 + case = "tc-002-da-sync" + total_instances = 200 builder = "docker:generic" runner = "cluster:k8s" disable_metrics = false [global.run.test_params] - latency = "200" - bandwidth = "320Mib" persistent-peers = "10" submit-times = "10" msg-size = "100000" + validator = "40" + bridge = "40" + full = "20" + light = "100" [[groups]] id = "validators" @@ -33,4 +35,69 @@ go_version = "1.18" [groups.build] [groups.run] - artifact = "" + [groups.run.test_params] + latency = "200" + bandwidth = "320Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 40 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "200" + bandwidth = "320Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "3" + [groups.instances] + count = 20 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "200" + bandwidth = "320Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "4Gi" + cpu = "2" + [groups.instances] + count = 100 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "200" + bandwidth = "100Mib" \ No newline at end of file diff --git a/compositions/local-docker/002-da-sync-12.toml b/compositions/local-docker/002-da-sync-12.toml new file mode 100644 index 00000000..26dbdd5b --- /dev/null +++ b/compositions/local-docker/002-da-sync-12.toml @@ -0,0 +1,103 @@ +[metadata] + name = "tc-002-da-sync-3-3-3-3-set" + author = "Bidon15" + +[global] + plan = "celestia" + case = "tc-002-da-sync" + total_instances = 12 + builder = "docker:generic" + runner = "cluster:k8s" + disable_metrics = false + +[global.run.test_params] + persistent-peers = "3" + submit-times = "10" + msg-size = "100000" + validator = "3" + bridge = "3" + full = "3" + light = "3" + +[[groups]] + id = "validators" + builder = "docker:generic" + [groups.resources] + memory = "" + cpu = "" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "256Mib" + role = "validator" + +[[groups]] + id = "bridges" + builder = "docker:generic" + [groups.resources] + memory = "" + cpu = "" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "256Mib" + role = "bridge" + +[[groups]] + id = "fulls" + builder = "docker:generic" + [groups.resources] + memory = "" + cpu = "" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "256Mib" + role = "full" + +[[groups]] + id = "lights" + builder = "docker:generic" + [groups.resources] + memory = "" + cpu = "" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.build_config] + build_base_image = "golang:1.18.3" + enable_go_build_cache = true + enabled = true + go_version = "1.18" + [groups.build] + [groups.run] + [groups.run.test_params] + latency = "0" + bandwidth = "100Mib" \ No newline at end of file diff --git a/compositions/local-docker/node-sync.toml b/compositions/local-docker/node-sync.toml deleted file mode 100644 index 7831c7e4..00000000 --- a/compositions/local-docker/node-sync.toml +++ /dev/null @@ -1,38 +0,0 @@ -[metadata] - name = "app-and-node" - author = "Bidon15" - -[global] - plan = "celestia" - case = "node-sync" - total_instances = 12 - builder = "docker:generic" - runner = "local:docker" - disable_metrics = false - -[global.run.test_params] - latency = "0" - bandwidth = "320Mib" - validator = "3" - persistent-peers = "3" - bridge = "3" - full = "3" - light = "3" - -[[groups]] - id = "instance" - builder = "docker:generic" - [groups.resources] - memory = "" - cpu = "" - [groups.instances] - count = 12 - percentage = 0.0 - [groups.build_config] - build_base_image = "golang:1.18.3" - enable_go_build_cache = true - enabled = true - go_version = "1.18" - [groups.build] - [groups.run] - artifact = "" diff --git a/tests/node-sync/run_app.go b/tests/node-sync/run_app.go index d4728242..43dac8c1 100644 --- a/tests/node-sync/run_app.go +++ b/tests/node-sync/run_app.go @@ -68,7 +68,7 @@ func RunAppValidator(runenv *runtime.RunEnv, initCtx *run.InitContext) error { ctx, testkit.AppNodeTopic, &testkit.AppNodeInfo{ - ID: int(initCtx.GlobalSeq), + ID: int(initCtx.GroupSeq), IP: ip, }, ) diff --git a/tests/node-sync/run_bridge.go b/tests/node-sync/run_bridge.go index 7cb185e1..1a34a238 100644 --- a/tests/node-sync/run_bridge.go +++ b/tests/node-sync/run_bridge.go @@ -70,7 +70,7 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return nil, fmt.Errorf("no app has been sent for this bridge to connect to remotely") } case appInfo := <-appInfoCh: - if (appInfo.ID % total) == (int(initCtx.GlobalSeq) % total) { + if (appInfo.ID % total) == (int(initCtx.GroupSeq) % total) { return appInfo, nil } } @@ -121,14 +121,14 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - runenv.RecordMessage("Publishing bridgeID %d", int(initCtx.GlobalSeq)) + runenv.RecordMessage("Publishing bridgeID %d", int(initCtx.GroupSeq)) runenv.RecordMessage("Publishing bridgeID Addr %s", addrs[0].String()) _, err = syncclient.Publish( ctx, testkit.BridgeNodeTopic, &testkit.BridgeNodeInfo{ - ID: int(initCtx.GlobalSeq), + ID: int(initCtx.GroupSeq), Maddr: addrs[0].String(), TrustedHash: h, }, @@ -137,7 +137,7 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - runenv.RecordMessage("Finished published bridgeID Addr %d", int(initCtx.GlobalSeq)) + runenv.RecordMessage("Finished published bridgeID Addr %d", int(initCtx.GroupSeq)) eh, err = nd.HeaderServ.GetByHeight(ctx, uint64(13)) if err != nil { diff --git a/tests/node-sync/run_full.go b/tests/node-sync/run_full.go index bfbbc1f5..a9fba24f 100644 --- a/tests/node-sync/run_full.go +++ b/tests/node-sync/run_full.go @@ -52,7 +52,7 @@ func RunFullNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - bridgeNode, err := GetBridgeNode(ctx, syncclient, initCtx.GlobalSeq, runenv.IntParam("bridge")) + bridgeNode, err := GetBridgeNode(ctx, syncclient, initCtx.GroupSeq, runenv.IntParam("bridge")) if err != nil { return err } diff --git a/tests/node-sync/run_light.go b/tests/node-sync/run_light.go index 38142a6a..26c5dc6c 100644 --- a/tests/node-sync/run_light.go +++ b/tests/node-sync/run_light.go @@ -52,7 +52,7 @@ func RunLightNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - bridgeNode, err := GetBridgeNode(ctx, syncclient, initCtx.GlobalSeq, runenv.IntParam("bridge")) + bridgeNode, err := GetBridgeNode(ctx, syncclient, initCtx.GroupSeq, runenv.IntParam("bridge")) if err != nil { return err } From cb6338157716026c0e71100526a6aa5eb13afd00 Mon Sep 17 00:00:00 2001 From: Nhu Viet Nguyen Date: Fri, 9 Sep 2022 14:19:09 +0200 Subject: [PATCH 4/6] feat: add block-height runenv for test-cases remove obsolete snippets adapt compositions for block-height --- .../tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml | 6 +++++- .../tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml | 6 +++++- .../tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml | 6 +++++- .../tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml | 6 +++++- .../tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml | 6 +++++- .../tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml | 6 +++++- manifest.toml | 1 + tests/node-sync/run_bridge.go | 6 ++++-- tests/node-sync/run_full.go | 6 ++++-- tests/node-sync/run_light.go | 6 ++++-- tests/tc-002-da-sync.go | 7 ------- 11 files changed, 43 insertions(+), 19 deletions(-) diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml index 597df18b..427b9f75 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "0" bandwidth = "320Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "0" bandwidth = "320Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "0" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml index 80b1677a..d26ad6b1 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "100" bandwidth = "320Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "100" bandwidth = "320Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "100" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml index 1fc7e324..3a24a865 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "200" bandwidth = "320Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "200" bandwidth = "320Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "200" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml index a8d62a4f..1f784785 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "0" bandwidth = "256Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "0" bandwidth = "256Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "0" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml index e3a5587d..53d77aa8 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "100" bandwidth = "320Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "100" bandwidth = "320Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "100" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" \ No newline at end of file diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml index 31ebac89..eae62993 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "200" bandwidth = "320Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "200" bandwidth = "320Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "200" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 6e32f315..33d64a81 100644 --- a/manifest.toml +++ b/manifest.toml @@ -39,3 +39,4 @@ instances = { min = 4, max = 3000, default = 12 } full = { type = "int", default = 3} light = { type = "int", default = 3} role = { type = "string" } + block-height = { type = "int" default = 10} diff --git a/tests/node-sync/run_bridge.go b/tests/node-sync/run_bridge.go index 1a34a238..42c0fb90 100644 --- a/tests/node-sync/run_bridge.go +++ b/tests/node-sync/run_bridge.go @@ -139,11 +139,13 @@ func RunBridgeNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { runenv.RecordMessage("Finished published bridgeID Addr %d", int(initCtx.GroupSeq)) - eh, err = nd.HeaderServ.GetByHeight(ctx, uint64(13)) + eh, err = nd.HeaderServ.GetByHeight(ctx, uint64(runenv.IntParam("block-height"))) if err != nil { return err } - runenv.RecordMessage("Reached Block#13 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + runenv.RecordMessage("Reached Block#%d contains Hash: %s", + runenv.IntParam("block-height"), + eh.Commit.BlockID.Hash.String()) if nd.HeaderServ.IsSyncing() { runenv.RecordFailure(fmt.Errorf("bridge node is still syncing the past")) diff --git a/tests/node-sync/run_full.go b/tests/node-sync/run_full.go index a9fba24f..32ea3999 100644 --- a/tests/node-sync/run_full.go +++ b/tests/node-sync/run_full.go @@ -80,11 +80,13 @@ func RunFullNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(12)) + eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(runenv.IntParam("block-height"))) if err != nil { return err } - runenv.RecordMessage("Reached Block#12 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + runenv.RecordMessage("Reached Block#%d contains Hash: %s", + runenv.IntParam("block-height"), + eh.Commit.BlockID.Hash.String()) if nd.HeaderServ.IsSyncing() { runenv.RecordFailure(fmt.Errorf("full node is still syncing the past")) diff --git a/tests/node-sync/run_light.go b/tests/node-sync/run_light.go index 26c5dc6c..1ff011ed 100644 --- a/tests/node-sync/run_light.go +++ b/tests/node-sync/run_light.go @@ -80,11 +80,13 @@ func RunLightNode(runenv *runtime.RunEnv, initCtx *run.InitContext) error { return err } - eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(12)) + eh, err := nd.HeaderServ.GetByHeight(ctx, uint64(runenv.IntParam("block-height"))) if err != nil { return err } - runenv.RecordMessage("Reached Block#12 contains Hash: %s", eh.Commit.BlockID.Hash.String()) + runenv.RecordMessage("Reached Block#%d contains Hash: %s", + runenv.IntParam("block-height"), + eh.Commit.BlockID.Hash.String()) if nd.HeaderServ.IsSyncing() { runenv.RecordFailure(fmt.Errorf("full node is still syncing the past")) diff --git a/tests/tc-002-da-sync.go b/tests/tc-002-da-sync.go index 0ee0d618..c2dfa3d8 100644 --- a/tests/tc-002-da-sync.go +++ b/tests/tc-002-da-sync.go @@ -8,13 +8,6 @@ import ( ) func SyncNodes(runenv *runtime.RunEnv, initCtx *run.InitContext) (err error) { - vn := runenv.IntParam("validator") - bn := runenv.IntParam("bridge") - fn := runenv.IntParam("full") - ln := runenv.IntParam("light") - - // TODO(@Bidon15): how do we assign LN per BN with non-detirministic assignment of GlobalSeq - // due to roles and compositions switch runenv.StringParam("role") { case "validator": err = nodesync.RunAppValidator(runenv, initCtx) From 325adef59a45a962fbf7517f0563c794073ced8b Mon Sep 17 00:00:00 2001 From: Nhu Viet Nguyen Date: Tue, 13 Sep 2022 12:48:12 +0200 Subject: [PATCH 5/6] fix: make block-height without default param --- manifest.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 33d64a81..57ddb6d6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -38,5 +38,6 @@ instances = { min = 4, max = 3000, default = 12 } bridge = { type = "int", default = 3} full = { type = "int", default = 3} light = { type = "int", default = 3} + block-height = { type = "int" } role = { type = "string" } - block-height = { type = "int" default = 10} + From bb9b5f0ad35166dc2dc0148656ab6d76c91c953d Mon Sep 17 00:00:00 2001 From: Nhu Viet Nguyen Date: Thu, 15 Sep 2022 15:23:29 +0200 Subject: [PATCH 6/6] chore: prettify the compositions and readme Co-authored-by: CHAMI Rachid --- .../tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml | 2 +- .../tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml | 2 +- .../tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml | 2 +- .../tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml | 2 +- .../tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml | 2 +- .../tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml | 2 +- compositions/local-docker/002-da-sync-12.toml | 6 +++++- tests/README.md | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml index 427b9f75..11886978 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-0ms.toml @@ -104,4 +104,4 @@ latency = "0" bandwidth = "100Mib" block-height = "12" - role = "light" \ No newline at end of file + role = "light" diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml index d26ad6b1..0eb09b53 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-100ms.toml @@ -104,4 +104,4 @@ latency = "100" bandwidth = "100Mib" block-height = "12" - role = "light" \ No newline at end of file + role = "light" diff --git a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml index 3a24a865..5d7f83bd 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/100-100-50-1000/320-100mib-200ms.toml @@ -104,4 +104,4 @@ latency = "200" bandwidth = "100Mib" block-height = "12" - role = "light" \ No newline at end of file + role = "light" diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml index 1f784785..b51a79ed 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/256-100mib-0ms.toml @@ -104,4 +104,4 @@ latency = "0" bandwidth = "100Mib" block-height = "12" - role = "light" \ No newline at end of file + role = "light" diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml index 53d77aa8..ead0dde5 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-100ms.toml @@ -104,4 +104,4 @@ latency = "100" bandwidth = "100Mib" block-height = "12" - role = "light" \ No newline at end of file + role = "light" diff --git a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml index eae62993..46854463 100644 --- a/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml +++ b/compositions/cluster-k8s/tc-002-da-sync/40-40-20-100/320-100mib-200ms.toml @@ -104,4 +104,4 @@ latency = "200" bandwidth = "100Mib" block-height = "12" - role = "light" \ No newline at end of file + role = "light" diff --git a/compositions/local-docker/002-da-sync-12.toml b/compositions/local-docker/002-da-sync-12.toml index 26dbdd5b..0c581233 100644 --- a/compositions/local-docker/002-da-sync-12.toml +++ b/compositions/local-docker/002-da-sync-12.toml @@ -59,6 +59,7 @@ [groups.run.test_params] latency = "0" bandwidth = "256Mib" + block-height = "13" role = "bridge" [[groups]] @@ -80,6 +81,7 @@ [groups.run.test_params] latency = "0" bandwidth = "256Mib" + block-height = "12" role = "full" [[groups]] @@ -100,4 +102,6 @@ [groups.run] [groups.run.test_params] latency = "0" - bandwidth = "100Mib" \ No newline at end of file + bandwidth = "100Mib" + block-height = "12" + role = "light" diff --git a/tests/README.md b/tests/README.md index 2bd31c68..1adccfb3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -5,4 +5,4 @@ Each `*.go` follows the naming of the test-case in `docs/test-plan/test-plan-id/ In order to not clutter the test-file with different participants' steps, each dedicated directory is created to maintain steps of each types of participants. -The `common` directory maintains steps for a participant that plays the same role in every of the test-case(e.g. creating a validators set) \ No newline at end of file +The `common` directory maintains steps for a participant that plays the same role in every of the test-case (e.g. creating a validators set). \ No newline at end of file