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: unable to query historical txs whose module is removed #1713

Merged
merged 17 commits into from
Dec 6, 2024
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## UNRELEASED

### Bug Fixes

* [#1713](https://github.com/crypto-org-chain/cronos/pull/1713) Register legacy codec to allow query historical txs from deleted icaauth module.

### Improvements

* [#1712](https://github.com/crypto-org-chain/cronos/pull/1712) Upgrade rocksdb to `v9.8.4`.
Expand Down
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ import (
e2ee "github.com/crypto-org-chain/cronos/v2/x/e2ee"
e2eekeeper "github.com/crypto-org-chain/cronos/v2/x/e2ee/keeper"
e2eetypes "github.com/crypto-org-chain/cronos/v2/x/e2ee/types"
icaauthtypes "github.com/crypto-org-chain/cronos/v2/x/icaauth/types"
"github.com/ethereum/go-ethereum/common"

// force register the extension json-rpc.
Expand Down Expand Up @@ -850,6 +851,8 @@ func New(
})
app.BasicModuleManager.RegisterLegacyAminoCodec(cdc)
app.BasicModuleManager.RegisterInterfaces(interfaceRegistry)
icaauthtypes.RegisterCodec(cdc)
icaauthtypes.RegisterInterfaces(interfaceRegistry)

// During begin block slashing happens after distr.BeginBlocker so that
// there is nothing left over in the validator fee pool, so as to keep the
Expand Down
32 changes: 32 additions & 0 deletions integration_tests/configs/cosmovisor_with_ibc.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
local ibc = import 'ibc.jsonnet';

ibc {
'cronos_777-1'+: {
'app-config'+: {
'app-db-backend': 'rocksdb',
'iavl-lazy-loading':: super['iavl-lazy-loading'],
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
},
validators: [super.validators[0] {
'app-config'+: {
store: {
streamers: ['versiondb'],
},
},
}] + super.validators[1:],
genesis+: {
consensus_params: {
block: {
max_bytes: '1048576',
max_gas: '81500000',
},
},
app_state+: {
gov+: {
params+: {
expedited_voting_period:: super['expedited_voting_period'],
},
},
},
},
},
}
33 changes: 33 additions & 0 deletions integration_tests/configs/upgrade-test-package-recent.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
let
pkgs = import ../../nix { };
fetchFlake =
repo: rev:
(pkgs.flake-compat {
src = {
outPath = builtins.fetchTarball "https://github.com/${repo}/archive/${rev}.tar.gz";
inherit rev;
shortRev = builtins.substring 0 7 rev;
};
}).defaultNix;
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
# release/v1.3.x
releasedGenesis =
(fetchFlake "crypto-org-chain/cronos" "e1d819c862b30f0ce978baf2addb12516568639e").default;
# release/v1.4.x
released1_4 =
(fetchFlake "crypto-org-chain/cronos" "ce797fa995000530ee53cd1fbeb3c67180648002").default;
current = pkgs.callPackage ../../. { };
in
pkgs.linkFarm "upgrade-test-package" [
{
name = "genesis";
path = releasedGenesis;
}
{
name = "v1.4";
path = released1_4;
}
{
name = "v1.4.0-rc5-testnet";
path = current;
}
]
35 changes: 35 additions & 0 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,41 @@ def ica_query_account(self, connid, owner, **kwargs):
)
)

def icaauth_register_account(self, connid, event_query_tx=True, **kwargs):
default_kwargs = {
"home": self.data_dir,
"node": self.node_rpc,
"chain_id": self.chain_id,
"keyring_backend": "test",
}
args = ["icaauth", "register-account"]
rsp = json.loads(
self.raw(
"tx",
*args,
connid,
"-y",
**(default_kwargs | kwargs),
)
)
if rsp["code"] == 0 and event_query_tx:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

def icaauth_query_account(self, connid, owner, **kwargs):
default_kwargs = {
"node": self.node_rpc,
"output": "json",
}
args = ["icaauth", "interchain-account-address", connid, owner]
return json.loads(
self.raw(
"q",
*args,
**(default_kwargs | kwargs),
)
)

def query_ica_params(self, **kwargs):
default_kwargs = {
"node": self.node_rpc,
Expand Down
4 changes: 4 additions & 0 deletions integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def prepare_network(
grantee=None,
need_relayer_caller=False,
relayer=cluster.Relayer.HERMES.value,
post_init=None,
chain_binary=None,
):
print("incentivized", incentivized)
print("is_relay", is_relay)
Expand All @@ -162,6 +164,8 @@ def prepare_network(
tmp_path,
26700,
Path(__file__).parent / file,
post_init=post_init,
chain_binary=chain_binary,
relayer=relayer,
) as cronos:
cli = cronos.cosmos_cli()
Expand Down
10 changes: 9 additions & 1 deletion integration_tests/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,15 @@ def setup_custom_cronos(
if wait_port:
wait_for_port(ports.evmrpc_port(base_port))
wait_for_port(ports.evmrpc_ws_port(base_port))
c = Cronos(path / "cronos_777-1", chain_binary=chain_binary or "cronosd")
chain_binary = (
"cronosd"
if chain_binary is None
else next(
(b.strip() for b in chain_binary.split(",") if "cronosd" in b),
"cronosd",
)
)
c = Cronos(path / "cronos_777-1", chain_binary=chain_binary)
w3_wait_for_block(c.w3, 1)
yield c
finally:
Expand Down
Loading
Loading