diff --git a/testground/README.md b/testground/README.md index 544c2f4825..2b5d72ae4a 100644 --- a/testground/README.md +++ b/testground/README.md @@ -81,17 +81,30 @@ You need to have the `cronosd` in `PATH`. ```bash $ nix run github:crypto-org-chain/cronos#stateless-testcase -- gen /tmp/data/out \ - --validators 3 \ - --fullnodes 7 \ --hostname_template "testplan-{index}" \ - --num_accounts 10 \ - --num_txs 1000 + --options '{ + "validators": 3, + "fullnodes": 7, + "num_accounts": 10, + "num_txs": 1000, + "config": { + "mempool.size": 10000 + }, + "app": { + "evm.block-stm-pre-estimate": true + }, + "genesis": { + "consensus.params.block.max_gas": "163000000" + } + }' ``` -* `validators`/`fullnodes` is the number of validators/full nodes. * `hostname_template` is the hostname of each node that can communicate. +* `validators`/`fullnodes` is the number of validators/full nodes. * `num_accounts` is the number of test accounts for each full node. * `num_txs` is the number of test transactions to be sent for each test account. +* `config`/`app` is the config patch for config/app.toml. +* `genesis` is the patch for genesis.json. ## Embed the data directory diff --git a/testground/benchmark/benchmark/peer.py b/testground/benchmark/benchmark/peer.py index 8b480408ef..eb49fd5a7c 100644 --- a/testground/benchmark/benchmark/peer.py +++ b/testground/benchmark/benchmark/peer.py @@ -39,7 +39,7 @@ def bootstrap(ctx: Context, cli) -> PeerPacket: if ctx.is_fullnode_leader: # prepare genesis file and publish - genesis = gen_genesis(cli, home, peers) + genesis = gen_genesis(cli, home, peers, {}) ctx.sync.publish("genesis", genesis) else: genesis = ctx.sync.subscribe_simple("genesis", 1)[0] @@ -94,7 +94,9 @@ def init_node( return peer -def gen_genesis(cli: ChainCommand, leader_home: Path, peers: List[PeerPacket]): +def gen_genesis( + cli: ChainCommand, leader_home: Path, peers: List[PeerPacket], genesis_patch: dict +): for peer in peers: for account in peer.accounts: cli( @@ -109,9 +111,10 @@ def gen_genesis(cli: ChainCommand, leader_home: Path, peers: List[PeerPacket]): return patch_json( leader_home / "config" / "genesis.json", { - "consensus.params.block.max_gas": "81500000", + "consensus.params.block.max_gas": "163000000", "app_state.evm.params.evm_denom": "basecro", "app_state.feemarket.params.no_base_fee": True, + **genesis_patch, }, ) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 5885c14a50..8afe3b7c90 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -42,14 +42,17 @@ class CLI: def gen( self, outdir: str, - validators: int, - fullnodes: int, hostname_template=HOSTNAME_TEMPLATE, - num_accounts=10, - num_txs=1000, - config_patch={}, - app_patch={}, + options={}, ): + print("options", options) + validators = options.get("validators", 3) + fullnodes = options.get("fullnodes", 7) + num_accounts = options.get("num_accounts", 10) + num_txs = options.get("num_txs", 1000) + config_patch = options.get("config", {}) + app_patch = options.get("app", {}) + genesis_patch = options.get("genesis", {}) outdir = Path(outdir) cli = ChainCommand(LOCAL_CRONOSD_PATH) (outdir / VALIDATOR_GROUP).mkdir(parents=True, exist_ok=True) @@ -67,7 +70,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 = gen_genesis(cli, outdir / FULLNODE_GROUP / "0", peers, genesis_patch) print("patch genesis") # write genesis file and patch config files