Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: v0.50.x is outdated #1722

Merged
merged 8 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### State Machine Breaking

* [#1722](https://github.com/crypto-org-chain/cronos/pull/1722) Include a security patch from cosmos sdk.
* [#1724](https://github.com/crypto-org-chain/cronos/pull/1724) Include the fix of nonce management in batch tx in ethermint.

*Dec 9, 2024*
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ require (

// release/v0.50.x
replace (
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241205052910-142c0afa4948
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241205052910-142c0afa4948
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241205052910-142c0afa4948
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241217090828-cfbca9fe8254
)

replace (
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,6 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro=
github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0=
github.com/cosmos/iavl v1.2.3 h1:XkESLkGuNikscRsIOSlYMsBaE+Ae7QvXt6e2zOoCgwA=
github.com/cosmos/iavl v1.2.3/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw=
github.com/cosmos/iavl v1.2.4-0.20241218014611-3b0ad9922f9f h1:ex8R1/5/ghhCBEwSWr2L2+OSnWU0A6Pe68cROdGiVX4=
github.com/cosmos/iavl v1.2.4-0.20241218014611-3b0ad9922f9f/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw=
github.com/cosmos/ibc-go/modules/apps/callbacks v0.0.0-20240913130017-6b2554360c0e h1:jMqihcJRBdpRrKGOMS1bDyyoo2JoQxv4QmMCwK3HSvI=
Expand Down Expand Up @@ -424,12 +422,12 @@ 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 v0.0.0-20241106091515-ce418f845d9a h1:0EN1TkzHTAxpgpGaZJY3G7L4jf4+sYnI7FOmBFLCg4U=
github.com/crypto-org-chain/cometbft v0.0.0-20241106091515-ce418f845d9a/go.mod h1:khbgmtxbgwJfMqDmnGY4rl2sQpTdzpPb1f9nqnfpy1o=
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241205052910-142c0afa4948 h1:hX86EeDInLGJnWIR3PZ5ymp6/xaHtk+8E5pA9ZuwEfs=
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241205052910-142c0afa4948/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241205052910-142c0afa4948 h1:3GPO2XItxofWxxj2exoaz9Ki+cixakumachnqHvmLHQ=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241205052910-142c0afa4948/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241205052910-142c0afa4948 h1:lb8Mztnt2bpCowKbZMHosyQtXN0QtX/MITH9y5DVNkU=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241205052910-142c0afa4948/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241217090828-cfbca9fe8254 h1:qmTKLerKyvXGxIt4lThZ9QPpZYw9w8e4Bm36CNPI5S8=
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241217090828-cfbca9fe8254/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254 h1:NEgy0r3otU/O+0OAjMdEhbn4VotQlg+98hHbD7M23wU=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254 h1:JzLOFRiKsDtLJt5h0M0jkEIPDKvFFyja7VEp7gG6O9U=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/crypto-org-chain/ethermint v0.6.1-0.20241217094803-acbe290991cc h1:NDD/ddYvUlnJ6TQMf+VUrN7a9YATYiLZA7xbDHwbJxY=
github.com/crypto-org-chain/ethermint v0.6.1-0.20241217094803-acbe290991cc/go.mod h1:9FNO9k70szJ7CEge4tnJraWu3baTbwNxjpZhZBqlMok=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI=
Expand Down
12 changes: 6 additions & 6 deletions gomod2nix.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
},
validators: [{
coins: '1000000000000000000stake,10000000000000000000000basetcro',
coins: '2000000000000000000stake,10000000000000000000000basetcro',
staked: '1000000000000000000stake',
mnemonic: '${VALIDATOR1_MNEMONIC}',
client_config: {
Expand Down
74 changes: 73 additions & 1 deletion integration_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from hexbytes import HexBytes
from pystarport import cluster, ports

from .cosmoscli import CosmosCLI, module_address
from .cosmoscli import DEFAULT_GAS_PRICE, CosmosCLI, module_address
from .network import Geth
from .utils import (
ADDRS,
Expand All @@ -36,6 +36,7 @@
submit_gov_proposal,
w3_wait_for_block,
wait_for_block,
wait_for_fn,
wait_for_new_blocks,
wait_for_port,
)
Expand Down Expand Up @@ -949,6 +950,77 @@ def test_submit_send_enabled(cronos, tmp_path):
assert cli.query_bank_send(*denoms) == send_enable


def test_join_validator(cronos):
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
chain_id = cronos.config["chain_id"]
data = Path(cronos.base_dir).parent
clustercli = cluster.ClusterCLI(data, cmd="cronosd", chain_id=chain_id)
moniker = "new joined"
base_port = 26800
i = clustercli.create_node(base_port=base_port, moniker=moniker)
home = cronos.node_home(i=i)
cli1 = clustercli.cosmos_cli(i)
staked = 1000000000000000000
amt = 50000000000000000
coin = f"{staked}stake,{amt}basetcro"
cli = cronos.cosmos_cli()
addr = cli1.address("validator")
res = cli.transfer(cli.address("validator"), addr, coin)
assert res["code"] == 0
assert cli.balance(addr) == amt
cluster.edit_app_cfg(
Path(home) / "config/app.toml",
base_port,
{
"json-rpc": {
"address": f"127.0.0.1:{ports.evmrpc_port(base_port)}",
"ws-address": f"127.0.0.1:{ports.evmrpc_ws_port(base_port)}",
},
},
)
# start the node
clustercli.supervisor.startProcess(f"{chain_id}-node{i}")
wait_for_block(clustercli.cosmos_cli(i), cli.block_height() + 1)
# wait for the new node to sync
wait_for_block(cli1, cli1.block_height())
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
count1 = len(cli1.validators())
# create validator tx
res = cli1.create_validator(
f"{staked}stake",
{
"moniker": moniker,
},
gas_prices=DEFAULT_GAS_PRICE,
)
assert res["code"] == 0
assert (
len(cli1.validators()) == count1 + 1
), "new validator should joined successfully"
val_addr = cli1.address("validator", bech="val")
val = cli1.validator(val_addr)
assert not val.get("jailed")
assert val["status"] == "BOND_STATUS_BONDED"
assert val["tokens"] == f"{staked}"
assert val["description"]["moniker"] == moniker
assert val["commission"]["commission_rates"] == {
"rate": "100000000000000000",
"max_rate": "200000000000000000",
"max_change_rate": "10000000000000000",
}

def check_status(status):
return cli1.validator(val_addr)["status"] == status

wait_for_fn("check_status", lambda: check_status("BOND_STATUS_BONDED"))
res = cli1.unbond_amount(
val_addr,
f"{staked}stake",
cli1.address("validator"),
gas_prices=DEFAULT_GAS_PRICE,
)
assert res["code"] == 0
wait_for_fn("check_status", lambda: check_status("BOND_STATUS_UNBONDING"))


def test_block_stm_delete(cronos):
"""
this test case revealed a bug in block-stm,
Expand Down
Loading