From aef58bb8ab516588f885a3feda5ffaee3212c2b2 Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 5 Jul 2024 11:01:11 +0800 Subject: [PATCH 01/19] Problem: testground infra is not easy to setup (#1504) * Problem: no simpler benchmark setup Solution: - most of the features of testground are not really used by us yet, so for a simple benchmark to get a TPS result, it's possible to do an alternative setup. the alternative implementation setup all the node data files in advance, then run the nodes in containers in a stateless manner, they don't need any coordinations at runtime, so we don't need those infrastructures to support the coordinations, just deploy the testplan image to the cluster like a stateless service. * match test_group_id * lint * Update testground/benchmark/benchmark/peer.py Co-authored-by: mmsqe Signed-off-by: yihuang * change docker-composer * cleanup * speficy name && disable strict * run load generator and jsonnet config quit wait for grpc service * fix lint * readme and flake * fix total * print tps * Update testground/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: yihuang * Revert "print tps" This reverts commit 8ecd342938efb7b0912aa241a4d4bb7a76a0dbb2. * kill directly --------- Signed-off-by: yihuang Co-authored-by: mmsqe Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- flake.nix | 4 + testground/README.md | 27 ++ testground/benchmark/benchmark/main.py | 29 +- testground/benchmark/benchmark/peer.py | 171 ++++++---- testground/benchmark/benchmark/sendtx.py | 17 +- testground/benchmark/benchmark/stateless.py | 147 +++++++++ testground/benchmark/benchmark/utils.py | 7 +- .../compositions/docker-compose.jsonnet | 17 + testground/benchmark/flake.nix | 12 +- testground/benchmark/poetry.lock | 295 ++++++++++-------- testground/benchmark/pyproject.toml | 8 + 11 files changed, 512 insertions(+), 222 deletions(-) create mode 100644 testground/benchmark/benchmark/stateless.py create mode 100644 testground/benchmark/compositions/docker-compose.jsonnet diff --git a/flake.nix b/flake.nix index b1fdcda4a3..5b3887fecc 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,10 @@ apps = { cronosd = mkApp packages.cronosd; cronosd-testnet = mkApp packages.cronosd-testnet; + stateless-testcase = { + type = "app"; + program = "${pkgs.testground-testcase}/bin/stateless-testcase"; + }; }; defaultPackage = packages.cronosd; defaultApp = apps.cronosd; diff --git a/testground/README.md b/testground/README.md index c24d9e54da..8d03f11b76 100644 --- a/testground/README.md +++ b/testground/README.md @@ -1,3 +1,5 @@ +# Testground + [Testground documentation](https://docs.testground.ai/) ## Build Image @@ -67,3 +69,28 @@ mounts: writable: true ``` + + +# Stateless Mode + +To simplify cluster setup, we are introducing a stateless mode. + +## Generate Data Files Locally + +You need to have a `cronosd` in `PATH`. + +```bash +$ nix run github:crypto-org-chain/cronos#stateless-testcase gen /tmp/data/out 3 7 +``` + +## Run In Local Docker + +```bash +$ jsonnet -S testground/benchmark/compositions/docker-compose.jsonnet | docker-compose -f /dev/stdin up +``` + +It'll mount the data files to all the containers. + +## Run In Cluster + +TODO diff --git a/testground/benchmark/benchmark/main.py b/testground/benchmark/benchmark/main.py index 49d4286608..16c1a652dd 100644 --- a/testground/benchmark/benchmark/main.py +++ b/testground/benchmark/benchmark/main.py @@ -1,17 +1,14 @@ import os import subprocess -from concurrent.futures import ThreadPoolExecutor, as_completed from pathlib import Path import web3 from .cli import ChainCommand from .context import Context -from .peer import bootstrap -from .sendtx import fund_test_accounts, sendtx -from .utils import export_eth_account, wait_for_block, wait_for_port - -CRONOSD_PATH = "/bin/cronosd" +from .peer import CONTAINER_CRONOSD_PATH, bootstrap +from .sendtx import generate_load +from .utils import wait_for_block, wait_for_port def influxdb_url(): @@ -21,7 +18,7 @@ def influxdb_url(): def entrypoint(ctx: Context): ctx.init_common() - cli = ChainCommand(CRONOSD_PATH) + cli = ChainCommand(CONTAINER_CRONOSD_PATH) # build the genesis file collectively, and setup the network topology bootstrap(ctx, cli) @@ -29,7 +26,7 @@ def entrypoint(ctx: Context): # start the node logfile = Path(ctx.params.test_outputs_path) / "node.log" proc = subprocess.Popen( - [CRONOSD_PATH, "start"], + [CONTAINER_CRONOSD_PATH, "start"], stdout=open(logfile, "ab", buffering=0), ) @@ -39,21 +36,7 @@ def entrypoint(ctx: Context): test_finish_entry = f"finish-test-{ctx.params.test_group_id}" if not ctx.is_validator: - w3 = web3.Web3(web3.providers.HTTPProvider("http://localhost:8545")) - assert w3.eth.chain_id == 777 - genesis_account = export_eth_account(cli, "account") - accounts = fund_test_accounts(w3, genesis_account, ctx.params.num_accounts) - with ThreadPoolExecutor(max_workers=ctx.params.num_accounts) as executor: - futs = ( - executor.submit(sendtx, w3, acct, ctx.params.num_txs) - for acct in accounts - ) - for fut in as_completed(futs): - try: - fut.result() - except Exception as e: - print("test task failed", e) - + generate_load(cli, ctx.params.num_accounts, ctx.params.num_txs) print("finish test", ctx.group_seq) ctx.sync.signal_and_wait( test_finish_entry, ctx.params.test_group_instance_count diff --git a/testground/benchmark/benchmark/peer.py b/testground/benchmark/benchmark/peer.py index ee1113223c..451be2f2fe 100644 --- a/testground/benchmark/benchmark/peer.py +++ b/testground/benchmark/benchmark/peer.py @@ -3,86 +3,129 @@ from pathlib import Path from typing import List +from .cli import ChainCommand from .context import Context from .network import get_data_ip from .topology import connect_all from .types import GenesisAccount, PeerPacket from .utils import patch_json, patch_toml +VAL_ACCOUNT = "validator" VAL_INITIAL_AMOUNT = "100000000000000000000basecro" VAL_STAKED_AMOUNT = "10000000000000000000basecro" -ACC_INITIAL_AMOUNT = "100000000000000000000basecro" +ACC_INITIAL_AMOUNT = "100000000000000000000000basecro" MEMPOOL_SIZE = 50000 +DEFAULT_DENOM = "basecro" +VALIDATOR_GROUP = "validators" +FULLNODE_GROUP = "fullnodes" +CONTAINER_CRONOSD_PATH = "/bin/cronosd" def bootstrap(ctx: Context, cli) -> PeerPacket: - ip = get_data_ip(ctx.params) - cli( - "init", - f"node{ctx.global_seq}", - chain_id=ctx.params.chain_id, - default_denom="basecro", + home = Path.home() / ".cronos" + peer = init_node( + cli, + home, + get_data_ip(ctx.params), + ctx.params.chain_id, + ctx.params.test_group_id, + ctx.group_seq, ) - cli("keys", "add", "validator", keyring_backend="test") - cli("keys", "add", "account", keyring_backend="test") - validator_addr = cli( - "keys", "show", "validator", "--address", keyring_backend="test" + data = ctx.sync.publish_subscribe_simple( + "peers", peer.dict(), ctx.params.test_instance_count + ) + peers: List[PeerPacket] = [PeerPacket.model_validate(item) for item in data] + + if ctx.is_fullnode_leader: + # prepare genesis file and publish + genesis = gen_genesis(cli, home, peers) + ctx.sync.publish("genesis", genesis) + else: + genesis = ctx.sync.subscribe_simple("genesis", 1)[0] + (home / "config" / "genesis.json").write_text(json.dumps(genesis)) + cli("genesis", "validate", home=home) + + p2p_peers = connect_all(peer, peers) + patch_configs(home, ctx.params.test_group_id, p2p_peers) + return peer + + +def init_node( + cli: ChainCommand, + home: Path, + ip: str, + chain_id: str, + group: str, + group_seq: int, +) -> PeerPacket: + default_kwargs = { + "home": home, + "chain_id": chain_id, + "keyring_backend": "test", + } + cli( + "init", + f"{group}-{group_seq}", + default_denom=DEFAULT_DENOM, + **default_kwargs, ) - account_addr = cli("keys", "show", "account", "--address", keyring_backend="test") + cli("keys", "add", VAL_ACCOUNT, **default_kwargs) + cli("keys", "add", "account", **default_kwargs) + validator_addr = cli("keys", "show", VAL_ACCOUNT, "--address", **default_kwargs) + account_addr = cli("keys", "show", "account", "--address", **default_kwargs) accounts = [ GenesisAccount(address=validator_addr, balance=VAL_INITIAL_AMOUNT), GenesisAccount(address=account_addr, balance=ACC_INITIAL_AMOUNT), ] - node_id = cli("comet", "show-node-id") + node_id = cli("comet", "show-node-id", **default_kwargs) peer_id = f"{node_id}@{ip}:26656" - current = PeerPacket( + peer = PeerPacket( ip=str(ip), node_id=node_id, peer_id=peer_id, accounts=accounts, ) - if ctx.is_validator: - current.gentx = gentx(cli, ctx.params.chain_id) - - data = ctx.sync.publish_subscribe_simple( - "peers", current.dict(), ctx.params.test_instance_count + if group == VALIDATOR_GROUP: + peer.gentx = gentx(cli, **default_kwargs) + + return peer + + +def gen_genesis(cli: ChainCommand, leader_home: Path, peers: List[PeerPacket]): + for peer in peers: + for account in peer.accounts: + cli( + "genesis", + "add-genesis-account", + account.address, + account.balance, + home=leader_home, + ) + collect_gen_tx(cli, peers, home=leader_home) + cli("genesis", "validate", home=leader_home) + return patch_json( + leader_home / "config" / "genesis.json", + { + "consensus.params.block.max_gas": "81500000", + "app_state.evm.params.evm_denom": "basecro", + "app_state.feemarket.params.no_base_fee": True, + }, ) - peers: List[PeerPacket] = [PeerPacket.model_validate(item) for item in data] - config_path = Path.home() / ".cronos" / "config" - if ctx.is_fullnode_leader: - # prepare genesis file and publish - for peer in peers: - for account in peer.accounts: - cli("genesis", "add-genesis-account", account.address, account.balance) - collect_gen_tx(cli, peers) - cli("genesis", "validate") - genesis = patch_json( - config_path / "genesis.json", - { - "consensus.params.block.max_gas": "81500000", - "app_state.evm.params.evm_denom": "basecro", - "app_state.feemarket.params.no_base_fee": True, - }, - ) - ctx.sync.publish("genesis", genesis) - else: - genesis = ctx.sync.subscribe_simple("genesis", 1)[0] - genesis_file = config_path / "genesis.json" - genesis_file.write_text(json.dumps(genesis)) - cli("genesis", "validate") +def patch_configs(home: Path, group: str, peers: str): # update persistent_peers and other configs in config.toml config_patch = { - "p2p.persistent_peers": connect_all(current, peers), + "p2p.persistent_peers": peers, + "p2p.addr_book_strict": False, "mempool.recheck": "false", "mempool.size": MEMPOOL_SIZE, "consensus.timeout_commit": "2s", } - if ctx.is_validator: + if group == VALIDATOR_GROUP: config_patch["tx_index.indexer"] = "null" app_patch = { @@ -92,35 +135,33 @@ def bootstrap(ctx: Context, cli) -> PeerPacket: "mempool.max-txs": MEMPOOL_SIZE, } - patch_toml(config_path / "config.toml", config_patch) - patch_toml(config_path / "app.toml", app_patch) + patch_toml(home / "config" / "config.toml", config_patch) + patch_toml(home / "config" / "app.toml", app_patch) - return current - -def gentx(cli, chain_id): +def gentx(cli, **kwargs): cli( "genesis", "add-genesis-account", - "validator", + VAL_ACCOUNT, VAL_INITIAL_AMOUNT, - keyring_backend="test", + **kwargs, ) - output = Path("gentx.json") - cli( - "genesis", - "gentx", - "validator", - VAL_STAKED_AMOUNT, - min_self_delegation=1, - chain_id=chain_id, - output_document=output, - keyring_backend="test", - ) - return json.loads(output.read_text()) + with tempfile.TemporaryDirectory() as tmp: + output = Path(tmp) / "gentx.json" + cli( + "genesis", + "gentx", + VAL_ACCOUNT, + VAL_STAKED_AMOUNT, + min_self_delegation=1, + output_document=output, + **kwargs, + ) + return json.loads(output.read_text()) -def collect_gen_tx(cli, peers): +def collect_gen_tx(cli, peers, **kwargs): """ save gentxs to file and call collect-gentxs leader node prepare genesis file and broadcast to other nodes @@ -130,4 +171,4 @@ def collect_gen_tx(cli, peers): 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)) + cli("genesis", "collect-gentxs", gentx_dir=str(tmpdir), **kwargs) diff --git a/testground/benchmark/benchmark/sendtx.py b/testground/benchmark/benchmark/sendtx.py index 6fd17696c2..c0752bc34c 100644 --- a/testground/benchmark/benchmark/sendtx.py +++ b/testground/benchmark/benchmark/sendtx.py @@ -1,9 +1,10 @@ import time +from concurrent.futures import ThreadPoolExecutor, as_completed import web3 from eth_account import Account -from .utils import send_transaction +from .utils import export_eth_account, send_transaction TEST_AMOUNT = 1000000000000000000 GAS_PRICE = 1000000000 @@ -54,3 +55,17 @@ def sendtx(w3: web3.Web3, acct: Account, tx_amount: int): if nonce % 100 == 0: print(f"{acct.address} sent {nonce} transactions") + + +def generate_load(cli, num_accounts, num_txs, **kwargs): + w3 = web3.Web3(web3.providers.HTTPProvider("http://localhost:8545")) + assert w3.eth.chain_id == 777 + genesis_account = export_eth_account(cli, "account", **kwargs) + accounts = fund_test_accounts(w3, genesis_account, num_accounts) + with ThreadPoolExecutor(max_workers=num_accounts) as executor: + futs = (executor.submit(sendtx, w3, acct, num_txs) for acct in accounts) + for fut in as_completed(futs): + try: + fut.result() + except Exception as e: + print("test task failed", e) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py new file mode 100644 index 0000000000..6a93fa95d8 --- /dev/null +++ b/testground/benchmark/benchmark/stateless.py @@ -0,0 +1,147 @@ +import json +import os +import socket +import subprocess +from pathlib import Path +from typing import List + +import fire + +from .cli import ChainCommand +from .peer import ( + CONTAINER_CRONOSD_PATH, + FULLNODE_GROUP, + VALIDATOR_GROUP, + gen_genesis, + init_node, + patch_configs, +) +from .sendtx import generate_load +from .topology import connect_all +from .types import PeerPacket +from .utils import wait_for_block, wait_for_port + +# use cronosd on host machine +LOCAL_CRONOSD_PATH = "cronosd" +DEFAULT_CHAIN_ID = "cronos_777-1" +DEFAULT_DENOM = "basecro" +# the container must be deployed with the prefixed name +CONTAINER_PREFIX = "testplan-" + + +class CLI: + def gen(self, outdir: str, validators: int, fullnodes: int): + outdir = Path(outdir) + cli = ChainCommand(LOCAL_CRONOSD_PATH) + (outdir / VALIDATOR_GROUP).mkdir(parents=True, exist_ok=True) + (outdir / FULLNODE_GROUP).mkdir(parents=True, exist_ok=True) + + peers = [] + for i in range(validators): + print("init validator", i) + peers.append(init_node_local(cli, outdir, VALIDATOR_GROUP, i, i)) + for i in range(fullnodes): + print("init fullnode", i) + peers.append( + init_node_local(cli, outdir, FULLNODE_GROUP, i, i + validators) + ) + + print("prepare genesis") + # use a full node directory to prepare the genesis file + genesis = gen_genesis(cli, outdir / FULLNODE_GROUP / "0", peers) + + 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) + for i in range(fullnodes): + patch_configs_local( + peers, genesis, outdir, FULLNODE_GROUP, i, i + validators + ) + + def run( + self, + outdir: str, + validators: int, + cronosd=CONTAINER_CRONOSD_PATH, + global_seq=None, + num_accounts=10, + num_txs=1000, + ): + outdir = Path(outdir) + if global_seq is None: + global_seq = node_index() + group = VALIDATOR_GROUP if global_seq < validators else FULLNODE_GROUP + group_seq = global_seq if group == VALIDATOR_GROUP else global_seq - validators + print("node role", global_seq, group, group_seq) + + home = outdir / group / str(group_seq) + + # start the node + logfile = home / "node.log" + proc = subprocess.Popen( + [cronosd, "start", "--home", str(home)], + stdout=open(logfile, "ab", buffering=0), + ) + + cli = ChainCommand(cronosd) + wait_for_port(26657) + wait_for_port(8545) + wait_for_port(9090) + wait_for_block(cli, 1) + + if group == VALIDATOR_GROUP: + # validators don't quit + proc.wait() + else: + generate_load(cli, num_accounts, num_txs, home=home) + + proc.kill() + + +def init_node_local( + cli: ChainCommand, outdir: Path, group: str, group_seq: int, global_seq: int +) -> PeerPacket: + return init_node( + cli, + outdir / group / str(group_seq), + CONTAINER_PREFIX + str(global_seq), + DEFAULT_CHAIN_ID, + group, + group_seq, + ) + + +def patch_configs_local( + peers: List[PeerPacket], + genesis, + outdir: Path, + group: str, + i: int, + group_seq: int, +): + 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) + + +def node_index() -> int: + """ + 1. try indexed job in k8s, + see: https://kubernetes.io/docs/tasks/job/indexed-parallel-processing-static/ + 2. try hostname + """ + i = os.environ.get("JOB_COMPLETION_INDEX") + if i is not None: + return int(i) + hostname = socket.gethostname() + return int(hostname.rsplit("-", 1)[-1]) + + +def main(): + fire.Fire(CLI) + + +if __name__ == "__main__": + main() diff --git a/testground/benchmark/benchmark/utils.py b/testground/benchmark/benchmark/utils.py index 7b7a81bc16..45782a05d3 100644 --- a/testground/benchmark/benchmark/utils.py +++ b/testground/benchmark/benchmark/utils.py @@ -93,7 +93,6 @@ def send_transaction(w3, tx, acct, wait=True): return txhash -def export_eth_account(cli, name: str) -> Account: - return Account.from_key( - cli("keys", "unsafe-export-eth-key", name, keyring_backend="test") - ) +def export_eth_account(cli, name: str, **kwargs) -> Account: + kwargs.setdefault("keyring_backend", "test") + return Account.from_key(cli("keys", "unsafe-export-eth-key", name, **kwargs)) diff --git a/testground/benchmark/compositions/docker-compose.jsonnet b/testground/benchmark/compositions/docker-compose.jsonnet new file mode 100644 index 0000000000..bec5e017f7 --- /dev/null +++ b/testground/benchmark/compositions/docker-compose.jsonnet @@ -0,0 +1,17 @@ +std.manifestYamlDoc({ + services: { + ['testplan-' + i]: { + image: 'ghcr.io/crypto-org-chain/cronos-testground:latest', + command: 'stateless-testcase run /data 3 --num_accounts=10 --num_txs=1000', + container_name: 'testplan-' + i, + volumes: [ + @'${DATADIR:-/tmp/data/out}:/data', + '/tmp:/tmp', + ], + environment: { + JOB_COMPLETION_INDEX: i, + }, + } + for i in std.range(0, 9) + }, +}) diff --git a/testground/benchmark/flake.nix b/testground/benchmark/flake.nix index e4b9fabafb..3883096eed 100644 --- a/testground/benchmark/flake.nix +++ b/testground/benchmark/flake.nix @@ -64,9 +64,15 @@ in rec { packages.default = pkgs.testground-testcase; - apps.default = { - type = "app"; - program = "${pkgs.testground-testcase}/bin/testground-testcase"; + apps = { + default = { + type = "app"; + program = "${pkgs.testground-testcase}/bin/testground-testcase"; + }; + stateless-testcase = { + type = "app"; + program = "${pkgs.testground-testcase}/bin/stateless-testcase"; + }; }; devShells.default = pkgs.mkShell { buildInputs = [ pkgs.testground-testcase-env ]; diff --git a/testground/benchmark/poetry.lock b/testground/benchmark/poetry.lock index 33a4ac6f68..a3b7e38b88 100644 --- a/testground/benchmark/poetry.lock +++ b/testground/benchmark/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -283,13 +283,13 @@ files = [ [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.6.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, + {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, + {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, ] [[package]] @@ -751,15 +751,18 @@ test = ["eth-hash[pycryptodome]", "pytest (>=7.0.0)", "pytest-xdist (>=2.4.0)"] [[package]] name = "eth-typing" -version = "4.2.3" +version = "4.3.1" description = "eth-typing: Common type annotations for ethereum python packages" optional = false python-versions = "<4,>=3.8" files = [ - {file = "eth_typing-4.2.3-py3-none-any.whl", hash = "sha256:b2df49fa89d2e85f2cc3fb1c903b0cd183d524f7a045e3db8cc720cf41adcd3d"}, - {file = "eth_typing-4.2.3.tar.gz", hash = "sha256:8ee3ae7d4136d14fcb955c34f9dbef8e52170984d4dc68c0ab0d61621eab29d8"}, + {file = "eth_typing-4.3.1-py3-none-any.whl", hash = "sha256:b4d7cee912c7779da75da4b42fa61475c1089d35a4df5081a786eaa29d5f6865"}, + {file = "eth_typing-4.3.1.tar.gz", hash = "sha256:4504559c87a9f71f4b99aa5a1e0549adaa7f192cbf8e37a295acfcddb1b5412d"}, ] +[package.dependencies] +typing-extensions = ">=4.5.0" + [package.extras] dev = ["build (>=0.9.0)", "bumpversion (>=0.5.3)", "ipython", "pre-commit (>=3.4.0)", "pytest (>=7.0.0)", "pytest-xdist (>=2.4.0)", "sphinx (>=6.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=4.0.0)", "twine", "wheel"] docs = ["sphinx (>=6.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] @@ -787,6 +790,20 @@ dev = ["build (>=0.9.0)", "bumpversion (>=0.5.3)", "eth-hash[pycryptodome]", "hy docs = ["sphinx (>=6.0.0)", "sphinx-autobuild (>=2021.3.14)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] test = ["hypothesis (>=4.43.0)", "mypy (==1.5.1)", "pytest (>=7.0.0)", "pytest-xdist (>=2.4.0)"] +[[package]] +name = "fire" +version = "0.6.0" +description = "A library for automatically generating command line interfaces." +optional = false +python-versions = "*" +files = [ + {file = "fire-0.6.0.tar.gz", hash = "sha256:54ec5b996ecdd3c0309c800324a0703d6da512241bc73b553db959d98de0aa66"}, +] + +[package.dependencies] +six = "*" +termcolor = "*" + [[package]] name = "frozenlist" version = "1.4.1" @@ -903,13 +920,13 @@ files = [ [[package]] name = "influxdb-client" -version = "1.43.0" +version = "1.44.0" description = "InfluxDB 2.0 Python client library" optional = false python-versions = ">=3.7" files = [ - {file = "influxdb_client-1.43.0-py3-none-any.whl", hash = "sha256:f079e63018f521024118bc0141b6403c65506711e2e6e93500f8e69f1675dc38"}, - {file = "influxdb_client-1.43.0.tar.gz", hash = "sha256:ae2614d891baed52c0ae8f6194a04ee5b1c6422f6061318a3639fe63b7671b25"}, + {file = "influxdb_client-1.44.0-py3-none-any.whl", hash = "sha256:e4c1ac9c9925c4693d63e988e22f65d2ddc1867f8910813b7f4721633175f2a0"}, + {file = "influxdb_client-1.44.0.tar.gz", hash = "sha256:da9bc0cc49de4a0ac844d833c1efa65227ec5a2254e63cdbe07b5d532c0c37f8"}, ] [package.dependencies] @@ -1205,13 +1222,13 @@ files = [ [[package]] name = "packaging" -version = "24.0" +version = "24.1" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, - {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] [[package]] @@ -1245,22 +1262,22 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "protobuf" -version = "5.27.0" +version = "5.27.2" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "protobuf-5.27.0-cp310-abi3-win32.whl", hash = "sha256:2f83bf341d925650d550b8932b71763321d782529ac0eaf278f5242f513cc04e"}, - {file = "protobuf-5.27.0-cp310-abi3-win_amd64.whl", hash = "sha256:b276e3f477ea1eebff3c2e1515136cfcff5ac14519c45f9b4aa2f6a87ea627c4"}, - {file = "protobuf-5.27.0-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:744489f77c29174328d32f8921566fb0f7080a2f064c5137b9d6f4b790f9e0c1"}, - {file = "protobuf-5.27.0-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:f51f33d305e18646f03acfdb343aac15b8115235af98bc9f844bf9446573827b"}, - {file = "protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:56937f97ae0dcf4e220ff2abb1456c51a334144c9960b23597f044ce99c29c89"}, - {file = "protobuf-5.27.0-cp38-cp38-win32.whl", hash = "sha256:a17f4d664ea868102feaa30a674542255f9f4bf835d943d588440d1f49a3ed15"}, - {file = "protobuf-5.27.0-cp38-cp38-win_amd64.whl", hash = "sha256:aabbbcf794fbb4c692ff14ce06780a66d04758435717107c387f12fb477bf0d8"}, - {file = "protobuf-5.27.0-cp39-cp39-win32.whl", hash = "sha256:587be23f1212da7a14a6c65fd61995f8ef35779d4aea9e36aad81f5f3b80aec5"}, - {file = "protobuf-5.27.0-cp39-cp39-win_amd64.whl", hash = "sha256:7cb65fc8fba680b27cf7a07678084c6e68ee13cab7cace734954c25a43da6d0f"}, - {file = "protobuf-5.27.0-py3-none-any.whl", hash = "sha256:673ad60f1536b394b4fa0bcd3146a4130fcad85bfe3b60eaa86d6a0ace0fa374"}, - {file = "protobuf-5.27.0.tar.gz", hash = "sha256:07f2b9a15255e3cf3f137d884af7972407b556a7a220912b252f26dc3121e6bf"}, + {file = "protobuf-5.27.2-cp310-abi3-win32.whl", hash = "sha256:354d84fac2b0d76062e9b3221f4abbbacdfd2a4d8af36bab0474f3a0bb30ab38"}, + {file = "protobuf-5.27.2-cp310-abi3-win_amd64.whl", hash = "sha256:0e341109c609749d501986b835f667c6e1e24531096cff9d34ae411595e26505"}, + {file = "protobuf-5.27.2-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:a109916aaac42bff84702fb5187f3edadbc7c97fc2c99c5ff81dd15dcce0d1e5"}, + {file = "protobuf-5.27.2-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:176c12b1f1c880bf7a76d9f7c75822b6a2bc3db2d28baa4d300e8ce4cde7409b"}, + {file = "protobuf-5.27.2-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:b848dbe1d57ed7c191dfc4ea64b8b004a3f9ece4bf4d0d80a367b76df20bf36e"}, + {file = "protobuf-5.27.2-cp38-cp38-win32.whl", hash = "sha256:4fadd8d83e1992eed0248bc50a4a6361dc31bcccc84388c54c86e530b7f58863"}, + {file = "protobuf-5.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:610e700f02469c4a997e58e328cac6f305f649826853813177e6290416e846c6"}, + {file = "protobuf-5.27.2-cp39-cp39-win32.whl", hash = "sha256:9e8f199bf7f97bd7ecebffcae45ebf9527603549b2b562df0fbc6d4d688f14ca"}, + {file = "protobuf-5.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:7fc3add9e6003e026da5fc9e59b131b8f22b428b991ccd53e2af8071687b4fce"}, + {file = "protobuf-5.27.2-py3-none-any.whl", hash = "sha256:54330f07e4949d09614707c48b06d1a22f8ffb5763c159efd5c0928326a91470"}, + {file = "protobuf-5.27.2.tar.gz", hash = "sha256:f3ecdef226b9af856075f28227ff2c90ce3a594d092c39bee5513573f25e2714"}, ] [[package]] @@ -1306,109 +1323,121 @@ files = [ [[package]] name = "pydantic" -version = "2.7.2" +version = "2.8.0" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.7.2-py3-none-any.whl", hash = "sha256:834ab954175f94e6e68258537dc49402c4a5e9d0409b9f1b86b7e934a8372de7"}, - {file = "pydantic-2.7.2.tar.gz", hash = "sha256:71b2945998f9c9b7919a45bde9a50397b289937d215ae141c1d0903ba7149fd7"}, + {file = "pydantic-2.8.0-py3-none-any.whl", hash = "sha256:ead4f3a1e92386a734ca1411cb25d94147cf8778ed5be6b56749047676d6364e"}, + {file = "pydantic-2.8.0.tar.gz", hash = "sha256:d970ffb9d030b710795878940bd0489842c638e7252fc4a19c3ae2f7da4d6141"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.18.3" -typing-extensions = ">=4.6.1" +pydantic-core = "2.20.0" +typing-extensions = [ + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, +] [package.extras] email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.18.3" +version = "2.20.0" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.18.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:744697428fcdec6be5670460b578161d1ffe34743a5c15656be7ea82b008197c"}, - {file = "pydantic_core-2.18.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:37b40c05ced1ba4218b14986fe6f283d22e1ae2ff4c8e28881a70fb81fbfcda7"}, - {file = "pydantic_core-2.18.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:544a9a75622357076efb6b311983ff190fbfb3c12fc3a853122b34d3d358126c"}, - {file = "pydantic_core-2.18.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e2e253af04ceaebde8eb201eb3f3e3e7e390f2d275a88300d6a1959d710539e2"}, - {file = "pydantic_core-2.18.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:855ec66589c68aa367d989da5c4755bb74ee92ccad4fdb6af942c3612c067e34"}, - {file = "pydantic_core-2.18.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d3e42bb54e7e9d72c13ce112e02eb1b3b55681ee948d748842171201a03a98a"}, - {file = "pydantic_core-2.18.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c6ac9ffccc9d2e69d9fba841441d4259cb668ac180e51b30d3632cd7abca2b9b"}, - {file = "pydantic_core-2.18.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c56eca1686539fa0c9bda992e7bd6a37583f20083c37590413381acfc5f192d6"}, - {file = "pydantic_core-2.18.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:17954d784bf8abfc0ec2a633108207ebc4fa2df1a0e4c0c3ccbaa9bb01d2c426"}, - {file = "pydantic_core-2.18.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:98ed737567d8f2ecd54f7c8d4f8572ca7c7921ede93a2e52939416170d357812"}, - {file = "pydantic_core-2.18.3-cp310-none-win32.whl", hash = "sha256:9f9e04afebd3ed8c15d67a564ed0a34b54e52136c6d40d14c5547b238390e779"}, - {file = "pydantic_core-2.18.3-cp310-none-win_amd64.whl", hash = "sha256:45e4ffbae34f7ae30d0047697e724e534a7ec0a82ef9994b7913a412c21462a0"}, - {file = "pydantic_core-2.18.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:b9ebe8231726c49518b16b237b9fe0d7d361dd221302af511a83d4ada01183ab"}, - {file = "pydantic_core-2.18.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b8e20e15d18bf7dbb453be78a2d858f946f5cdf06c5072453dace00ab652e2b2"}, - {file = "pydantic_core-2.18.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c0d9ff283cd3459fa0bf9b0256a2b6f01ac1ff9ffb034e24457b9035f75587cb"}, - {file = "pydantic_core-2.18.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2f7ef5f0ebb77ba24c9970da18b771711edc5feaf00c10b18461e0f5f5949231"}, - {file = "pydantic_core-2.18.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73038d66614d2e5cde30435b5afdced2b473b4c77d4ca3a8624dd3e41a9c19be"}, - {file = "pydantic_core-2.18.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6afd5c867a74c4d314c557b5ea9520183fadfbd1df4c2d6e09fd0d990ce412cd"}, - {file = "pydantic_core-2.18.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd7df92f28d351bb9f12470f4c533cf03d1b52ec5a6e5c58c65b183055a60106"}, - {file = "pydantic_core-2.18.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:80aea0ffeb1049336043d07799eace1c9602519fb3192916ff525b0287b2b1e4"}, - {file = "pydantic_core-2.18.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:aaee40f25bba38132e655ffa3d1998a6d576ba7cf81deff8bfa189fb43fd2bbe"}, - {file = "pydantic_core-2.18.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9128089da8f4fe73f7a91973895ebf2502539d627891a14034e45fb9e707e26d"}, - {file = "pydantic_core-2.18.3-cp311-none-win32.whl", hash = "sha256:fec02527e1e03257aa25b1a4dcbe697b40a22f1229f5d026503e8b7ff6d2eda7"}, - {file = "pydantic_core-2.18.3-cp311-none-win_amd64.whl", hash = "sha256:58ff8631dbab6c7c982e6425da8347108449321f61fe427c52ddfadd66642af7"}, - {file = "pydantic_core-2.18.3-cp311-none-win_arm64.whl", hash = "sha256:3fc1c7f67f34c6c2ef9c213e0f2a351797cda98249d9ca56a70ce4ebcaba45f4"}, - {file = "pydantic_core-2.18.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f0928cde2ae416a2d1ebe6dee324709c6f73e93494d8c7aea92df99aab1fc40f"}, - {file = "pydantic_core-2.18.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0bee9bb305a562f8b9271855afb6ce00223f545de3d68560b3c1649c7c5295e9"}, - {file = "pydantic_core-2.18.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e862823be114387257dacbfa7d78547165a85d7add33b446ca4f4fae92c7ff5c"}, - {file = "pydantic_core-2.18.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6a36f78674cbddc165abab0df961b5f96b14461d05feec5e1f78da58808b97e7"}, - {file = "pydantic_core-2.18.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba905d184f62e7ddbb7a5a751d8a5c805463511c7b08d1aca4a3e8c11f2e5048"}, - {file = "pydantic_core-2.18.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7fdd362f6a586e681ff86550b2379e532fee63c52def1c666887956748eaa326"}, - {file = "pydantic_core-2.18.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24b214b7ee3bd3b865e963dbed0f8bc5375f49449d70e8d407b567af3222aae4"}, - {file = "pydantic_core-2.18.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:691018785779766127f531674fa82bb368df5b36b461622b12e176c18e119022"}, - {file = "pydantic_core-2.18.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:60e4c625e6f7155d7d0dcac151edf5858102bc61bf959d04469ca6ee4e8381bd"}, - {file = "pydantic_core-2.18.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4e651e47d981c1b701dcc74ab8fec5a60a5b004650416b4abbef13db23bc7be"}, - {file = "pydantic_core-2.18.3-cp312-none-win32.whl", hash = "sha256:ffecbb5edb7f5ffae13599aec33b735e9e4c7676ca1633c60f2c606beb17efc5"}, - {file = "pydantic_core-2.18.3-cp312-none-win_amd64.whl", hash = "sha256:2c8333f6e934733483c7eddffdb094c143b9463d2af7e6bd85ebcb2d4a1b82c6"}, - {file = "pydantic_core-2.18.3-cp312-none-win_arm64.whl", hash = "sha256:7a20dded653e516a4655f4c98e97ccafb13753987434fe7cf044aa25f5b7d417"}, - {file = "pydantic_core-2.18.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:eecf63195be644b0396f972c82598cd15693550f0ff236dcf7ab92e2eb6d3522"}, - {file = "pydantic_core-2.18.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2c44efdd3b6125419c28821590d7ec891c9cb0dff33a7a78d9d5c8b6f66b9702"}, - {file = "pydantic_core-2.18.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e59fca51ffbdd1638b3856779342ed69bcecb8484c1d4b8bdb237d0eb5a45e2"}, - {file = "pydantic_core-2.18.3-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:70cf099197d6b98953468461d753563b28e73cf1eade2ffe069675d2657ed1d5"}, - {file = "pydantic_core-2.18.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:63081a49dddc6124754b32a3774331467bfc3d2bd5ff8f10df36a95602560361"}, - {file = "pydantic_core-2.18.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:370059b7883485c9edb9655355ff46d912f4b03b009d929220d9294c7fd9fd60"}, - {file = "pydantic_core-2.18.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a64faeedfd8254f05f5cf6fc755023a7e1606af3959cfc1a9285744cc711044"}, - {file = "pydantic_core-2.18.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19d2e725de0f90d8671f89e420d36c3dd97639b98145e42fcc0e1f6d492a46dc"}, - {file = "pydantic_core-2.18.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:67bc078025d70ec5aefe6200ef094576c9d86bd36982df1301c758a9fff7d7f4"}, - {file = "pydantic_core-2.18.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:adf952c3f4100e203cbaf8e0c907c835d3e28f9041474e52b651761dc248a3c0"}, - {file = "pydantic_core-2.18.3-cp38-none-win32.whl", hash = "sha256:9a46795b1f3beb167eaee91736d5d17ac3a994bf2215a996aed825a45f897558"}, - {file = "pydantic_core-2.18.3-cp38-none-win_amd64.whl", hash = "sha256:200ad4e3133cb99ed82342a101a5abf3d924722e71cd581cc113fe828f727fbc"}, - {file = "pydantic_core-2.18.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:304378b7bf92206036c8ddd83a2ba7b7d1a5b425acafff637172a3aa72ad7083"}, - {file = "pydantic_core-2.18.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c826870b277143e701c9ccf34ebc33ddb4d072612683a044e7cce2d52f6c3fef"}, - {file = "pydantic_core-2.18.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e201935d282707394f3668380e41ccf25b5794d1b131cdd96b07f615a33ca4b1"}, - {file = "pydantic_core-2.18.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5560dda746c44b48bf82b3d191d74fe8efc5686a9ef18e69bdabccbbb9ad9442"}, - {file = "pydantic_core-2.18.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b32c2a1f8032570842257e4c19288eba9a2bba4712af542327de9a1204faff8"}, - {file = "pydantic_core-2.18.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:929c24e9dea3990bc8bcd27c5f2d3916c0c86f5511d2caa69e0d5290115344a9"}, - {file = "pydantic_core-2.18.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e1a8376fef60790152564b0eab376b3e23dd6e54f29d84aad46f7b264ecca943"}, - {file = "pydantic_core-2.18.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dccf3ef1400390ddd1fb55bf0632209d39140552d068ee5ac45553b556780e06"}, - {file = "pydantic_core-2.18.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:41dbdcb0c7252b58fa931fec47937edb422c9cb22528f41cb8963665c372caf6"}, - {file = "pydantic_core-2.18.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:666e45cf071669fde468886654742fa10b0e74cd0fa0430a46ba6056b24fb0af"}, - {file = "pydantic_core-2.18.3-cp39-none-win32.whl", hash = "sha256:f9c08cabff68704a1b4667d33f534d544b8a07b8e5d039c37067fceb18789e78"}, - {file = "pydantic_core-2.18.3-cp39-none-win_amd64.whl", hash = "sha256:4afa5f5973e8572b5c0dcb4e2d4fda7890e7cd63329bd5cc3263a25c92ef0026"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:77319771a026f7c7d29c6ebc623de889e9563b7087911b46fd06c044a12aa5e9"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:df11fa992e9f576473038510d66dd305bcd51d7dd508c163a8c8fe148454e059"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d531076bdfb65af593326ffd567e6ab3da145020dafb9187a1d131064a55f97c"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d33ce258e4e6e6038f2b9e8b8a631d17d017567db43483314993b3ca345dcbbb"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1f9cd7f5635b719939019be9bda47ecb56e165e51dd26c9a217a433e3d0d59a9"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:cd4a032bb65cc132cae1fe3e52877daecc2097965cd3914e44fbd12b00dae7c5"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f2718430098bcdf60402136c845e4126a189959d103900ebabb6774a5d9fdb"}, - {file = "pydantic_core-2.18.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:c0037a92cf0c580ed14e10953cdd26528e8796307bb8bb312dc65f71547df04d"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b95a0972fac2b1ff3c94629fc9081b16371dad870959f1408cc33b2f78ad347a"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a62e437d687cc148381bdd5f51e3e81f5b20a735c55f690c5be94e05da2b0d5c"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b367a73a414bbb08507da102dc2cde0fa7afe57d09b3240ce82a16d608a7679c"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ecce4b2360aa3f008da3327d652e74a0e743908eac306198b47e1c58b03dd2b"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bd4435b8d83f0c9561a2a9585b1de78f1abb17cb0cef5f39bf6a4b47d19bafe3"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:616221a6d473c5b9aa83fa8982745441f6a4a62a66436be9445c65f241b86c94"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:7e6382ce89a92bc1d0c0c5edd51e931432202b9080dc921d8d003e616402efd1"}, - {file = "pydantic_core-2.18.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:ff58f379345603d940e461eae474b6bbb6dab66ed9a851ecd3cb3709bf4dcf6a"}, - {file = "pydantic_core-2.18.3.tar.gz", hash = "sha256:432e999088d85c8f36b9a3f769a8e2b57aabd817bbb729a90d1fe7f18f6f1f39"}, + {file = "pydantic_core-2.20.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:e9dcd7fb34f7bfb239b5fa420033642fff0ad676b765559c3737b91f664d4fa9"}, + {file = "pydantic_core-2.20.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:649a764d9b0da29816889424697b2a3746963ad36d3e0968784ceed6e40c6355"}, + {file = "pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7701df088d0b05f3460f7ba15aec81ac8b0fb5690367dfd072a6c38cf5b7fdb5"}, + {file = "pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ab760f17c3e792225cdaef31ca23c0aea45c14ce80d8eff62503f86a5ab76bff"}, + {file = "pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cb1ad5b4d73cde784cf64580166568074f5ccd2548d765e690546cff3d80937d"}, + {file = "pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b81ec2efc04fc1dbf400647d4357d64fb25543bae38d2d19787d69360aad21c9"}, + {file = "pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4a9732a5cad764ba37f3aa873dccb41b584f69c347a57323eda0930deec8e10"}, + {file = "pydantic_core-2.20.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6dc85b9e10cc21d9c1055f15684f76fa4facadddcb6cd63abab702eb93c98943"}, + {file = "pydantic_core-2.20.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:21d9f7e24f63fdc7118e6cc49defaab8c1d27570782f7e5256169d77498cf7c7"}, + {file = "pydantic_core-2.20.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8b315685832ab9287e6124b5d74fc12dda31e6421d7f6b08525791452844bc2d"}, + {file = "pydantic_core-2.20.0-cp310-none-win32.whl", hash = "sha256:c3dc8ec8b87c7ad534c75b8855168a08a7036fdb9deeeed5705ba9410721c84d"}, + {file = "pydantic_core-2.20.0-cp310-none-win_amd64.whl", hash = "sha256:85770b4b37bb36ef93a6122601795231225641003e0318d23c6233c59b424279"}, + {file = "pydantic_core-2.20.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:58e251bb5a5998f7226dc90b0b753eeffa720bd66664eba51927c2a7a2d5f32c"}, + {file = "pydantic_core-2.20.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:78d584caac52c24240ef9ecd75de64c760bbd0e20dbf6973631815e3ef16ef8b"}, + {file = "pydantic_core-2.20.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5084ec9721f82bef5ff7c4d1ee65e1626783abb585f8c0993833490b63fe1792"}, + {file = "pydantic_core-2.20.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6d0f52684868db7c218437d260e14d37948b094493f2646f22d3dda7229bbe3f"}, + {file = "pydantic_core-2.20.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1def125d59a87fe451212a72ab9ed34c118ff771e5473fef4f2f95d8ede26d75"}, + {file = "pydantic_core-2.20.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b34480fd6778ab356abf1e9086a4ced95002a1e195e8d2fd182b0def9d944d11"}, + {file = "pydantic_core-2.20.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d42669d319db366cb567c3b444f43caa7ffb779bf9530692c6f244fc635a41eb"}, + {file = "pydantic_core-2.20.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53b06aea7a48919a254b32107647be9128c066aaa6ee6d5d08222325f25ef175"}, + {file = "pydantic_core-2.20.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1f038156b696a1c39d763b2080aeefa87ddb4162c10aa9fabfefffc3dd8180fa"}, + {file = "pydantic_core-2.20.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3f0f3a4a23717280a5ee3ac4fb1f81d6fde604c9ec5100f7f6f987716bb8c137"}, + {file = "pydantic_core-2.20.0-cp311-none-win32.whl", hash = "sha256:316fe7c3fec017affd916a0c83d6f1ec697cbbbdf1124769fa73328e7907cc2e"}, + {file = "pydantic_core-2.20.0-cp311-none-win_amd64.whl", hash = "sha256:2d06a7fa437f93782e3f32d739c3ec189f82fca74336c08255f9e20cea1ed378"}, + {file = "pydantic_core-2.20.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:d6f8c49657f3eb7720ed4c9b26624063da14937fc94d1812f1e04a2204db3e17"}, + {file = "pydantic_core-2.20.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ad1bd2f377f56fec11d5cfd0977c30061cd19f4fa199bf138b200ec0d5e27eeb"}, + {file = "pydantic_core-2.20.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed741183719a5271f97d93bbcc45ed64619fa38068aaa6e90027d1d17e30dc8d"}, + {file = "pydantic_core-2.20.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d82e5ed3a05f2dcb89c6ead2fd0dbff7ac09bc02c1b4028ece2d3a3854d049ce"}, + {file = "pydantic_core-2.20.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b2ba34a099576234671f2e4274e5bc6813b22e28778c216d680eabd0db3f7dad"}, + {file = "pydantic_core-2.20.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:879ae6bb08a063b3e1b7ac8c860096d8fd6b48dd9b2690b7f2738b8c835e744b"}, + {file = "pydantic_core-2.20.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b0eefc7633a04c0694340aad91fbfd1986fe1a1e0c63a22793ba40a18fcbdc8"}, + {file = "pydantic_core-2.20.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:73deadd6fd8a23e2f40b412b3ac617a112143c8989a4fe265050fd91ba5c0608"}, + {file = "pydantic_core-2.20.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:35681445dc85446fb105943d81ae7569aa7e89de80d1ca4ac3229e05c311bdb1"}, + {file = "pydantic_core-2.20.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0f6dd3612a3b9f91f2e63924ea18a4476656c6d01843ca20a4c09e00422195af"}, + {file = "pydantic_core-2.20.0-cp312-none-win32.whl", hash = "sha256:7e37b6bb6e90c2b8412b06373c6978d9d81e7199a40e24a6ef480e8acdeaf918"}, + {file = "pydantic_core-2.20.0-cp312-none-win_amd64.whl", hash = "sha256:7d4df13d1c55e84351fab51383520b84f490740a9f1fec905362aa64590b7a5d"}, + {file = "pydantic_core-2.20.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:d43e7ab3b65e4dc35a7612cfff7b0fd62dce5bc11a7cd198310b57f39847fd6c"}, + {file = "pydantic_core-2.20.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b6a24d7b5893392f2b8e3b7a0031ae3b14c6c1942a4615f0d8794fdeeefb08b"}, + {file = "pydantic_core-2.20.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b2f13c3e955a087c3ec86f97661d9f72a76e221281b2262956af381224cfc243"}, + {file = "pydantic_core-2.20.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:72432fd6e868c8d0a6849869e004b8bcae233a3c56383954c228316694920b38"}, + {file = "pydantic_core-2.20.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d70a8ff2d4953afb4cbe6211f17268ad29c0b47e73d3372f40e7775904bc28fc"}, + {file = "pydantic_core-2.20.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e49524917b8d3c2f42cd0d2df61178e08e50f5f029f9af1f402b3ee64574392"}, + {file = "pydantic_core-2.20.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a4f0f71653b1c1bad0350bc0b4cc057ab87b438ff18fa6392533811ebd01439c"}, + {file = "pydantic_core-2.20.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:16197e6f4fdecb9892ed2436e507e44f0a1aa2cff3b9306d1c879ea2f9200997"}, + {file = "pydantic_core-2.20.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:763602504bf640b3ded3bba3f8ed8a1cc2fc6a87b8d55c1c5689f428c49c947e"}, + {file = "pydantic_core-2.20.0-cp313-none-win32.whl", hash = "sha256:a3f243f318bd9523277fa123b3163f4c005a3e8619d4b867064de02f287a564d"}, + {file = "pydantic_core-2.20.0-cp313-none-win_amd64.whl", hash = "sha256:03aceaf6a5adaad3bec2233edc5a7905026553916615888e53154807e404545c"}, + {file = "pydantic_core-2.20.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d6f2d8b8da1f03f577243b07bbdd3412eee3d37d1f2fd71d1513cbc76a8c1239"}, + {file = "pydantic_core-2.20.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a272785a226869416c6b3c1b7e450506152d3844207331f02f27173562c917e0"}, + {file = "pydantic_core-2.20.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:efbb412d55a4ffe73963fed95c09ccb83647ec63b711c4b3752be10a56f0090b"}, + {file = "pydantic_core-2.20.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1e4f46189d8740561b43655263a41aac75ff0388febcb2c9ec4f1b60a0ec12f3"}, + {file = "pydantic_core-2.20.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:87d3df115f4a3c8c5e4d5acf067d399c6466d7e604fc9ee9acbe6f0c88a0c3cf"}, + {file = "pydantic_core-2.20.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a340d2bdebe819d08f605e9705ed551c3feb97e4fd71822d7147c1e4bdbb9508"}, + {file = "pydantic_core-2.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:616b9c2f882393d422ba11b40e72382fe975e806ad693095e9a3b67c59ea6150"}, + {file = "pydantic_core-2.20.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:25c46bb2ff6084859bbcfdf4f1a63004b98e88b6d04053e8bf324e115398e9e7"}, + {file = "pydantic_core-2.20.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:23425eccef8f2c342f78d3a238c824623836c6c874d93c726673dbf7e56c78c0"}, + {file = "pydantic_core-2.20.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:52527e8f223ba29608d999d65b204676398009725007c9336651c2ec2d93cffc"}, + {file = "pydantic_core-2.20.0-cp38-none-win32.whl", hash = "sha256:1c3c5b7f70dd19a6845292b0775295ea81c61540f68671ae06bfe4421b3222c2"}, + {file = "pydantic_core-2.20.0-cp38-none-win_amd64.whl", hash = "sha256:8093473d7b9e908af1cef30025609afc8f5fd2a16ff07f97440fd911421e4432"}, + {file = "pydantic_core-2.20.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:ee7785938e407418795e4399b2bf5b5f3cf6cf728077a7f26973220d58d885cf"}, + {file = "pydantic_core-2.20.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0e75794883d635071cf6b4ed2a5d7a1e50672ab7a051454c76446ef1ebcdcc91"}, + {file = "pydantic_core-2.20.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:344e352c96e53b4f56b53d24728217c69399b8129c16789f70236083c6ceb2ac"}, + {file = "pydantic_core-2.20.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:978d4123ad1e605daf1ba5e01d4f235bcf7b6e340ef07e7122e8e9cfe3eb61ab"}, + {file = "pydantic_core-2.20.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c05eaf6c863781eb834ab41f5963604ab92855822a2062897958089d1335dad"}, + {file = "pydantic_core-2.20.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bc7e43b4a528ffca8c9151b6a2ca34482c2fdc05e6aa24a84b7f475c896fc51d"}, + {file = "pydantic_core-2.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:658287a29351166510ebbe0a75c373600cc4367a3d9337b964dada8d38bcc0f4"}, + {file = "pydantic_core-2.20.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1dacf660d6de692fe351e8c806e7efccf09ee5184865893afbe8e59be4920b4a"}, + {file = "pydantic_core-2.20.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3e147fc6e27b9a487320d78515c5f29798b539179f7777018cedf51b7749e4f4"}, + {file = "pydantic_core-2.20.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c867230d715a3dd1d962c8d9bef0d3168994ed663e21bf748b6e3a529a129aab"}, + {file = "pydantic_core-2.20.0-cp39-none-win32.whl", hash = "sha256:22b813baf0dbf612752d8143a2dbf8e33ccb850656b7850e009bad2e101fc377"}, + {file = "pydantic_core-2.20.0-cp39-none-win_amd64.whl", hash = "sha256:3a7235b46c1bbe201f09b6f0f5e6c36b16bad3d0532a10493742f91fbdc8035f"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cafde15a6f7feaec2f570646e2ffc5b73412295d29134a29067e70740ec6ee20"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2aec8eeea0b08fd6bc2213d8e86811a07491849fd3d79955b62d83e32fa2ad5f"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:840200827984f1c4e114008abc2f5ede362d6e11ed0b5931681884dd41852ff1"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8ea1d8b7df522e5ced34993c423c3bf3735c53df8b2a15688a2f03a7d678800"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d5b8376a867047bf08910573deb95d3c8dfb976eb014ee24f3b5a61ccc5bee1b"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d08264b4460326cefacc179fc1411304d5af388a79910832835e6f641512358b"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:7a3639011c2e8a9628466f616ed7fb413f30032b891898e10895a0a8b5857d6c"}, + {file = "pydantic_core-2.20.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:05e83ce2f7eba29e627dd8066aa6c4c0269b2d4f889c0eba157233a353053cea"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:603a843fea76a595c8f661cd4da4d2281dff1e38c4a836a928eac1a2f8fe88e4"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:ac76f30d5d3454f4c28826d891fe74d25121a346c69523c9810ebba43f3b1cec"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e3b1d4b1b3f6082849f9b28427ef147a5b46a6132a3dbaf9ca1baa40c88609"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2761f71faed820e25ec62eacba670d1b5c2709bb131a19fcdbfbb09884593e5a"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a0586cddbf4380e24569b8a05f234e7305717cc8323f50114dfb2051fcbce2a3"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:b8c46a8cf53e849eea7090f331ae2202cd0f1ceb090b00f5902c423bd1e11805"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b4a085bd04af7245e140d1b95619fe8abb445a3d7fdf219b3f80c940853268ef"}, + {file = "pydantic_core-2.20.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:116b326ac82c8b315e7348390f6d30bcfe6e688a7d3f1de50ff7bcc2042a23c2"}, + {file = "pydantic_core-2.20.0.tar.gz", hash = "sha256:366be8e64e0cb63d87cf79b4e1765c0703dd6313c729b22e7b9e378db6b96877"}, ] [package.dependencies] @@ -1416,13 +1445,13 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pytest" -version = "8.2.1" +version = "8.2.2" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.2.1-py3-none-any.whl", hash = "sha256:faccc5d332b8c3719f40283d0d44aa5cf101cec36f88cde9ed8f2bc0538612b1"}, - {file = "pytest-8.2.1.tar.gz", hash = "sha256:5046e5b46d8e4cac199c373041f26be56fdb81eb4e67dc11d4e10811fc3408fd"}, + {file = "pytest-8.2.2-py3-none-any.whl", hash = "sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343"}, + {file = "pytest-8.2.2.tar.gz", hash = "sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977"}, ] [package.dependencies] @@ -1749,18 +1778,18 @@ files = [ [[package]] name = "setuptools" -version = "70.0.0" +version = "70.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.0.0-py3-none-any.whl", hash = "sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4"}, - {file = "setuptools-70.0.0.tar.gz", hash = "sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0"}, + {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, + {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "six" @@ -1773,6 +1802,20 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] +[[package]] +name = "termcolor" +version = "2.4.0" +description = "ANSI color formatting for output in terminal" +optional = false +python-versions = ">=3.8" +files = [ + {file = "termcolor-2.4.0-py3-none-any.whl", hash = "sha256:9297c0df9c99445c2412e832e882a7884038a25617c60cea2ad69488d4040d63"}, + {file = "termcolor-2.4.0.tar.gz", hash = "sha256:aab9e56047c8ac41ed798fa36d892a37aca6b3e9159f3e0c24bc64a9b3ac7b7a"}, +] + +[package.extras] +tests = ["pytest", "pytest-cov"] + [[package]] name = "tomlkit" version = "0.12.5" @@ -1797,13 +1840,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.12.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.12.0-py3-none-any.whl", hash = "sha256:b349c66bea9016ac22978d800cfff206d5f9816951f12a7d0ec5578b0a819594"}, - {file = "typing_extensions-4.12.0.tar.gz", hash = "sha256:8cbcdc8606ebcb0d95453ad7dc5065e6237b6aa230a31e81d0f440c30fed5fd8"}, + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] @@ -1825,13 +1868,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "web3" -version = "6.19.0" +version = "6.20.0" description = "web3.py" optional = false python-versions = ">=3.7.2" files = [ - {file = "web3-6.19.0-py3-none-any.whl", hash = "sha256:fb39683d6aa7586ce0ab0be4be392f8acb62c2503958079d61b59f2a0b883718"}, - {file = "web3-6.19.0.tar.gz", hash = "sha256:d27fbd4ac5aa70d0e0c516bd3e3b802fbe74bc159b407c34052d9301b400f757"}, + {file = "web3-6.20.0-py3-none-any.whl", hash = "sha256:ec09882d21378b688210cf29385e82b604bdc18fe5c2e238bf3b5fe2a6e6dbbc"}, + {file = "web3-6.20.0.tar.gz", hash = "sha256:b04725517502cad4f15e39356eaf7c4fcb0127c7728f83eec8cbafb5b6455f33"}, ] [package.dependencies] @@ -2060,4 +2103,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "f2972ca86e61a8d3bfb573e6cec7af96d44f4b99b20e4034b7af1f863554421c" +content-hash = "ca0ca576c7799b86fa2711528c66f3c4650442e36b503be95c72915668cd72bc" diff --git a/testground/benchmark/pyproject.toml b/testground/benchmark/pyproject.toml index 7bde6a3907..c7b4b2d1c1 100644 --- a/testground/benchmark/pyproject.toml +++ b/testground/benchmark/pyproject.toml @@ -14,6 +14,7 @@ tomlkit = "^0" web3 = "^6" hexbytes = "^0" bech32 = "^1" +fire = "^0" [tool.poetry.dev-dependencies] pytest = "^8.2" @@ -24,3 +25,10 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] testground-testcase = "benchmark.main:main" +stateless-testcase = "benchmark.stateless:main" + +[tool.black] +line-length = 88 + +[tool.isort] +profile = "black" From 4ab7b7c9b548733f72eb72c12b6a5922e191739b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 01:11:30 +0800 Subject: [PATCH 02/19] Bump certifi from 2024.2.2 to 2024.7.4 in /integration_tests (#1508) Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.2.2 to 2024.7.4. - [Commits](https://github.com/certifi/python-certifi/compare/2024.02.02...2024.07.04) --- updated-dependencies: - dependency-name: certifi dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- integration_tests/poetry.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index c5ca3dee2a..7df4fd9178 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohttp" @@ -330,13 +330,13 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] From 805f3a70277dab4fa090d2d5f2e3ea0f121630d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 17:37:59 +0000 Subject: [PATCH 03/19] Bump github.com/rs/cors from 1.10.1 to 1.11.0 (#1507) * Bump github.com/rs/cors from 1.10.1 to 1.11.0 Bumps [github.com/rs/cors](https://github.com/rs/cors) from 1.10.1 to 1.11.0. - [Commits](https://github.com/rs/cors/compare/v1.10.1...v1.11.0) --- updated-dependencies: - dependency-name: github.com/rs/cors dependency-type: indirect ... Signed-off-by: dependabot[bot] * gomod2nix --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: huangyi --- go.mod | 2 +- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 5b39b78a90..264928a58b 100644 --- a/go.mod +++ b/go.mod @@ -195,7 +195,7 @@ require ( github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/rs/cors v1.10.1 // indirect + github.com/rs/cors v1.11.0 // indirect github.com/rs/zerolog v1.32.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect diff --git a/go.sum b/go.sum index 38d09005a4..979480e048 100644 --- a/go.sum +++ b/go.sum @@ -1038,8 +1038,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= diff --git a/gomod2nix.toml b/gomod2nix.toml index 67c08cdb5d..6fb208f979 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -530,8 +530,8 @@ schema = 3 version = "v1.12.0" hash = "sha256-qvDNCe3l84/LgrA8X4O15e1FeDcazyX91m9LmXGXX6M=" [mod."github.com/rs/cors"] - version = "v1.10.1" - hash = "sha256-um4INJM5/675MLK42npIsDbSQ1/Iy5ZiUNuAFReUfeM=" + version = "v1.11.0" + hash = "sha256-hF25bVehtWCQsxiOfLuL4Hv8NKVunEqLPk/Vcuheha0=" [mod."github.com/rs/zerolog"] version = "v1.32.0" hash = "sha256-9dZjtsES+wLp1cFiSVMuEUbdeXVFcgT0dgg5ACZkILk=" From 3983714dbd8c9d723af981c7da1eb2647dd08bc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 09:45:22 +0800 Subject: [PATCH 04/19] Bump certifi from 2024.6.2 to 2024.7.4 in /testground/benchmark (#1509) Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.6.2 to 2024.7.4. - [Commits](https://github.com/certifi/python-certifi/compare/2024.06.02...2024.07.04) --- updated-dependencies: - dependency-name: certifi dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mmsqe --- testground/benchmark/poetry.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testground/benchmark/poetry.lock b/testground/benchmark/poetry.lock index a3b7e38b88..5fc8c6fdcd 100644 --- a/testground/benchmark/poetry.lock +++ b/testground/benchmark/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohttp" @@ -283,13 +283,13 @@ files = [ [[package]] name = "certifi" -version = "2024.6.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, - {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] From 14572fa8ed86722f3d695556b3d538be234ab0d9 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 8 Jul 2024 11:35:19 +0800 Subject: [PATCH 05/19] Problem: rocksdb 9.2.1 is not used (#1511) * Problem: rocksdb 9.2.1 is not used * Update CHANGELOG.md Co-authored-by: mmsqe Signed-off-by: yihuang --------- Signed-off-by: yihuang Co-authored-by: mmsqe --- CHANGELOG.md | 1 + go.mod | 2 +- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- nix/rocksdb.nix | 4 ++-- versiondb/go.mod | 2 +- versiondb/go.sum | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb48781c62..20090bbd92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * (versiondb) [#1491](https://github.com/crypto-org-chain/cronos/pull/1491) Free slice data in HasAtVersion. * (versiondb) [#1498](https://github.com/crypto-org-chain/cronos/pull/1498) Reduce scope of copying slice data in iterator. * [#1500](https://github.com/crypto-org-chain/cronos/pull/1500), [#1503](https://github.com/crypto-org-chain/cronos/pull/1503) Set mempool MaxTx from config (with a default value of `3000`). +* (store) [#1511](https://github.com/crypto-org-chain/cronos/pull/1511) Upgrade rocksdb to `v9.2.1`. *Jun 18, 2024* diff --git a/go.mod b/go.mod index 264928a58b..bb31021030 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-metrics v0.5.3 - github.com/linxGnu/grocksdb v1.9.1 + github.com/linxGnu/grocksdb v1.9.2 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 979480e048..9170aef451 100644 --- a/go.sum +++ b/go.sum @@ -860,8 +860,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.9.1 h1:LmwuHzsWglxJrIES9jvS2O1xTPD2nnKYhAQDx5dIyRo= -github.com/linxGnu/grocksdb v1.9.1/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/linxGnu/grocksdb v1.9.2 h1:O3mzvO0wuzQ9mtlHbDrShixyVjVbmuqTjFrzlf43wZ8= +github.com/linxGnu/grocksdb v1.9.2/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= diff --git a/gomod2nix.toml b/gomod2nix.toml index 6fb208f979..bfff3b6461 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -458,8 +458,8 @@ schema = 3 version = "v0.1.0" hash = "sha256-wQqGTtRWsfR9n0O/SXHVgECebbnNmHddxJIbG63OJBQ=" [mod."github.com/linxGnu/grocksdb"] - version = "v1.9.1" - hash = "sha256-yRSGvZ5YeDqGOEmGPRSKxPjNoCQ/Xk/DMtNtutkbPGg=" + version = "v1.9.2" + hash = "sha256-ThXtaXx6LvRIFW4xLHsMrVWdsN2qobLPA0InLmlADOM=" [mod."github.com/magiconair/properties"] version = "v1.8.7" hash = "sha256-XQ2bnc2s7/IH3WxEO4GishZurMyKwEclZy1DXg+2xXc=" diff --git a/nix/rocksdb.nix b/nix/rocksdb.nix index 916a0a0eb2..6ddb033a98 100644 --- a/nix/rocksdb.nix +++ b/nix/rocksdb.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocksdb"; - version = "9.1.1"; + version = "9.2.1"; src = fetchFromGitHub { owner = "facebook"; repo = finalAttrs.pname; rev = "v${finalAttrs.version}"; - hash = "sha256-/Xf0bzNJPclH9IP80QNaABfhj4IAR5LycYET18VFCXc="; + hash = "sha256-Zifn5Gu/4h6TaEqSaWQ2mFdryeAarqbHWW3fKUGGFac="; }; nativeBuildInputs = [ cmake ninja ]; diff --git a/versiondb/go.mod b/versiondb/go.mod index eff1845260..84bf7dc233 100644 --- a/versiondb/go.mod +++ b/versiondb/go.mod @@ -17,7 +17,7 @@ require ( github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/crypto-org-chain/cronos/memiavl v0.0.3 github.com/golang/snappy v0.0.4 - github.com/linxGnu/grocksdb v1.9.1 + github.com/linxGnu/grocksdb v1.9.2 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 diff --git a/versiondb/go.sum b/versiondb/go.sum index 6d37a68916..56dae74f11 100644 --- a/versiondb/go.sum +++ b/versiondb/go.sum @@ -468,8 +468,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.9.1 h1:LmwuHzsWglxJrIES9jvS2O1xTPD2nnKYhAQDx5dIyRo= -github.com/linxGnu/grocksdb v1.9.1/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/linxGnu/grocksdb v1.9.2 h1:O3mzvO0wuzQ9mtlHbDrShixyVjVbmuqTjFrzlf43wZ8= +github.com/linxGnu/grocksdb v1.9.2/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= From 45562765deebf0e3df1be46eaed5dedb061f7b1e Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 11 Jul 2024 10:05:15 +0800 Subject: [PATCH 06/19] Problem: invalid txs_results returned for legacy ABCI responses (#1485) --- go.mod | 2 +- go.sum | 2 ++ gomod2nix.toml | 4 ++-- integration_tests/test_upgrade.py | 25 +++++++++++++++++++------ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index bb31021030..47b6852168 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( cosmossdk.io/x/upgrade v0.1.1 filippo.io/age v1.1.1 github.com/99designs/keyring v1.2.2 - github.com/cometbft/cometbft v0.38.8 + github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44 github.com/cosmos/cosmos-db v1.0.3-0.20240408151834-e75f6e4b28d8 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.6 diff --git a/go.sum b/go.sum index 9170aef451..349a59337a 100644 --- a/go.sum +++ b/go.sum @@ -368,6 +368,8 @@ github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONN github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= github.com/cometbft/cometbft v0.38.8 h1:XyJ9Cu3xqap6xtNxiemrO8roXZ+KS2Zlu7qQ0w1trvU= github.com/cometbft/cometbft v0.38.8/go.mod h1:xOoGZrtUT+A5izWfHSJgl0gYZUE7lu7Z2XIS1vWG/QQ= +github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44 h1:Tm6SG54Tj/bGVEZUyFPs2UyG0BYvCO3oqvWNyw99bi4= +github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/gomod2nix.toml b/gomod2nix.toml index bfff3b6461..05674fc185 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -154,8 +154,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-z/0E0NiEGo7zxM7d94ImgUf8P0/KG6hbP9T4Vuym4p0=" [mod."github.com/cometbft/cometbft"] - version = "v0.38.8" - hash = "sha256-FJ04SP2VDpkvNGRGojaNeuwCqC54Deru244YJERAmi8=" + version = "v0.38.10-0.20240709120009-0792c8bdda44" + hash = "sha256-ZKAAgJ78Z1Mgww2D8BZz9Qug/m3CXWa9MKM8W4CTbGI=" [mod."github.com/cometbft/cometbft-db"] version = "v0.0.0-20231011055109-57922ac52a63" hash = "sha256-iLs/FN1be3AcoyhKj2+b5Msqeat9j2ja4acyOs+w+Uk=" diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index f15c0e1faf..f32cb18a1c 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -7,6 +7,7 @@ from pathlib import Path import pytest +import requests from pystarport import ports from pystarport.cluster import SUPERVISOR_CONFIG_FILE @@ -33,6 +34,15 @@ def custom_cronos(tmp_path_factory): yield from setup_cronos_test(tmp_path_factory) +def get_txs(base_port, end): + port = ports.rpc_port(base_port) + res = [] + for h in range(1, end): + url = f"http://127.0.0.1:{port}/block_results?height={h}" + res.append(requests.get(url).json().get("result")["txs_results"]) + return res + + def init_cosmovisor(home): """ build and setup cosmovisor directory structure in each node's home directory @@ -108,7 +118,8 @@ def exec(c, tmp_path_factory): - it should work transparently """ cli = c.cosmos_cli() - port = ports.api_port(c.base_port(0)) + base_port = c.base_port(0) + port = ports.api_port(base_port) send_enable = [ {"denom": "basetcro", "enabled": False}, {"denom": "stake", "enabled": True}, @@ -125,7 +136,7 @@ def exec(c, tmp_path_factory): fp.flush() c.supervisorctl("start", "cronos_777-1-node0", "cronos_777-1-node1") - wait_for_port(ports.evmrpc_port(c.base_port(0))) + wait_for_port(ports.evmrpc_port(base_port)) wait_for_new_blocks(cli, 1) def do_upgrade(plan_name, target, mode=None): @@ -150,7 +161,7 @@ def do_upgrade(plan_name, target, mode=None): ) # block should pass the target height wait_for_block(c.cosmos_cli(), target + 2, timeout=480) - wait_for_port(ports.rpc_port(c.base_port(0))) + wait_for_port(ports.rpc_port(base_port)) # test migrate keystore cli.migrate_keystore() @@ -162,7 +173,7 @@ def do_upgrade(plan_name, target, mode=None): cli = c.cosmos_cli() # check basic tx works - wait_for_port(ports.evmrpc_port(c.base_port(0))) + wait_for_port(ports.evmrpc_port(base_port)) receipt = send_transaction( c.w3, { @@ -198,7 +209,7 @@ def do_upgrade(plan_name, target, mode=None): cli = c.cosmos_cli() # check basic tx works - wait_for_port(ports.evmrpc_port(c.base_port(0))) + wait_for_port(ports.evmrpc_port(base_port)) receipt = send_transaction( c.w3, { @@ -227,7 +238,7 @@ def do_upgrade(plan_name, target, mode=None): ADDRS["validator"] ) # check consensus params - port = ports.rpc_port(c.base_port(0)) + port = ports.rpc_port(base_port) res = get_consensus_params(port, w3.eth.get_block_number()) assert res["block"]["max_gas"] == "60000000" @@ -262,7 +273,9 @@ def do_upgrade(plan_name, target, mode=None): height = cli.block_height() target_height2 = height + 15 print("upgrade v1.3 height", target_height2) + txs = get_txs(base_port, height) do_upgrade("v1.3", target_height2) + assert txs == get_txs(base_port, height) cli = c.cosmos_cli() assert e0 == cli.query_params("evm", height=target_height0 - 1)["params"] From 1e6484ac2d20c18399b088023cec749ece7d04ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:31:27 +0800 Subject: [PATCH 07/19] Bump setuptools from 69.1.0 to 70.0.0 in /integration_tests (#1516) Bumps [setuptools](https://github.com/pypa/setuptools) from 69.1.0 to 70.0.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v69.1.0...v70.0.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- integration_tests/poetry.lock | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index 7df4fd9178..536fa9097a 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -1968,19 +1968,18 @@ files = [ [[package]] name = "setuptools" -version = "69.1.0" +version = "70.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-69.1.0-py3-none-any.whl", hash = "sha256:c054629b81b946d63a9c6e732bc8b2513a7c3ea645f11d0139a2191d735c60c6"}, - {file = "setuptools-69.1.0.tar.gz", hash = "sha256:850894c4195f09c4ed30dba56213bf7c3f21d86ed6bdaafb5df5972593bfc401"}, + {file = "setuptools-70.0.0-py3-none-any.whl", hash = "sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4"}, + {file = "setuptools-70.0.0.tar.gz", hash = "sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "six" From 7f581a697f6de306f7aaf899d45c50cc5ad270bf Mon Sep 17 00:00:00 2001 From: yihuang Date: Tue, 16 Jul 2024 16:18:18 +0800 Subject: [PATCH 08/19] Problem: sig verification result is not cached between incarnations (#1515) * Problem: sig verification result is not cached between incarnations * Update CHANGELOG.md Signed-off-by: yihuang * update ethermint * update deps * fix gas * update deps --------- Signed-off-by: yihuang Co-authored-by: mmsqe --- CHANGELOG.md | 2 +- go.mod | 6 +++--- go.sum | 12 ++++-------- gomod2nix.toml | 11 ++++------- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20090bbd92..dca78c9e8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ * (versiondb) [#1498](https://github.com/crypto-org-chain/cronos/pull/1498) Reduce scope of copying slice data in iterator. * [#1500](https://github.com/crypto-org-chain/cronos/pull/1500), [#1503](https://github.com/crypto-org-chain/cronos/pull/1503) Set mempool MaxTx from config (with a default value of `3000`). * (store) [#1511](https://github.com/crypto-org-chain/cronos/pull/1511) Upgrade rocksdb to `v9.2.1`. - +* (block-stm) [#1515](https://github.com/crypto-org-chain/cronos/pull/1515) Improve performance by cache signature verification result between incarnations of same tx. *Jun 18, 2024* diff --git a/go.mod b/go.mod index 47b6852168..f4764972cb 100644 --- a/go.mod +++ b/go.mod @@ -171,7 +171,6 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -257,7 +256,7 @@ replace ( cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595 cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595 cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595 - github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240626040048-36295f051595 + github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4 ) replace ( @@ -277,7 +276,8 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 // block-stm branch - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240702125417-e5b222ffaf90 + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f + // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 diff --git a/go.sum b/go.sum index 349a59337a..84d3fde0d9 100644 --- a/go.sum +++ b/go.sum @@ -366,8 +366,6 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.8 h1:XyJ9Cu3xqap6xtNxiemrO8roXZ+KS2Zlu7qQ0w1trvU= -github.com/cometbft/cometbft v0.38.8/go.mod h1:xOoGZrtUT+A5izWfHSJgl0gYZUE7lu7Z2XIS1vWG/QQ= github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44 h1:Tm6SG54Tj/bGVEZUyFPs2UyG0BYvCO3oqvWNyw99bi4= github.com/cometbft/cometbft v0.38.10-0.20240709120009-0792c8bdda44/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -424,16 +422,16 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= 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.0.0-20240626040048-36295f051595 h1:qiUv1Y+OE8ZgB5mfXFti8R9bjq8zmfuoe2m2g3Iq41c= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240626040048-36295f051595/go.mod h1:bIUzWfqXnCF2WTFb2uN+FjzMIG3BsOk+P2QmvMtm4ic= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4 h1:ipjTVqr7gMct5OQvCmzrNbm7xIxb2wTCLpCXpUf0+KA= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E= github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595 h1:xfrVLBZgV2DXjQXTSlaWHcG/s6Fdeme8tczaN4TTERw= github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0= github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595 h1:gHBOTNAuuGeD9HXGkTE04x3zee+00bXcVd8Jb3WG0nY= github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595 h1:MPKv1EzM16dx+HzkJowgb9PrlbatRlgFYqk1IucsL2s= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240702125417-e5b222ffaf90 h1:ShLhFPxmerMFSxoFBKUZuYr8C8iaqBRiMpMaQojFCmU= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240702125417-e5b222ffaf90/go.mod h1:z5zfkmH6XonIpRzMzFoZU+QSBkXSe5GdRvRWiK9fiA8= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f h1:/27Pg87DNRG0xzctT8XcEANKF0OksPgFJtcQSRs5O0E= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 h1:V43F3JFcqG4MUThf9W/DytnPblpR6CcaLBw2Wx6zTgE= @@ -858,8 +856,6 @@ github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263/go.mod h1:O github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linxGnu/grocksdb v1.9.2 h1:O3mzvO0wuzQ9mtlHbDrShixyVjVbmuqTjFrzlf43wZ8= diff --git a/gomod2nix.toml b/gomod2nix.toml index 05674fc185..ef10137eb4 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -170,8 +170,8 @@ schema = 3 version = "v1.0.0-beta.5" hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.0.0-20240626040048-36295f051595" - hash = "sha256-rwGLcCHeeq74zLoqZ/yCSB6WdHmdwFiz/xRw1SIiBYQ=" + version = "v0.50.6-0.20240716063309-c47504d189d4" + hash = "sha256-ukD0WZAMJ9hdwzBXzc6a60VOopZ6u+pdf67iq/1Tfa4=" replaced = "github.com/crypto-org-chain/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" @@ -262,8 +262,8 @@ schema = 3 hash = "sha256-lE4G5FaRb3MVi9FFVn+WlwsSTOB4SbjmVboKyQ5yB0A=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20240702125417-e5b222ffaf90" - hash = "sha256-nkV3/yK5Eco9B3ifhLa5B0yGnCMjLzCxEdGq/z2rmhA=" + version = "v0.6.1-0.20240715061533-9c959a26e04f" + hash = "sha256-REZAPHulyi4veAg3ij721eSrF7yjopGkc6NPfTMaow8=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/fatih/color"] version = "v1.16.0" @@ -454,9 +454,6 @@ schema = 3 [mod."github.com/lib/pq"] version = "v1.10.7" hash = "sha256-YPUv1VBZNFVUjFxQKdYd0Djje6KYYE99Hz6FnTfrmMw=" - [mod."github.com/libp2p/go-buffer-pool"] - version = "v0.1.0" - hash = "sha256-wQqGTtRWsfR9n0O/SXHVgECebbnNmHddxJIbG63OJBQ=" [mod."github.com/linxGnu/grocksdb"] version = "v1.9.2" hash = "sha256-ThXtaXx6LvRIFW4xLHsMrVWdsN2qobLPA0InLmlADOM=" From 8384cad727377e415c4c611558b14207cd86b0d2 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 22 Jul 2024 14:23:11 +0800 Subject: [PATCH 09/19] Problem: memiavl/versiondb don't build with upstream sdk (#1518) * Problem: memiavl/versiondb don't build with upstream sdk Solution: - keep it api compatible with both * deps * remove support of streaming service, versiondb will override * changelog * fix test * align deps * fix lint * fix lint --------- Co-authored-by: mmsqe --- .github/workflows/lint.yml | 6 ++--- CHANGELOG.md | 1 + Makefile | 8 +++--- app/app.go | 6 ----- default.nix | 2 +- go.mod | 8 +++--- go.sum | 16 ++++++------ gomod2nix.toml | 12 ++++----- store/cachemulti/store.go | 2 +- store/go.mod | 6 ++--- store/go.sum | 12 ++++----- store/rootmulti/objstore.go | 33 +++++++++++++++++++++++++ store/rootmulti/objstore_placeholder.go | 15 +++++++++++ store/rootmulti/store.go | 18 +------------- versiondb/go.mod | 4 +-- versiondb/go.sum | 8 +++--- versiondb/multistore.go | 14 +++++------ versiondb/objstore.go | 11 +++++++++ versiondb/store.go | 5 ++++ 19 files changed, 115 insertions(+), 72 deletions(-) create mode 100644 store/rootmulti/objstore.go create mode 100644 store/rootmulti/objstore_placeholder.go create mode 100644 versiondb/objstore.go diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 85b45e1358..5601f8efdd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -44,15 +44,15 @@ jobs: export CGO_CFLAGS="$(pkg-config --cflags rocksdb)" CGO_LDFLAGS="$(pkg-config --libs rocksdb)" golangci-lint version - BUILD_TAGS=rocksdb,grocksdb_clean_link + BUILD_TAGS=rocksdb,grocksdb_clean_link,objstore go build -tags $BUILD_TAGS ./cmd/cronosd golangci-lint run --out-format=github-actions --path-prefix=./ --timeout 10m --build-tags $BUILD_TAGS cd versiondb golangci-lint run --out-format=github-actions --path-prefix=./versiondb --timeout 10m --build-tags $BUILD_TAGS cd ../memiavl - golangci-lint run --out-format=github-actions --path-prefix=./memiavl --timeout 10m + golangci-lint run --out-format=github-actions --path-prefix=./memiavl --timeout 10m --build-tags objstore cd ../store - golangci-lint run --out-format=github-actions --path-prefix=./store --timeout 10m + golangci-lint run --out-format=github-actions --path-prefix=./store --timeout 10m --build-tags objstore # Check only if there are differences in the source code if: steps.changed-files.outputs.any_changed == 'true' diff --git a/CHANGELOG.md b/CHANGELOG.md index dca78c9e8d..763772f352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * [#1394](https://github.com/crypto-org-chain/cronos/pull/1394) Add icahost wirings but disable in parameters. * [#1414](https://github.com/crypto-org-chain/cronos/pull/1414) Integrate new evm tx format. * [#1458](https://github.com/crypto-org-chain/cronos/pull/1458) Adjust require gas for recvPacket when ReceiverChainIsSource. +* [#1518](https://github.com/crypto-org-chain/cronos/pull/1518) Keep versiondb/memiavl compatible with upstream sdk, stop supporting other streaming service. ### Improvements diff --git a/Makefile b/Makefile index dfa601477a..1f8e14d53e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ COMMIT := $(shell git log -1 --format='%H') DOCKER := $(shell which docker) # process build tags -build_tags = netgo +build_tags = netgo objstore ifeq ($(NETWORK),mainnet) build_tags += mainnet else ifeq ($(NETWORK),testnet) @@ -99,9 +99,9 @@ install: check-network print-ledger go.sum @go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd test: - @go test -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic - @cd memiavl; go test -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd .. - @cd store; go test -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd .. + @go test -tags=objstore -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic + @cd memiavl; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd .. + @cd store; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd .. test-versiondb: @cd versiondb; go test -tags rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd .. diff --git a/app/app.go b/app/app.go index 02ef1508f5..32d7f409b8 100644 --- a/app/app.go +++ b/app/app.go @@ -941,12 +941,6 @@ func New( app.MountMemoryStores(memKeys) app.MountObjectStores(okeys) - // load state streaming if enabled - if err := app.RegisterStreamingServices(appOpts, keys); err != nil { - fmt.Printf("failed to load state streaming: %s", err) - os.Exit(1) - } - // wire up the versiondb's `StreamingService` and `MultiStore`. if cast.ToBool(appOpts.Get("versiondb.enable")) { var err error diff --git a/default.nix b/default.nix index 4501d75db8..ffa8b73f64 100644 --- a/default.nix +++ b/default.nix @@ -13,7 +13,7 @@ let version = "v1.3.0"; pname = "cronosd"; - tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" ] ++ lib.optionals nativeByteOrder [ "nativebyteorder" ]; + tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" "objstore" ] ++ lib.optionals nativeByteOrder [ "nativebyteorder" ]; ldflags = lib.concatStringsSep "\n" ([ "-X github.com/cosmos/cosmos-sdk/version.Name=cronos" "-X github.com/cosmos/cosmos-sdk/version.AppName=${pname}" diff --git a/go.mod b/go.mod index f4764972cb..f2a50561b6 100644 --- a/go.mod +++ b/go.mod @@ -253,10 +253,10 @@ require ( // release/v0.50.x replace ( - cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595 - cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595 - cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595 - github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4 + cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240722033504-50f1fa0c49d1 + cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 + cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 + github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 ) replace ( diff --git a/go.sum b/go.sum index 84d3fde0d9..d1868a3e79 100644 --- a/go.sum +++ b/go.sum @@ -422,14 +422,14 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= 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.50.6-0.20240716063309-c47504d189d4 h1:ipjTVqr7gMct5OQvCmzrNbm7xIxb2wTCLpCXpUf0+KA= -github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E= -github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595 h1:xfrVLBZgV2DXjQXTSlaWHcG/s6Fdeme8tczaN4TTERw= -github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595 h1:gHBOTNAuuGeD9HXGkTE04x3zee+00bXcVd8Jb3WG0nY= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= -github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595 h1:MPKv1EzM16dx+HzkJowgb9PrlbatRlgFYqk1IucsL2s= -github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 h1:xahHemSiT79xgh8Ig8zOTeHSLHt9FfPzViK7rATWhUM= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E= +github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240722033504-50f1fa0c49d1 h1:zqTYZqMKnv15UkKwCEbGqshZ6tWczctBYP53FxmEiF8= +github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240722033504-50f1fa0c49d1/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 h1:ZlezTiQu9pYpVO+6sB9+W3fvthIpV1GgSI8kPjw+v5s= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= +github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 h1:r0ALP31Wnw19FqEmqzsK2SFNqdMetHshnM/X/FeJRIo= +github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f h1:/27Pg87DNRG0xzctT8XcEANKF0OksPgFJtcQSRs5O0E= github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM= diff --git a/gomod2nix.toml b/gomod2nix.toml index ef10137eb4..459b0fc2b1 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -20,7 +20,7 @@ schema = 3 version = "v0.7.5" hash = "sha256-Nuw697sJr56kU3EU7DV1eYNkyI76psznIVqYAV6RfbQ=" [mod."cosmossdk.io/client/v2"] - version = "v2.0.0-20240626040048-36295f051595" + version = "v2.0.0-20240722033504-50f1fa0c49d1" hash = "sha256-60hmufv3Ml4Pv3zNwgn8eeqlEINOR6n9MKr2QHddoxo=" replaced = "github.com/crypto-org-chain/cosmos-sdk/client/v2" [mod."cosmossdk.io/collections"] @@ -45,8 +45,8 @@ schema = 3 version = "v0.0.0-20230608160436-666c345ad23d" hash = "sha256-6BMBA98BpK3jG6++ZE4LdPQwwpS+lZ0GLMRF1fO4UfM=" [mod."cosmossdk.io/store"] - version = "v0.0.0-20240626040048-36295f051595" - hash = "sha256-zne7cIFs9WLg11pIr9VLBBc+G+kZfKLn8UU1mP4w6BM=" + version = "v0.0.0-20240722033504-50f1fa0c49d1" + hash = "sha256-Dm3sSZNJBcnBF33PULoTpK4rkNQbsZl0DfTqH1GPCQM=" replaced = "github.com/crypto-org-chain/cosmos-sdk/store" [mod."cosmossdk.io/tools/confix"] version = "v0.1.1" @@ -58,7 +58,7 @@ schema = 3 version = "v0.1.0" hash = "sha256-/gWvrqvy6bW90+NU66T+9QysYgvG1VbwfYJZ8tkqpeA=" [mod."cosmossdk.io/x/tx"] - version = "v0.0.0-20240626040048-36295f051595" + version = "v0.0.0-20240722033504-50f1fa0c49d1" hash = "sha256-xT5IdapEx1h46ofBpxcBQfzGF2EntmC8xZl7aym/6xE=" replaced = "github.com/crypto-org-chain/cosmos-sdk/x/tx" [mod."cosmossdk.io/x/upgrade"] @@ -170,8 +170,8 @@ schema = 3 version = "v1.0.0-beta.5" hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.50.6-0.20240716063309-c47504d189d4" - hash = "sha256-ukD0WZAMJ9hdwzBXzc6a60VOopZ6u+pdf67iq/1Tfa4=" + version = "v0.50.6-0.20240722033504-50f1fa0c49d1" + hash = "sha256-OjJgi6tq5c4czeQLZVeJRBo4s4kC37h4IFT/GGvF7G0=" replaced = "github.com/crypto-org-chain/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index d2b2e5e86a..57912c53f4 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -29,7 +29,7 @@ func NewStore( if closer == nil { closer = NoopCloser } - store := cachemulti.NewStore(stores, traceWriter, traceContext) + store := cachemulti.NewStore(nil, stores, nil, traceWriter, traceContext) return Store{ Store: store, Closer: closer, diff --git a/store/go.mod b/store/go.mod index 07dd53c07a..dda694959a 100644 --- a/store/go.mod +++ b/store/go.mod @@ -163,9 +163,9 @@ require ( // release/v0.50.x replace ( - cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 - cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4 - github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 + cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 + cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 + github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 ) replace github.com/crypto-org-chain/cronos/memiavl => ../memiavl diff --git a/store/go.sum b/store/go.sum index 907f8873f2..b705d2dd4c 100644 --- a/store/go.sum +++ b/store/go.sum @@ -144,12 +144,12 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 h1:tU2H8foSm+CVtU9HPEephknr3C6mTrVeSERwRUs6yFY= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:bIUzWfqXnCF2WTFb2uN+FjzMIG3BsOk+P2QmvMtm4ic= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 h1:aW5FkDdXGz+Nl9W5bkTTxkleEo3CNGLl78nU5CxikhQ= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= -github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4 h1:0SAVpeeKAJQLX+5aygBW57EIyVNtvYXXWs9zDusblKk= -github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 h1:xahHemSiT79xgh8Ig8zOTeHSLHt9FfPzViK7rATWhUM= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 h1:ZlezTiQu9pYpVO+6sB9+W3fvthIpV1GgSI8kPjw+v5s= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= +github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 h1:r0ALP31Wnw19FqEmqzsK2SFNqdMetHshnM/X/FeJRIo= +github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/store/rootmulti/objstore.go b/store/rootmulti/objstore.go new file mode 100644 index 0000000000..074b66239c --- /dev/null +++ b/store/rootmulti/objstore.go @@ -0,0 +1,33 @@ +//go:build objstore +// +build objstore + +package rootmulti + +import ( + "fmt" + + "cosmossdk.io/store/transient" + "cosmossdk.io/store/types" + "github.com/crypto-org-chain/cronos/memiavl" +) + +// Implements interface MultiStore +func (rs *Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { + s, ok := rs.stores[key].(types.ObjKVStore) + if !ok { + panic(fmt.Sprintf("store with key %v is not ObjKVStore", key)) + } + return s +} + +func (rs *Store) loadExtraStore(db *memiavl.DB, key types.StoreKey, params storeParams) (types.CommitStore, error) { + if params.typ == types.StoreTypeObject { + if _, ok := key.(*types.ObjectStoreKey); !ok { + return nil, fmt.Errorf("unexpected key type for a ObjectStoreKey; got: %s, %T", key.String(), key) + } + + return transient.NewObjStore(), nil + } + + panic(fmt.Sprintf("unrecognized store type %v", params.typ)) +} diff --git a/store/rootmulti/objstore_placeholder.go b/store/rootmulti/objstore_placeholder.go new file mode 100644 index 0000000000..ce3d57cf5b --- /dev/null +++ b/store/rootmulti/objstore_placeholder.go @@ -0,0 +1,15 @@ +//go:build !objstore +// +build !objstore + +package rootmulti + +import ( + "fmt" + + "cosmossdk.io/store/types" + "github.com/crypto-org-chain/cronos/memiavl" +) + +func (rs *Store) loadExtraStore(db *memiavl.DB, key types.StoreKey, params storeParams) (types.CommitStore, error) { + panic(fmt.Sprintf("unrecognized store type %v", params.typ)) +} diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 121412084a..205f2f4b17 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -246,15 +246,6 @@ func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore { return s } -// Implements interface MultiStore -func (rs *Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { - s, ok := rs.stores[key].(types.ObjKVStore) - if !ok { - panic(fmt.Sprintf("store with key %v is not ObjKVStore", key)) - } - return s -} - // Implements interface MultiStore func (rs *Store) TracingEnabled() bool { return false @@ -426,15 +417,8 @@ func (rs *Store) loadCommitStoreFromParams(db *memiavl.DB, key types.StoreKey, p return mem.NewStore(), nil - case types.StoreTypeObject: - if _, ok := key.(*types.ObjectStoreKey); !ok { - return nil, fmt.Errorf("unexpected key type for a ObjectStoreKey; got: %s, %T", key.String(), key) - } - - return transient.NewObjStore(), nil - default: - panic(fmt.Sprintf("unrecognized store type %v", params.typ)) + return rs.loadExtraStore(db, key, params) } } diff --git a/versiondb/go.mod b/versiondb/go.mod index 84bf7dc233..11b3c39674 100644 --- a/versiondb/go.mod +++ b/versiondb/go.mod @@ -168,8 +168,8 @@ require ( replace ( // release/v0.50.x - cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 + cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 // release/v0.50.x - github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 + github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 github.com/crypto-org-chain/cronos/memiavl => ../memiavl ) diff --git a/versiondb/go.sum b/versiondb/go.sum index 56dae74f11..be1310d81c 100644 --- a/versiondb/go.sum +++ b/versiondb/go.sum @@ -163,10 +163,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 h1:tU2H8foSm+CVtU9HPEephknr3C6mTrVeSERwRUs6yFY= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:bIUzWfqXnCF2WTFb2uN+FjzMIG3BsOk+P2QmvMtm4ic= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 h1:aW5FkDdXGz+Nl9W5bkTTxkleEo3CNGLl78nU5CxikhQ= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 h1:xahHemSiT79xgh8Ig8zOTeHSLHt9FfPzViK7rATWhUM= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 h1:ZlezTiQu9pYpVO+6sB9+W3fvthIpV1GgSI8kPjw+v5s= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/versiondb/multistore.go b/versiondb/multistore.go index 2b895a62bf..a88850d0d3 100644 --- a/versiondb/multistore.go +++ b/versiondb/multistore.go @@ -9,7 +9,7 @@ import ( "cosmossdk.io/store/types" ) -var _ types.RootMultiStore = (*MultiStore)(nil) +var _ types.MultiStore = (*MultiStore)(nil) // MultiStore wraps `VersionStore` to implement `MultiStore` interface. type MultiStore struct { @@ -64,7 +64,7 @@ func (s *MultiStore) cacheMultiStore(version *int64) types.CacheMultiStore { stores[k] = NewKVStore(s.versionDB, k, version) } } - return cachemulti.NewStore(stores, s.traceWriter, s.getTracingContext()) + return cachemulti.NewStore(nil, stores, nil, s.traceWriter, s.getTracingContext()) } // CacheMultiStore implements `MultiStore` interface @@ -99,11 +99,6 @@ func (s *MultiStore) GetKVStore(storeKey types.StoreKey) types.KVStore { return s.GetStore(storeKey).(types.KVStore) } -// GetObjKVStore implements `MultiStore` interface -func (s *MultiStore) GetObjKVStore(storeKey types.StoreKey) types.ObjKVStore { - return s.GetStore(storeKey).(types.ObjKVStore) -} - // SetTracer sets the tracer for the MultiStore that the underlying // stores will utilize to trace operations. A MultiStore is returned. func (s *MultiStore) SetTracer(w io.Writer) types.MultiStore { @@ -157,3 +152,8 @@ func (s *MultiStore) LatestVersion() int64 { func (s *MultiStore) Close() error { return s.versionDB.Flush() } + +// CacheWrapWithTrace is kept to build with upstream sdk. +func (s *MultiStore) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { + panic("not implemented") +} diff --git a/versiondb/objstore.go b/versiondb/objstore.go new file mode 100644 index 0000000000..0961a8f10d --- /dev/null +++ b/versiondb/objstore.go @@ -0,0 +1,11 @@ +//go:build objstore +// +build objstore + +package versiondb + +import "cosmossdk.io/store/types" + +// GetObjKVStore implements `MultiStore` interface +func (s *MultiStore) GetObjKVStore(storeKey types.StoreKey) types.ObjKVStore { + return s.GetStore(storeKey).(types.ObjKVStore) +} diff --git a/versiondb/store.go b/versiondb/store.go index e7bc2bbda4..866b027e4e 100644 --- a/versiondb/store.go +++ b/versiondb/store.go @@ -1,6 +1,7 @@ package versiondb import ( + "io" "time" "cosmossdk.io/store/cachekv" @@ -81,3 +82,7 @@ func (st *Store) Set(key, value []byte) { func (st *Store) Delete(key []byte) { panic("write operation is not supported") } + +func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { + panic("not implemented") +} From 901d841bc9fc0774bf37e7aa75e1b8cd2ade37a4 Mon Sep 17 00:00:00 2001 From: pudongair <744355276@qq.com> Date: Mon, 22 Jul 2024 16:04:04 +0900 Subject: [PATCH 10/19] chore: fix some comments (#1517) Signed-off-by: pudongair <744355276@qq.com> Co-authored-by: mmsqe --- docs/architecture/adr-007.md | 2 +- docs/gravity-bridge/dev-setup-guide.md | 2 +- integration_tests/test_basic.py | 4 ++-- integration_tests/test_replay_block.py | 2 +- memiavl/README.md | 2 +- memiavl/multitree.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/architecture/adr-007.md b/docs/architecture/adr-007.md index a2ca67025b..9747c77612 100644 --- a/docs/architecture/adr-007.md +++ b/docs/architecture/adr-007.md @@ -37,7 +37,7 @@ event __CronosSendToIbc(address indexed sender, uint256 indexed channelId, strin #### Description -- Event `__CronosSendToIbc` has differnt signature in CRC20 and CR21. +- Event `__CronosSendToIbc` has different signature in CRC20 and CR21. - The chain logic will distinguish between the two formats and behave accordingly. - Channel ID argument is added to support sending to specified IBC channel. - For token originated from Cronos, this channel ID could be any available IBC channel. diff --git a/docs/gravity-bridge/dev-setup-guide.md b/docs/gravity-bridge/dev-setup-guide.md index 95270f048c..5242cb4284 100644 --- a/docs/gravity-bridge/dev-setup-guide.md +++ b/docs/gravity-bridge/dev-setup-guide.md @@ -165,4 +165,4 @@ releases](https://github.com/PeggyJV/gravity-bridge/releases). --ethereum-key="orch_eth" ``` -After all the orchestrator processes run, the gravity bridge between ethereum and cronos is setup succesfully. +After all the orchestrator processes run, the gravity bridge between ethereum and cronos is setup successfully. diff --git a/integration_tests/test_basic.py b/integration_tests/test_basic.py index 52d4d5593c..258e555bbc 100644 --- a/integration_tests/test_basic.py +++ b/integration_tests/test_basic.py @@ -283,7 +283,7 @@ def test_statesync(cronos): == initial_balance + tx_value + tx_value ) - print("succesfully syncing") + print("successfully syncing") clustercli.supervisor.stopProcess(f"{clustercli.chain_id}-node{i}") @@ -572,7 +572,7 @@ def test_exception(cluster): receipt = send_transaction( w3, contract.functions.transfer(5 * (10**18)).build_transaction() ) - assert receipt.status == 1, "should be succesfully" + assert receipt.status == 1, "should be successfully" assert 5 * (10**18) == contract.caller.query() diff --git a/integration_tests/test_replay_block.py b/integration_tests/test_replay_block.py index 89791f94ac..a7a65eccc7 100644 --- a/integration_tests/test_replay_block.py +++ b/integration_tests/test_replay_block.py @@ -94,7 +94,7 @@ def test_block_overflow(custom_cronos): else: assert False, "timeout" - # the first tx succeds. + # the first tx succeeds. assert success.status == 1 assert success.gasUsed < gas_limits[success["from"]] assert success.cumulativeGasUsed == success.gasUsed diff --git a/memiavl/README.md b/memiavl/README.md index dd155722b6..3fcf03358a 100644 --- a/memiavl/README.md +++ b/memiavl/README.md @@ -118,7 +118,7 @@ IAVL snapshot is composed by four files: #### Compression -The items in snapshot reference with each other by file offsets, we can apply some block compression techniques to compress keys and values files while maintain random accessbility by uncompressed file offset, for example zstd's experimental seekable format[^1]. +The items in snapshot reference with each other by file offsets, we can apply some block compression techniques to compress keys and values files while maintain random accessibility by uncompressed file offset, for example zstd's experimental seekable format[^1]. ### VersionDB diff --git a/memiavl/multitree.go b/memiavl/multitree.go index f46388698e..866123b597 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -279,7 +279,7 @@ func (t *MultiTree) SaveVersion(updateCommitInfo bool) (int64, error) { if updateCommitInfo { t.UpdateCommitInfo() } else { - // clear the dirty informaton + // clear the dirty information t.lastCommitInfo.StoreInfos = []StoreInfo{} } From 983a5a626196fee6715134afe2707e97e9b74f88 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 24 Jul 2024 16:51:44 +0800 Subject: [PATCH 11/19] Problem: testground image don't have tmp directory (#1521) * Problem: testground image don't have tmp directory Solution: - create the directory inside the image, it's required by cronosd * fix image --- nix/testground-image.nix | 8 +++++++- testground/benchmark/compositions/docker-compose.jsonnet | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nix/testground-image.nix b/nix/testground-image.nix index 9058412f33..5644a3f78c 100644 --- a/nix/testground-image.nix +++ b/nix/testground-image.nix @@ -1,4 +1,4 @@ -{ dockerTools, cronos-matrix, testground-testcase }: +{ dockerTools, runCommandLocal, cronos-matrix, testground-testcase }: let patched-cronosd = cronos-matrix.cronosd.overrideAttrs (oldAttrs: { patches = oldAttrs.patches or [ ] ++ [ @@ -6,12 +6,18 @@ let ]; }); in +let + tmpDir = runCommandLocal "tmp" { } '' + mkdir -p $out/tmp/ + ''; +in dockerTools.buildLayeredImage { name = "cronos-testground"; created = "now"; contents = [ testground-testcase patched-cronosd + tmpDir ]; config = { Expose = [ 9090 26657 26656 1317 26658 26660 26659 30000 ]; diff --git a/testground/benchmark/compositions/docker-compose.jsonnet b/testground/benchmark/compositions/docker-compose.jsonnet index bec5e017f7..e3879941d8 100644 --- a/testground/benchmark/compositions/docker-compose.jsonnet +++ b/testground/benchmark/compositions/docker-compose.jsonnet @@ -6,7 +6,6 @@ std.manifestYamlDoc({ container_name: 'testplan-' + i, volumes: [ @'${DATADIR:-/tmp/data/out}:/data', - '/tmp:/tmp', ], environment: { JOB_COMPLETION_INDEX: i, From 19724372eeea9d8c15e34dfbaf1cd654222d94bf Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 24 Jul 2024 21:37:01 +0800 Subject: [PATCH 12/19] Problem: testground test case requires persistent volume (#1522) * Problem: testground test case requires persistent volume Solution: - persistent volume is a headache in k8s cluster, but we can embed the data directory into image to avoid that. * cleanup * lint * nix develop -c black . --------- Co-authored-by: mmsqe --- testground/README.md | 12 ++++- testground/benchmark/benchmark/stateless.py | 44 +++++++++++++++---- .../compositions/docker-compose.jsonnet | 5 +-- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/testground/README.md b/testground/README.md index 8d03f11b76..80c3a325f2 100644 --- a/testground/README.md +++ b/testground/README.md @@ -75,14 +75,22 @@ mounts: To simplify cluster setup, we are introducing a stateless mode. -## Generate Data Files Locally +## Generate data files locally -You need to have a `cronosd` in `PATH`. +You need to have the `cronosd` in `PATH`. ```bash $ nix run github:crypto-org-chain/cronos#stateless-testcase gen /tmp/data/out 3 7 ``` +## Embed the data directory + +Patch the image to embed the data directory, it produce a local image: + +```bash +$ nix run github:crypto-org-chain/cronos#stateless-testcase patchimage cronos-testground:latest /tmp/data/out +``` + ## Run In Local Docker ```bash diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 6a93fa95d8..7e935cf812 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -1,7 +1,9 @@ import json import os +import shutil import socket import subprocess +import tempfile from pathlib import Path from typing import List @@ -26,11 +28,17 @@ DEFAULT_CHAIN_ID = "cronos_777-1" DEFAULT_DENOM = "basecro" # the container must be deployed with the prefixed name -CONTAINER_PREFIX = "testplan-" +HOSTNAME_TEMPLATE = "testplan-{index}" class CLI: - def gen(self, outdir: str, validators: int, fullnodes: int): + def gen( + self, + outdir: str, + validators: int, + fullnodes: int, + hostname_template=HOSTNAME_TEMPLATE, + ): outdir = Path(outdir) cli = ChainCommand(LOCAL_CRONOSD_PATH) (outdir / VALIDATOR_GROUP).mkdir(parents=True, exist_ok=True) @@ -39,12 +47,12 @@ def gen(self, outdir: str, validators: int, fullnodes: int): peers = [] for i in range(validators): print("init validator", i) - peers.append(init_node_local(cli, outdir, VALIDATOR_GROUP, i, i)) + ip = hostname_template.format(index=i) + peers.append(init_node_local(cli, outdir, VALIDATOR_GROUP, i, ip)) for i in range(fullnodes): print("init fullnode", i) - peers.append( - init_node_local(cli, outdir, FULLNODE_GROUP, i, i + validators) - ) + ip = hostname_template.format(index=i + validators) + peers.append(init_node_local(cli, outdir, FULLNODE_GROUP, i, ip)) print("prepare genesis") # use a full node directory to prepare the genesis file @@ -59,6 +67,26 @@ def gen(self, outdir: str, validators: int, fullnodes: int): peers, genesis, outdir, FULLNODE_GROUP, i, i + validators ) + def patchimage( + self, + toimage, + src, + dst="/data", + fromimage="ghcr.io/crypto-org-chain/cronos-testground:latest", + ): + """ + combine data directory with an exiting image to produce a new image + """ + with tempfile.TemporaryDirectory() as tmpdir: + tmpdir = Path(tmpdir) + shutil.copytree(src, tmpdir / "out") + content = f"""FROM {fromimage} +ADD ./out {dst} +""" + print(content) + (tmpdir / "Dockerfile").write_text(content) + subprocess.run(["docker", "build", "-t", toimage, tmpdir]) + def run( self, outdir: str, @@ -100,12 +128,12 @@ def run( def init_node_local( - cli: ChainCommand, outdir: Path, group: str, group_seq: int, global_seq: int + cli: ChainCommand, outdir: Path, group: str, group_seq: int, ip: str ) -> PeerPacket: return init_node( cli, outdir / group / str(group_seq), - CONTAINER_PREFIX + str(global_seq), + ip, DEFAULT_CHAIN_ID, group, group_seq, diff --git a/testground/benchmark/compositions/docker-compose.jsonnet b/testground/benchmark/compositions/docker-compose.jsonnet index e3879941d8..c9e83c9d85 100644 --- a/testground/benchmark/compositions/docker-compose.jsonnet +++ b/testground/benchmark/compositions/docker-compose.jsonnet @@ -1,12 +1,9 @@ std.manifestYamlDoc({ services: { ['testplan-' + i]: { - image: 'ghcr.io/crypto-org-chain/cronos-testground:latest', + image: 'cronos-testground:latest', command: 'stateless-testcase run /data 3 --num_accounts=10 --num_txs=1000', container_name: 'testplan-' + i, - volumes: [ - @'${DATADIR:-/tmp/data/out}:/data', - ], environment: { JOB_COMPLETION_INDEX: i, }, From d545b24c2dec0cc339c20987f4955e13b5cdb63d Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 24 Jul 2024 23:19:45 +0800 Subject: [PATCH 13/19] Problem: invalid chain id for signer (#1520) * Problem: invalid chain id for signer https://github.com/crypto-org-chain/cronos/actions/runs/10051584712/job/27781409154 * fix build * update deps --- CHANGELOG.md | 4 ++++ app/app.go | 1 + go.mod | 3 +-- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- integration_tests/poetry.lock | 3 +-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 763772f352..dd8cfc8382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ * (store) [#1511](https://github.com/crypto-org-chain/cronos/pull/1511) Upgrade rocksdb to `v9.2.1`. * (block-stm) [#1515](https://github.com/crypto-org-chain/cronos/pull/1515) Improve performance by cache signature verification result between incarnations of same tx. +### Bug Fixes + +* [#1520](https://github.com/crypto-org-chain/cronos/pull/1520) Avoid invalid chain id for signer error when rpc call before chain id set in BeginBlock. + *Jun 18, 2024* ## v1.3.0-rc2 diff --git a/app/app.go b/app/app.go index 32d7f409b8..f4031a3cbb 100644 --- a/app/app.go +++ b/app/app.go @@ -1225,6 +1225,7 @@ func (app *App) SimulationManager() *module.SimulationManager { // API server. func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx + app.EvmKeeper.WithChainIDString(clientCtx.ChainID) // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. diff --git a/go.mod b/go.mod index f2a50561b6..efe64306ff 100644 --- a/go.mod +++ b/go.mod @@ -276,8 +276,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 // block-stm branch - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f - + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240724133625-f3e62cb25070 // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 diff --git a/go.sum b/go.sum index d1868a3e79..dc466784bd 100644 --- a/go.sum +++ b/go.sum @@ -430,8 +430,8 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 h1:r0ALP31Wnw19FqEmqzsK2SFNqdMetHshnM/X/FeJRIo= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f h1:/27Pg87DNRG0xzctT8XcEANKF0OksPgFJtcQSRs5O0E= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240724133625-f3e62cb25070 h1:BNjkJlyOAvr7Crd2kb2M/j3syKi4AjdiWN93M6iQaCA= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240724133625-f3e62cb25070/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 h1:V43F3JFcqG4MUThf9W/DytnPblpR6CcaLBw2Wx6zTgE= diff --git a/gomod2nix.toml b/gomod2nix.toml index 459b0fc2b1..de6c886080 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -262,8 +262,8 @@ schema = 3 hash = "sha256-lE4G5FaRb3MVi9FFVn+WlwsSTOB4SbjmVboKyQ5yB0A=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20240715061533-9c959a26e04f" - hash = "sha256-REZAPHulyi4veAg3ij721eSrF7yjopGkc6NPfTMaow8=" + version = "v0.6.1-0.20240724133625-f3e62cb25070" + hash = "sha256-XL7h6tMMIP3dWKO33UydnMlHZRotfbj1mQGonIEzHe0=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/fatih/color"] version = "v1.16.0" diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index 536fa9097a..b42209e692 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -1514,7 +1514,6 @@ python-dateutil = "^2.8" python-dotenv = "^1.0" pyyaml = "^6.0" pyyaml-include = "^1.3" -rpds-py = "^0.17.0" supervisor = "^4.2" tomlkit = "^0" @@ -1522,7 +1521,7 @@ tomlkit = "^0" type = "git" url = "https://github.com/crypto-com/pystarport.git" reference = "main" -resolved_reference = "4704c4a27b159eaa4d434ef44b9bf1046e81da1b" +resolved_reference = "ef603d05ccd6fd66459c9879d5c1be21d2665844" [[package]] name = "pytest" From 59c8b732e0c81bba40c5b4917eb26d28fbd3f63e Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 25 Jul 2024 15:38:51 +0800 Subject: [PATCH 14/19] Problem: testground stateless benchmark don't collect outputs (#1524) * Problem: testground stateless benchmark don't collect outputs Solution: - tar the home directory into outputs volume * fix readme * fix readme * Update testground/benchmark/benchmark/stateless.py Signed-off-by: yihuang * fix * log balance change after test --------- Signed-off-by: yihuang --- testground/README.md | 17 ++++++-- testground/benchmark/benchmark/sendtx.py | 8 +++- testground/benchmark/benchmark/stateless.py | 39 +++++++++++++++---- .../compositions/docker-compose.jsonnet | 5 ++- 4 files changed, 56 insertions(+), 13 deletions(-) diff --git a/testground/README.md b/testground/README.md index 80c3a325f2..544c2f4825 100644 --- a/testground/README.md +++ b/testground/README.md @@ -80,12 +80,22 @@ To simplify cluster setup, we are introducing a stateless mode. You need to have the `cronosd` in `PATH`. ```bash -$ nix run github:crypto-org-chain/cronos#stateless-testcase gen /tmp/data/out 3 7 +$ 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 ``` +* `validators`/`fullnodes` is the number of validators/full nodes. +* `hostname_template` is the hostname of each node that can communicate. +* `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. + ## Embed the data directory -Patch the image to embed the data directory, it produce a local image: +Embed the data directory into the image, it produce a new image: ```bash $ nix run github:crypto-org-chain/cronos#stateless-testcase patchimage cronos-testground:latest /tmp/data/out @@ -94,10 +104,11 @@ $ nix run github:crypto-org-chain/cronos#stateless-testcase patchimage cronos-te ## Run In Local Docker ```bash +$ mkdir /tmp/outputs $ jsonnet -S testground/benchmark/compositions/docker-compose.jsonnet | docker-compose -f /dev/stdin up ``` -It'll mount the data files to all the containers. +It'll collect the node data files to the `/tmp/outputs` directory. ## Run In Cluster diff --git a/testground/benchmark/benchmark/sendtx.py b/testground/benchmark/benchmark/sendtx.py index c0752bc34c..c700d302c5 100644 --- a/testground/benchmark/benchmark/sendtx.py +++ b/testground/benchmark/benchmark/sendtx.py @@ -28,7 +28,9 @@ def fund_test_accounts(w3, from_account, num_accounts) -> [Account]: def sendtx(w3: web3.Web3, acct: Account, tx_amount: int): - print("test address", acct.address, "balance", w3.eth.get_balance(acct.address)) + print( + "test begin, address", acct.address, "balance", w3.eth.get_balance(acct.address) + ) initial_nonce = w3.eth.get_transaction_count(acct.address) nonce = initial_nonce @@ -56,6 +58,10 @@ def sendtx(w3: web3.Web3, acct: Account, tx_amount: int): if nonce % 100 == 0: print(f"{acct.address} sent {nonce} transactions") + print( + "test end, address", acct.address, "balance", w3.eth.get_balance(acct.address) + ) + def generate_load(cli, num_accounts, num_txs, **kwargs): w3 = web3.Web3(web3.providers.HTTPProvider("http://localhost:8545")) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 7e935cf812..eaee7fd405 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -3,6 +3,7 @@ import shutil import socket import subprocess +import tarfile import tempfile from pathlib import Path from typing import List @@ -38,6 +39,8 @@ def gen( validators: int, fullnodes: int, hostname_template=HOSTNAME_TEMPLATE, + num_accounts=10, + num_txs=1000, ): outdir = Path(outdir) cli = ChainCommand(LOCAL_CRONOSD_PATH) @@ -67,6 +70,15 @@ def gen( peers, genesis, outdir, FULLNODE_GROUP, i, i + validators ) + print("write config") + cfg = { + "validators": validators, + "fullnodes": fullnodes, + "num_accounts": num_accounts, + "num_txs": num_txs, + } + (outdir / "config.json").write_text(json.dumps(cfg)) + def patchimage( self, toimage, @@ -89,21 +101,24 @@ def patchimage( def run( self, - outdir: str, - validators: int, + outdir: str = "/outputs", + datadir: str = "/data", cronosd=CONTAINER_CRONOSD_PATH, global_seq=None, - num_accounts=10, - num_txs=1000, ): - outdir = Path(outdir) + datadir = Path(datadir) + + cfg = json.loads((datadir / "config.json").read_text()) + if global_seq is None: global_seq = node_index() + + validators = cfg["validators"] group = VALIDATOR_GROUP if global_seq < validators else FULLNODE_GROUP group_seq = global_seq if group == VALIDATOR_GROUP else global_seq - validators print("node role", global_seq, group, group_seq) - home = outdir / group / str(group_seq) + home = datadir / group / str(group_seq) # start the node logfile = home / "node.log" @@ -122,9 +137,17 @@ def run( # validators don't quit proc.wait() else: - generate_load(cli, num_accounts, num_txs, home=home) - + generate_load(cli, cfg["num_accounts"], cfg["num_txs"], home=home) proc.kill() + proc.wait() + + # collect outputs + outdir = Path(outdir) + if outdir.exists(): + with tarfile.open( + outdir / f"{group}_{group_seq}.tar.bz2", "x:bz2" + ) as tar: + tar.add(home, arcname="data") def init_node_local( diff --git a/testground/benchmark/compositions/docker-compose.jsonnet b/testground/benchmark/compositions/docker-compose.jsonnet index c9e83c9d85..7589d67497 100644 --- a/testground/benchmark/compositions/docker-compose.jsonnet +++ b/testground/benchmark/compositions/docker-compose.jsonnet @@ -2,8 +2,11 @@ std.manifestYamlDoc({ services: { ['testplan-' + i]: { image: 'cronos-testground:latest', - command: 'stateless-testcase run /data 3 --num_accounts=10 --num_txs=1000', + command: 'stateless-testcase run', container_name: 'testplan-' + i, + volumes: [ + @'${OUTDIR:-/tmp/outputs}:/outputs', + ], environment: { JOB_COMPLETION_INDEX: i, }, From ce52c517fb733fd3d2628e01098266e61c27c941 Mon Sep 17 00:00:00 2001 From: fivecut Date: Thu, 25 Jul 2024 17:09:33 +0900 Subject: [PATCH 15/19] chore: remove repeat words (#1525) --- CODE_OF_CONDUCT.md | 2 +- x/cronos/spec/06_events.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index eacf32113a..15546f76db 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -48,4 +48,4 @@ And if someone takes issue with something you said or did, resist the urge to be The enforcement policies listed above apply to all official Cronos venues. For other projects adopting the Cronos Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. -* Adapted from the the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html), the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/). +* Adapted from the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html), the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/). diff --git a/x/cronos/spec/06_events.md b/x/cronos/spec/06_events.md index 75ba19fb57..b460ce1cbc 100644 --- a/x/cronos/spec/06_events.md +++ b/x/cronos/spec/06_events.md @@ -6,7 +6,7 @@ order: 6 The Cronos module emits the Cosmos SDK [events](./../../../docs/quickstart/events.md#sdk-and-tendermint-events) after a state execution. It can be expected that the type `message`, with an attribute key of `action` will represent the first event for each message being processed as emitted -by the Cosmos SDK's `Baseapp` (i.e the the basic application that implements Tendermint Core's ABCI +by the Cosmos SDK's `Baseapp` (i.e the basic application that implements Tendermint Core's ABCI interface). ## MsgConvertVouchers From f6d6cf8a4e78ee97fd85edc678627811bad0071a Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 26 Jul 2024 12:54:19 +0800 Subject: [PATCH 16/19] Problem: memory leak in archive node (#1526) * Problem: memory leak in archive node - Suspect large `application.db` - try cache index/filters * Update CHANGELOG.md Signed-off-by: yihuang --------- Signed-off-by: yihuang --- CHANGELOG.md | 1 + cmd/cronosd/opendb/opendb_rocksdb.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd8cfc8382..98a2837a72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ * [#1500](https://github.com/crypto-org-chain/cronos/pull/1500), [#1503](https://github.com/crypto-org-chain/cronos/pull/1503) Set mempool MaxTx from config (with a default value of `3000`). * (store) [#1511](https://github.com/crypto-org-chain/cronos/pull/1511) Upgrade rocksdb to `v9.2.1`. * (block-stm) [#1515](https://github.com/crypto-org-chain/cronos/pull/1515) Improve performance by cache signature verification result between incarnations of same tx. +* (store) [#1526](https://github.com/crypto-org-chain/cronos/pull/1526) Cache index/filters in rocksdb application.db to reduce ram usage. ### Bug Fixes diff --git a/cmd/cronosd/opendb/opendb_rocksdb.go b/cmd/cronosd/opendb/opendb_rocksdb.go index 12220c068f..1fdf01bd20 100644 --- a/cmd/cronosd/opendb/opendb_rocksdb.go +++ b/cmd/cronosd/opendb/opendb_rocksdb.go @@ -110,6 +110,10 @@ func NewRocksdbOptions(opts *grocksdb.Options, sstFileWriter bool) *grocksdb.Opt bbto.SetPartitionFilters(true) bbto.SetOptimizeFiltersForMemory(true) + // reduce memory usage + bbto.SetCacheIndexAndFilterBlocks(true) + bbto.SetPinTopLevelIndexAndFilter(true) + // hash index is better for iavl tree which mostly do point lookup. bbto.SetDataBlockIndexType(grocksdb.KDataBlockIndexTypeBinarySearchAndHash) From 71a8c342b8bcbbf0619259c591eccda145089b9b Mon Sep 17 00:00:00 2001 From: mmsqe Date: Fri, 26 Jul 2024 16:22:04 +0800 Subject: [PATCH 17/19] Problem: pinL0FilterAndIndexBlocksInCache is not enabled (#1529) * Problem: pinL0FilterAndIndexBlocksInCache is not enabled * more space --- .github/workflows/test.yml | 2 ++ CHANGELOG.md | 1 + cmd/cronosd/opendb/opendb_rocksdb.go | 1 + 3 files changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5fc931c6d..4984fe92e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,8 @@ jobs: env: TESTS_TO_RUN: ${{ matrix.tests }} steps: + - name: Create more disk space + run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 98a2837a72..90ecd675e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ * (store) [#1511](https://github.com/crypto-org-chain/cronos/pull/1511) Upgrade rocksdb to `v9.2.1`. * (block-stm) [#1515](https://github.com/crypto-org-chain/cronos/pull/1515) Improve performance by cache signature verification result between incarnations of same tx. * (store) [#1526](https://github.com/crypto-org-chain/cronos/pull/1526) Cache index/filters in rocksdb application.db to reduce ram usage. +* (store)[#1529](https://github.com/crypto-org-chain/cronos/pull/1529) Enable pinL0FilterAndIndexBlocksInCache. ### Bug Fixes diff --git a/cmd/cronosd/opendb/opendb_rocksdb.go b/cmd/cronosd/opendb/opendb_rocksdb.go index 1fdf01bd20..31534859ad 100644 --- a/cmd/cronosd/opendb/opendb_rocksdb.go +++ b/cmd/cronosd/opendb/opendb_rocksdb.go @@ -113,6 +113,7 @@ func NewRocksdbOptions(opts *grocksdb.Options, sstFileWriter bool) *grocksdb.Opt // reduce memory usage bbto.SetCacheIndexAndFilterBlocks(true) bbto.SetPinTopLevelIndexAndFilter(true) + bbto.SetPinL0FilterAndIndexBlocksInCache(true) // hash index is better for iavl tree which mostly do point lookup. bbto.SetDataBlockIndexType(grocksdb.KDataBlockIndexTypeBinarySearchAndHash) From aedfd558f2167a01b2350e2d36d36fd7559c1ca5 Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 26 Jul 2024 17:53:53 +0800 Subject: [PATCH 18/19] Problem: block cache size not count in index/filters (#1531) Solution: - increase block cache size --- cmd/cronosd/opendb/opendb_rocksdb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/cronosd/opendb/opendb_rocksdb.go b/cmd/cronosd/opendb/opendb_rocksdb.go index 31534859ad..9925bbe5f3 100644 --- a/cmd/cronosd/opendb/opendb_rocksdb.go +++ b/cmd/cronosd/opendb/opendb_rocksdb.go @@ -13,7 +13,8 @@ import ( "github.com/linxGnu/grocksdb" ) -const BlockCacheSize = 1 << 30 +// 3G block cache +const BlockCacheSize = 3 << 30 func OpenDB(_ types.AppOptions, home string, backendType dbm.BackendType) (dbm.DB, error) { dataDir := filepath.Join(home, "data") @@ -98,7 +99,6 @@ func NewRocksdbOptions(opts *grocksdb.Options, sstFileWriter bool) *grocksdb.Opt // block based table options bbto := grocksdb.NewDefaultBlockBasedTableOptions() - // 1G block cache bbto.SetBlockCache(grocksdb.NewLRUCache(BlockCacheSize)) // http://rocksdb.org/blog/2021/12/29/ribbon-filter.html From 8a8550d3bfc0ae12879ef1f80e2e97324b4be22b Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 29 Jul 2024 16:01:13 +0800 Subject: [PATCH 19/19] Problem: testground stateless test validator don't quit automatically (#1533) * Problem: testground stateless test validator don't quit automatically Solution: - validator quit when detected the chain is in idle * improve log * more stable benchmark --- go.mod | 2 +- go.sum | 4 +- gomod2nix.toml | 4 +- testground/benchmark/benchmark/sendtx.py | 16 ++++- testground/benchmark/benchmark/stateless.py | 65 ++++++++++++++++----- testground/benchmark/benchmark/utils.py | 15 +++++ testground/benchmark/poetry.lock | 4 +- testground/benchmark/pyproject.toml | 1 + 8 files changed, 86 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index efe64306ff..992964d45f 100644 --- a/go.mod +++ b/go.mod @@ -276,7 +276,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 // block-stm branch - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240724133625-f3e62cb25070 + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240729070824-350955227f14 // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 diff --git a/go.sum b/go.sum index dc466784bd..bae445af90 100644 --- a/go.sum +++ b/go.sum @@ -430,8 +430,8 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 h1:r0ALP31Wnw19FqEmqzsK2SFNqdMetHshnM/X/FeJRIo= github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240724133625-f3e62cb25070 h1:BNjkJlyOAvr7Crd2kb2M/j3syKi4AjdiWN93M6iQaCA= -github.com/crypto-org-chain/ethermint v0.6.1-0.20240724133625-f3e62cb25070/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240729070824-350955227f14 h1:ZVIlVCtx5X6sckKyMhc8nPBjXvr+/CzmXYqh7e/287I= +github.com/crypto-org-chain/ethermint v0.6.1-0.20240729070824-350955227f14/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM= github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 h1:V43F3JFcqG4MUThf9W/DytnPblpR6CcaLBw2Wx6zTgE= diff --git a/gomod2nix.toml b/gomod2nix.toml index de6c886080..04baa99436 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -262,8 +262,8 @@ schema = 3 hash = "sha256-lE4G5FaRb3MVi9FFVn+WlwsSTOB4SbjmVboKyQ5yB0A=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20240724133625-f3e62cb25070" - hash = "sha256-XL7h6tMMIP3dWKO33UydnMlHZRotfbj1mQGonIEzHe0=" + version = "v0.6.1-0.20240729070824-350955227f14" + hash = "sha256-aZ9Kq7PujK4alMXp1kk7LF7PTap8UdJbt+gK2ljvwyw=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/fatih/color"] version = "v1.16.0" diff --git a/testground/benchmark/benchmark/sendtx.py b/testground/benchmark/benchmark/sendtx.py index c700d302c5..8dd74fc565 100644 --- a/testground/benchmark/benchmark/sendtx.py +++ b/testground/benchmark/benchmark/sendtx.py @@ -28,11 +28,16 @@ def fund_test_accounts(w3, from_account, num_accounts) -> [Account]: def sendtx(w3: web3.Web3, acct: Account, tx_amount: int): + initial_nonce = w3.eth.get_transaction_count(acct.address) print( - "test begin, address", acct.address, "balance", w3.eth.get_balance(acct.address) + "test begin, address:", + acct.address, + "balance:", + w3.eth.get_balance(acct.address), + "nonce:", + initial_nonce, ) - initial_nonce = w3.eth.get_transaction_count(acct.address) nonce = initial_nonce while nonce < initial_nonce + tx_amount: tx = { @@ -59,7 +64,12 @@ def sendtx(w3: web3.Web3, acct: Account, tx_amount: int): print(f"{acct.address} sent {nonce} transactions") print( - "test end, address", acct.address, "balance", w3.eth.get_balance(acct.address) + "test end, address:", + acct.address, + "balance:", + w3.eth.get_balance(acct.address), + "nonce:", + w3.eth.get_transaction_count(acct.address), ) diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index eaee7fd405..740c93f002 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -5,10 +5,12 @@ import subprocess import tarfile import tempfile +import time from pathlib import Path from typing import List import fire +import requests from .cli import ChainCommand from .peer import ( @@ -22,7 +24,7 @@ from .sendtx import generate_load from .topology import connect_all from .types import PeerPacket -from .utils import wait_for_block, wait_for_port +from .utils import wait_for_block, wait_for_port, wait_for_w3 # use cronosd on host machine LOCAL_CRONOSD_PATH = "cronosd" @@ -30,6 +32,7 @@ DEFAULT_DENOM = "basecro" # the container must be deployed with the prefixed name HOSTNAME_TEMPLATE = "testplan-{index}" +LOCAL_RPC = "http://localhost:26657" class CLI: @@ -130,24 +133,56 @@ def run( cli = ChainCommand(cronosd) wait_for_port(26657) wait_for_port(8545) - wait_for_port(9090) - wait_for_block(cli, 1) + wait_for_block(cli, 3) if group == VALIDATOR_GROUP: - # validators don't quit - proc.wait() + # validators quit when the chain is idle for a while + detect_idle(20, 20) else: + wait_for_w3() generate_load(cli, cfg["num_accounts"], cfg["num_txs"], home=home) - proc.kill() - proc.wait() - - # collect outputs - outdir = Path(outdir) - if outdir.exists(): - with tarfile.open( - outdir / f"{group}_{group_seq}.tar.bz2", "x:bz2" - ) as tar: - tar.add(home, arcname="data") + + proc.kill() + proc.wait() + + # collect outputs + outdir = Path(outdir) + if outdir.exists(): + filename = outdir / f"{group}_{group_seq}.tar.bz2" + filename.unlink(missing_ok=True) + with tarfile.open(filename, "x:bz2") as tar: + tar.add(home, arcname="data") + + +def detect_idle(idle_blocks: int, interval: int): + """ + returns if the chain is empty for consecutive idle_blocks + """ + while True: + latest = block_height() + for i in range(idle_blocks): + height = latest - i + if height <= 0: + break + if len(block_txs(height)) > 0: + break + else: + # normal quit means idle + return + + # break early means not idle + time.sleep(interval) + continue + + +def block_height(): + rsp = requests.get(f"{LOCAL_RPC}/status").json() + return int(rsp["result"]["sync_info"]["latest_block_height"]) + + +def block_txs(height): + rsp = requests.get(f"{LOCAL_RPC}/block?height={height}").json() + return rsp["result"]["block"]["data"]["txs"] def init_node_local( diff --git a/testground/benchmark/benchmark/utils.py b/testground/benchmark/benchmark/utils.py index 45782a05d3..1e9392eca3 100644 --- a/testground/benchmark/benchmark/utils.py +++ b/testground/benchmark/benchmark/utils.py @@ -5,6 +5,7 @@ import bech32 import tomlkit +import web3 from eth_account import Account from hexbytes import HexBytes from web3._utils.transactions import fill_nonce, fill_transaction_defaults @@ -68,6 +69,20 @@ def wait_for_block(cli, target: int, timeout=40): return height +def wait_for_w3(timeout=40): + for i in range(timeout): + try: + w3 = web3.Web3(web3.providers.HTTPProvider("http://localhost:8545")) + w3.eth.get_balance("0x0000000000000000000000000000000000000001") + except: # noqa + time.sleep(1) + continue + + break + else: + raise TimeoutError("Waited too long for web3 json-rpc to be ready.") + + def decode_bech32(addr): _, bz = bech32.bech32_decode(addr) return HexBytes(bytes(bech32.convertbits(bz, 5, 8))) diff --git a/testground/benchmark/poetry.lock b/testground/benchmark/poetry.lock index 5fc8c6fdcd..3261ad3ffe 100644 --- a/testground/benchmark/poetry.lock +++ b/testground/benchmark/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -2103,4 +2103,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "ca0ca576c7799b86fa2711528c66f3c4650442e36b503be95c72915668cd72bc" +content-hash = "671465e724b62315282a119e91a4594710b2270f36a6f578665220668c48a2d6" diff --git a/testground/benchmark/pyproject.toml b/testground/benchmark/pyproject.toml index c7b4b2d1c1..d0675a59d5 100644 --- a/testground/benchmark/pyproject.toml +++ b/testground/benchmark/pyproject.toml @@ -15,6 +15,7 @@ web3 = "^6" hexbytes = "^0" bech32 = "^1" fire = "^0" +requests = "^2.32" [tool.poetry.dev-dependencies] pytest = "^8.2"