From b4bec82d8a7f1db39fa7b0eb5aef6c076dd31893 Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 2 Aug 2024 15:11:53 +0800 Subject: [PATCH] Problem: benchmark don't enable block-stm (#1536) * Problem: benchmark don't enable block-stm Solution: - make block-executor configurable * Update testground/benchmark/benchmark/peer.py Signed-off-by: yihuang --------- Signed-off-by: yihuang --- testground/benchmark/benchmark/peer.py | 5 +++-- testground/benchmark/benchmark/stateless.py | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/testground/benchmark/benchmark/peer.py b/testground/benchmark/benchmark/peer.py index 451be2f2fe..35daf20295 100644 --- a/testground/benchmark/benchmark/peer.py +++ b/testground/benchmark/benchmark/peer.py @@ -47,7 +47,7 @@ def bootstrap(ctx: Context, cli) -> PeerPacket: cli("genesis", "validate", home=home) p2p_peers = connect_all(peer, peers) - patch_configs(home, ctx.params.test_group_id, p2p_peers) + patch_configs(home, ctx.params.test_group_id, p2p_peers, "block-stm") return peer @@ -116,7 +116,7 @@ def gen_genesis(cli: ChainCommand, leader_home: Path, peers: List[PeerPacket]): ) -def patch_configs(home: Path, group: str, peers: str): +def patch_configs(home: Path, group: str, peers: str, block_executor: str): # update persistent_peers and other configs in config.toml config_patch = { "p2p.persistent_peers": peers, @@ -133,6 +133,7 @@ def patch_configs(home: Path, group: str, peers: str): "index-events": ["ethereum_tx.ethereumTxHash"], "memiavl.enable": True, "mempool.max-txs": MEMPOOL_SIZE, + "evm.block-executor": block_executor, } patch_toml(home / "config" / "config.toml", config_patch) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index c2c5532169..021552c548 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -44,6 +44,7 @@ def gen( hostname_template=HOSTNAME_TEMPLATE, num_accounts=10, num_txs=1000, + block_executor="block-stm", # or "sequential" ): outdir = Path(outdir) cli = ChainCommand(LOCAL_CRONOSD_PATH) @@ -67,10 +68,18 @@ def gen( print("patch genesis") # write genesis file and patch config files for i in range(validators): - patch_configs_local(peers, genesis, outdir, VALIDATOR_GROUP, i, i) + patch_configs_local( + peers, genesis, outdir, VALIDATOR_GROUP, i, i, block_executor + ) for i in range(fullnodes): patch_configs_local( - peers, genesis, outdir, FULLNODE_GROUP, i, i + validators + peers, + genesis, + outdir, + FULLNODE_GROUP, + i, + i + validators, + block_executor, ) print("write config") @@ -208,11 +217,12 @@ def patch_configs_local( group: str, i: int, group_seq: int, + block_executor: str, ): home = outdir / group / str(i) (home / "config" / "genesis.json").write_text(json.dumps(genesis)) p2p_peers = connect_all(peers[i], peers) - patch_configs(home, group, p2p_peers) + patch_configs(home, group, p2p_peers, block_executor) def node_index() -> int: