Skip to content

Commit

Permalink
Problem: benchmark don't support validator only
Browse files Browse the repository at this point in the history
Solution:
- use validator leader node to generate genesis, so we can set zero
  fullndoes
  • Loading branch information
yihuang committed Sep 20, 2024
1 parent 670fd8d commit 6208aea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions testground/benchmark/benchmark/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion testground/benchmark/benchmark/stateless.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6208aea

Please sign in to comment.