From 6acc948d617818525acb2d5f4c3f1a29331ae2a7 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 8 Oct 2024 18:08:15 +0800 Subject: [PATCH] resolve --- cmd/cronosd/cmd/root.go | 1 + go.mod | 2 +- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- nix/testground-cronosd.patch | 12 ------------ nix/testground-image.nix | 11 ++--------- testground/README.md | 2 +- testground/benchmark/benchmark/peer.py | 14 +++----------- testground/benchmark/benchmark/utils.py | 4 ++-- 9 files changed, 14 insertions(+), 40 deletions(-) delete mode 100644 nix/testground-cronosd.patch diff --git a/cmd/cronosd/cmd/root.go b/cmd/cronosd/cmd/root.go index 97610a2e59..ab48c42bc4 100644 --- a/cmd/cronosd/cmd/root.go +++ b/cmd/cronosd/cmd/root.go @@ -125,6 +125,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig ethermint.EncodingConfig WrapGenTxCmd(encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), WrapValidateGenesisCmd(), AddGenesisAccountCmd(app.DefaultNodeHome), + genutilcli.AddBulkGenesisAccountCmd(app.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), ethermintclient.NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}), debug.Cmd(), diff --git a/go.mod b/go.mod index 5808728a8e..725f2c08a8 100644 --- a/go.mod +++ b/go.mod @@ -241,7 +241,7 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 // release/v0.47.x - github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240517084251-5ba20d99ec23 + github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20241008100047-e671aed24d19 github.com/crypto-org-chain/cronos/memiavl => ./memiavl github.com/crypto-org-chain/cronos/store => ./store github.com/crypto-org-chain/cronos/versiondb => ./versiondb diff --git a/go.sum b/go.sum index f1f90631ad..df6c1c2061 100644 --- a/go.sum +++ b/go.sum @@ -489,8 +489,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 h1:R1QJ9a3XdYMSKo+1RdFifxb/g3lNypC52L/rpYrWoKo= github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63/go.mod h1:rocwIfnS+kA060x64gkSIRvWB9StSppIkJuo5MWzL24= -github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240517084251-5ba20d99ec23 h1:pmpedXv3cd18uDwv62mfevmEVa0KCMgR/hlsTRU9p8g= -github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240517084251-5ba20d99ec23/go.mod h1:vdMQLvLSGh56GqAAQP/w2R389j+g+hHOIwKcUNt9yAc= +github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20241008100047-e671aed24d19 h1:e45niobYERw7QF6viZe5KhIH8eLgDTtg+mT5HsVhqCs= +github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20241008100047-e671aed24d19/go.mod h1:vdMQLvLSGh56GqAAQP/w2R389j+g+hHOIwKcUNt9yAc= github.com/crypto-org-chain/ethermint v0.6.1-0.20240924033445-e55b15cf1494 h1:PsBCicxLYx9u8LXgqoL1DYYQXACank9z1FNkwBqz/tY= github.com/crypto-org-chain/ethermint v0.6.1-0.20240924033445-e55b15cf1494/go.mod h1:zJYmx1D+tDggzvXmdJ0/I62TeIykdCMfJBjBxOcniAU= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231207063621-43cf32d91c3e h1:vnyepPQ/m25+19xcTuBUdRxmltZ/EjVWNqEjhg7Ummk= diff --git a/gomod2nix.toml b/gomod2nix.toml index 4b6fe25ca6..bbc7453374 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -142,8 +142,8 @@ schema = 3 version = "v1.0.0-beta.5" hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.46.0-beta2.0.20240517084251-5ba20d99ec23" - hash = "sha256-rmW8n5Vs2E7AVKVGiUy344uGtL8+LBDqZHOHQVF44YA=" + version = "v0.46.0-beta2.0.20241008100047-e671aed24d19" + hash = "sha256-6JliyJyA6rm80kPKz3tFtfkFRPEzzQgd+otKzMCeAPI=" replaced = "github.com/crypto-org-chain/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" diff --git a/nix/testground-cronosd.patch b/nix/testground-cronosd.patch deleted file mode 100644 index 2958d79a92..0000000000 --- a/nix/testground-cronosd.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/app/app.go b/app/app.go -index 678ccc0a..ba64a7fe 100644 ---- a/app/app.go -+++ b/app/app.go -@@ -1060,6 +1060,7 @@ func (app *App) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64, bl - }, - ExtraDecorators: []sdk.AnteDecorator{blockAddressDecorator}, - PendingTxListener: app.onPendingTx, -+ UnsafeUnorderedTx: true, - } - - anteHandler, err := evmante.NewAnteHandler(options) diff --git a/nix/testground-image.nix b/nix/testground-image.nix index 629ae3ae8c..6d9032d453 100644 --- a/nix/testground-image.nix +++ b/nix/testground-image.nix @@ -1,11 +1,4 @@ { dockerTools, runCommandLocal, cronos-matrix, benchmark-testcase }: -let - patched-cronosd = cronos-matrix.cronosd.overrideAttrs (oldAttrs: { - patches = oldAttrs.patches or [ ] ++ [ - ./testground-cronosd.patch - ]; - }); -in let tmpDir = runCommandLocal "tmp" { } '' mkdir -p $out/tmp/ @@ -16,7 +9,7 @@ dockerTools.buildLayeredImage { created = "now"; contents = [ benchmark-testcase - patched-cronosd + cronos-matrix.cronosd tmpDir ]; config = { @@ -26,4 +19,4 @@ dockerTools.buildLayeredImage { "PYTHONUNBUFFERED=1" ]; }; -} +} \ No newline at end of file diff --git a/testground/README.md b/testground/README.md index 9d284a31f3..986c4f7d06 100644 --- a/testground/README.md +++ b/testground/README.md @@ -43,7 +43,7 @@ nix run .#stateless-testcase -- gen /tmp/data/out \ --app-patch '{"mempool": {"max-txs": -1}}' \ --config-patch '{"mempool": {"size": 100000}}' \ --tx-type erc20-transfer \ - --genesis-patch '{"consensus": {"params": {"block": {"max_gas": "263000000"}}}}' + --genesis-patch '{"consensus_params": {"block": {"max_gas": "263000000"}}}' ``` * `validators`/`fullnodes` is the number of validators/full nodes. diff --git a/testground/benchmark/benchmark/peer.py b/testground/benchmark/benchmark/peer.py index 83da764961..7fb7ed3984 100644 --- a/testground/benchmark/benchmark/peer.py +++ b/testground/benchmark/benchmark/peer.py @@ -74,7 +74,7 @@ def init_node( for i in range(num_accounts) ] - node_id = cli("comet", "show-node-id", **default_kwargs) + node_id = cli("tendermint", "show-node-id", **default_kwargs) peer_id = f"{node_id}@{ip}:26656" peer = PeerPacket( ip=str(ip), @@ -103,13 +103,12 @@ def gen_genesis( fp.write(json.dumps(accounts, default=pydantic_encoder).encode()) fp.flush() cli( - "genesis", "bulk-add-genesis-account", fp.name, home=leader_home, ) collect_gen_tx(cli, peers, home=leader_home) - cli("genesis", "validate", home=leader_home) + cli("validate-genesis", home=leader_home) print("genesis validated") evm_accounts, auth_accounts = erc20.genesis_accounts( @@ -153,11 +152,6 @@ def patch_configs(home: Path, peers: str, config_patch: dict, app_patch: dict): "cache-size": 0, }, "mempool": {"max-txs": MEMPOOL_SIZE}, - "evm": { - "block-executor": "block-stm", # or "sequential" - "block-stm-workers": 0, - "block-stm-pre-estimate": True, - }, "json-rpc": {"enable-indexer": True}, } # update persistent_peers and other configs in config.toml @@ -175,7 +169,6 @@ def patch_configs(home: Path, peers: str, config_patch: dict, app_patch: dict): def gentx(cli, **kwargs): cli( - "genesis", "add-genesis-account", VAL_ACCOUNT, str(VAL_INITIAL_AMOUNT), @@ -184,7 +177,6 @@ def gentx(cli, **kwargs): with tempfile.TemporaryDirectory() as tmp: output = Path(tmp) / "gentx.json" cli( - "genesis", "gentx", VAL_ACCOUNT, VAL_STAKED_AMOUNT, @@ -205,4 +197,4 @@ def collect_gen_tx(cli, peers, **kwargs): for i, peer in enumerate(peers): if peer.gentx is not None: (tmpdir / f"gentx-{i}.json").write_text(json.dumps(peer.gentx)) - cli("genesis", "collect-gentxs", gentx_dir=str(tmpdir), **kwargs) + cli("collect-gentxs", gentx_dir=str(tmpdir), **kwargs) diff --git a/testground/benchmark/benchmark/utils.py b/testground/benchmark/benchmark/utils.py index 42a6947176..8b1f72941e 100644 --- a/testground/benchmark/benchmark/utils.py +++ b/testground/benchmark/benchmark/utils.py @@ -74,8 +74,8 @@ def wait_for_port(port, host="127.0.0.1", timeout=40.0): def wait_for_block(cli, target: int, timeout=40): height = -1 for i in range(timeout): - status = json.loads(cli("status", output="json")) - height = int(status["sync_info"]["latest_block_height"]) + status = json.loads(cli("status")) + height = int(status["SyncInfo"]["latest_block_height"]) if height >= target: break