Skip to content

Commit

Permalink
Problem: sdk v0.47.x is outdated (#1329)
Browse files Browse the repository at this point in the history
* Problem: different db are not tested when change client id

* test revert

* test db fix

* fix hash

* update deps

* rm patch

* Apply suggestions from code review
  • Loading branch information
mmsqe authored Feb 28, 2024
1 parent 76a35e8 commit 01d9dc6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 48 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## UNRELEASED

### Bug Fixes

- [#1329](https://github.com/crypto-org-chain/cronos/pull/1329) Update cosmos-sdk to `v0.47.10`.

*February 19, 2024*

## v1.1.0-rc4
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ replace (
// Use cosmos keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240220010730-59107173536d
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240228013111-9bd1e035ed1d
github.com/crypto-org-chain/cronos/memiavl => ./memiavl
github.com/crypto-org-chain/cronos/store => ./store
github.com/crypto-org-chain/cronos/versiondb => ./versiondb
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 h1:R1QJ9a3XdYMSKo+1RdFifxb/g3lNypC52L/rpYrWoKo=
github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63/go.mod h1:rocwIfnS+kA060x64gkSIRvWB9StSppIkJuo5MWzL24=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240220010730-59107173536d h1:f7HLmQWOUhBeR0ROlODBbNfyc+e6QImZClZCBf0A+1w=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240220010730-59107173536d/go.mod h1:cmAawe8FV/52oPKbgeHLt4UpNkrNu8R5KD+kw0kxJFc=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240228013111-9bd1e035ed1d h1:ihUBUAEwQYHZEqf7lXrJithNCUJTjB8q3oSQA6Nevco=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20240228013111-9bd1e035ed1d/go.mod h1:cmAawe8FV/52oPKbgeHLt4UpNkrNu8R5KD+kw0kxJFc=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240215080911-ebecd4c35025 h1:lc8T/ho1MtbKydKhUfF2DB74Me8+rQnD2n1FjUKLqMo=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240215080911-ebecd4c35025/go.mod h1:T3Tkhw8XMu8rYObcXpeTqGUaKogS+DKsGPD3ulHN/mg=
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231207063621-43cf32d91c3e h1:vnyepPQ/m25+19xcTuBUdRxmltZ/EjVWNqEjhg7Ummk=
Expand Down
4 changes: 2 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ schema = 3
version = "v1.0.0-beta.4"
hash = "sha256-5Kn82nsZfiEtuwhhLZqmMxdAY1tX/Fi3HJ0/MEaRohw="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.46.0-beta2.0.20240220010730-59107173536d"
hash = "sha256-OXWcFgNN+YwnW63S/Iw1fB9TKCiuMM1z+FthUo2yihc="
version = "v0.46.0-beta2.0.20240228013111-9bd1e035ed1d"
hash = "sha256-lvsMDhV9WTZ/MRFxPukGoz8hhflqpC3aPXD0tul59fc="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
cmd: 'cronosd',
'start-flags': '--trace',
config: {
db_backend: 'rocksdb',
mempool: {
version: 'v1',
},
},
'app-config': {
chain_id: 'cronos_777-1',
'app-db-backend': 'pebbledb',
'minimum-gas-prices': '0basetcro',
'index-events': ['ethereum_tx.ethereumTxHash'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import json

import pytest
from pystarport import ports

from .utils import wait_for_port
from .utils import wait_for_block, wait_for_port


def test_config_client_id(cronos):
Expand All @@ -13,15 +14,22 @@ def test_config_client_id(cronos):
cli = cronos.cosmos_cli(0)
dir = cli.data_dir / "config"

def assert_chain_id(chain_id):
def assert_chain_id(chain_id, timeout=None):
genesis_cfg = dir / "genesis.json"
genesis = json.loads(genesis_cfg.read_text())
genesis["chain_id"] = f"cronos_{chain_id}-1"
genesis_cfg.write_text(json.dumps(genesis))
cronos.supervisorctl("start", n0)
wait_for_port(ports.evmrpc_port(p0))
assert w3.eth.chain_id == chain_id
height = w3.eth.get_block_number() + 2
# check CONSENSUS FAILURE
if timeout is None:
wait_for_block(cli, height)
else:
with pytest.raises(TimeoutError):
wait_for_block(cli, height, timeout)

assert_chain_id(776)
assert_chain_id(776, 5)
cronos.supervisorctl("stop", n0)
assert_chain_id(777)
40 changes: 0 additions & 40 deletions nix/playtests-darwin.patch

This file was deleted.

0 comments on commit 01d9dc6

Please sign in to comment.