From 6ad2b5f34168e68deb93b153f53bd7f56202429a Mon Sep 17 00:00:00 2001 From: huangyi Date: Fri, 13 Sep 2024 12:03:19 +0800 Subject: [PATCH 1/2] Problem: testground validator load generation not configurable --- testground/benchmark/benchmark/stateless.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 8afe3b7c90..101343a8d4 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -95,6 +95,7 @@ def gen( "fullnodes": fullnodes, "num_accounts": num_accounts, "num_txs": num_txs, + "validator-generate-load": options.get("validator-generate-load", False), } (outdir / "config.json").write_text(json.dumps(cfg)) @@ -154,10 +155,12 @@ def run( wait_for_port(26657) wait_for_port(8545) wait_for_block(cli, 3) - wait_for_w3() - generate_load( - cli, cfg["num_accounts"], cfg["num_txs"], home=home, output="json" - ) + + if group == FULLNODE_GROUP or cfg.get("validator-generate-load", False): + wait_for_w3() + generate_load( + cli, cfg["num_accounts"], cfg["num_txs"], home=home, output="json" + ) # node quit when the chain is idle or halted for a while detect_idle_halted(20, 20) From 9cab1acaddfeaad24992895856e48c8cfcf02324 Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 13 Sep 2024 14:05:54 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Signed-off-by: yihuang --- testground/benchmark/benchmark/stateless.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 101343a8d4..bc4c612efe 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -95,7 +95,7 @@ def gen( "fullnodes": fullnodes, "num_accounts": num_accounts, "num_txs": num_txs, - "validator-generate-load": options.get("validator-generate-load", False), + "validator-generate-load": options.get("validator-generate-load", True), } (outdir / "config.json").write_text(json.dumps(cfg)) @@ -156,7 +156,7 @@ def run( wait_for_port(8545) wait_for_block(cli, 3) - if group == FULLNODE_GROUP or cfg.get("validator-generate-load", False): + if group == FULLNODE_GROUP or cfg.get("validator-generate-load", True): wait_for_w3() generate_load( cli, cfg["num_accounts"], cfg["num_txs"], home=home, output="json"