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: miss keypair of SendEnabled to restore legacy param set before migration #1206

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Problem: miss keypair of SendEnabled to restore legacy param set befo…
…re migration
  • Loading branch information
mmsqe committed Oct 13, 2023
commit e638d321eca62d113d513c8eaf6bfab724034c5c
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [Unreleased]

### Bug Fixes
* [#](https://github.com/crypto-org-chain/cronos/pull/) Add missing keypair of SendEnabled to restore legacy param set before migration.
mmsqe marked this conversation as resolved.
Show resolved Hide resolved

*October 9, 2023*

## v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,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-20230921030527-0d47d7537e32
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231009083556-8fbcfbe50690
github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.47.0-rc1.0.20231013004053-773bde0a3a9f
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -482,8 +482,6 @@ 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-20230921030527-0d47d7537e32 h1:VqP0YWKZ6bPHkVHu47EvlrqjYzQiQ0MyRE7NY/fJpU4=
github.com/crypto-org-chain/cometbft-db v0.0.0-20230921030527-0d47d7537e32/go.mod h1:V32HRAjDsAYLfAT90mk0O9UH+sE7P5apfiCmmmVLt3Q=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231009083556-8fbcfbe50690 h1:qDb6BvtxeKsm6o5U4o1oZMhJ9gdXZS8HtO58IXfawd8=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231009083556-8fbcfbe50690/go.mod h1:G384omH7cXgm90xXR7xpHvsKG7vdBaDuz4To6GpTHUU=
github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32 h1:A++epzNCr3EY57dnU6UTSDwbCiPD6MjvUKHKSd/PoI8=
github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32/go.mod h1:wnJQyK4n0vShhL+YIAUd7XCzUhgZ9fgG6yJ14n7qefo=
github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e h1:rSTc35OBjjCBx47rHPWBCIHNGPbMnEj8f7fNcK2TjVI=
Expand Down Expand Up @@ -1140,6 +1138,8 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mmsqe/cosmos-sdk v0.47.0-rc1.0.20231013004053-773bde0a3a9f h1:92Hpsi9Vxl6lgymPHrP8O0swXc6O5PlJfjc47rLM4wI=
github.com/mmsqe/cosmos-sdk v0.47.0-rc1.0.20231013004053-773bde0a3a9f/go.mod h1:G384omH7cXgm90xXR7xpHvsKG7vdBaDuz4To6GpTHUU=
github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU=
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw=
Expand Down
6 changes: 3 additions & 3 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ schema = 3
version = "v1.0.0-beta.2"
hash = "sha256-Am8A44NSxdY77GIEDx1AY+pLU0npeyuTlr3mc4stg3I="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.46.0-beta2.0.20231009083556-8fbcfbe50690"
hash = "sha256-WfGn4NQwgHwgMoGiWs5sJA5grI18rd/OlKpdnt+34gc="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
version = "v0.47.0-rc1.0.20231013004053-773bde0a3a9f"
hash = "sha256-fEjUOiqLR+Bf6DCr9vZi/17apgBDRFKKQKgN7gtYbuY="
replaced = "github.com/mmsqe/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
hash = "sha256-Qm2aC2vaS8tjtMUbHmlBSagOSqbduEEDwc51qvQaBmA="
Expand Down
14 changes: 14 additions & 0 deletions integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@
evm_denom: 'basetcro',
},
},
bank: {
params: {
send_enabled: [
{
denom: 'stake',
enabled: true,
},
{
denom: 'basetcro',
enabled: false,
},
],
},
},
cronos: {
params: {
cronos_admin: '${CRONOS_ADMIN}',
Expand Down
9 changes: 9 additions & 0 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1751,3 +1751,12 @@
def consensus_params(self, port, height):
url = f"http://127.0.0.1:{port}/consensus_params?height={height}"
return requests.get(url).json()["result"]["consensus_params"]

Check failure on line 1754 in integration_tests/cosmoscli.py

View workflow job for this annotation

GitHub Actions / Lint python

./integration_tests/cosmoscli.py:1754:1: BLK100 Black would make changes.

Check failure on line 1754 in integration_tests/cosmoscli.py

View workflow job for this annotation

GitHub Actions / Lint python

./integration_tests/cosmoscli.py:1754:1: W293 blank line contains whitespace
def send_enable(self, port):
url = f"http://127.0.0.1:{port}/cosmos/bank/v1beta1/params"
raw = requests.get(url).json()
return raw["params"]["send_enabled"]

def query_bank_send(self):
res = json.loads(self.raw("q", "bank", "send-enabled", home=self.data_dir))
return res["send_enabled"]
12 changes: 12 additions & 0 deletions integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos, tmp_path_factory):
- it should work transparently
"""
cli = custom_cronos.cosmos_cli()
port = ports.api_port(custom_cronos.base_port(0))
send_enable = [
{"denom": "basetcro", "enabled": False},
{"denom": "stake", "enabled": True},
]
p = cli.send_enable(port)
assert sorted(p, key=lambda x: x["denom"]) == send_enable

# export genesis from cronos v0.8.x
custom_cronos.supervisorctl("stop", "all")
migrate = tmp_path_factory.mktemp("migrate")
Expand Down Expand Up @@ -163,6 +171,10 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos, tmp_path_factory):
res = cli.consensus_params(port, w3.eth.get_block_number())
assert res["block"]["max_gas"] == "60000000"

# check bank send enable
p = cli.query_bank_send()
assert sorted(p, key=lambda x: x["denom"]) == send_enable

rsp = cli.query_params("icaauth")
assert rsp["params"]["min_timeout_duration"] == "3600s", rsp
assert cli.query_params()["max_callback_gas"] == "300000", rsp
Expand Down
Loading