From b003339ee71947655cf3534c780d232a3df52e08 Mon Sep 17 00:00:00 2001 From: huangyi <huang@crypto.com> Date: Fri, 20 Sep 2024 16:33:47 +0800 Subject: [PATCH] Problem: benchmark don't support validator only Solution: - use validator leader node to generate genesis, so we can set zero fullndoes --- testground/benchmark/benchmark/peer.py | 5 +++++ testground/benchmark/benchmark/stateless.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/testground/benchmark/benchmark/peer.py b/testground/benchmark/benchmark/peer.py index deeb860ffe..a43a082bad 100644 --- a/testground/benchmark/benchmark/peer.py +++ b/testground/benchmark/benchmark/peer.py @@ -86,6 +86,11 @@ def gen_genesis( ): accounts = list(itertools.chain(*(peer.accounts for peer in peers))) print("adding genesis accounts", len(accounts)) + + # skip the validator account of the first node, because we use that node's home, + # and it's already added + accounts = accounts[1:] + with tempfile.NamedTemporaryFile() as fp: fp.write(json.dumps(accounts, default=pydantic_encoder).encode()) fp.flush() diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 4e66159890..2c2fdd580e 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -113,7 +113,7 @@ def _gen( print("prepare genesis") # use a full node directory to prepare the genesis file - genesis = gen_genesis(cli, outdir / FULLNODE_GROUP / "0", peers, genesis_patch) + genesis = gen_genesis(cli, outdir / VALIDATOR_GROUP / "0", peers, genesis_patch) print("patch genesis") # write genesis file and patch config files