diff --git a/CHANGELOG.md b/CHANGELOG.md index aa30e2041e..e515016f88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - [cronos#1165](https://github.com/crypto-org-chain/cronos/pull/1165) Icaauth module is not adjusted correctly in ibc-go v7.2.0. - [cronos#1163](https://github.com/crypto-org-chain/cronos/pull/1163) Support stateful precompiled contract for ica. - [cronos#837](https://github.com/crypto-org-chain/cronos/pull/837) Support stateful precompiled contract for bank. +- [cronos#1184](https://github.com/crypto-org-chain/cronos/pull/1184) Update ibc-go to `v7.3.1`. ### Bug Fixes diff --git a/go.mod b/go.mod index 44135e458d..f65581b887 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,9 @@ require ( github.com/cometbft/cometbft v0.37.3-0.20230920093934-46df7b597e3c github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/cosmos/ibc-go/v7 v7.3.1-0.20230920070810-c3261472c815 github.com/crypto-org-chain/cronos/store v0.0.4 github.com/crypto-org-chain/cronos/versiondb v0.0.0-00010101000000-000000000000 github.com/ethereum/go-ethereum v1.10.26 @@ -233,7 +233,7 @@ replace ( // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc1 - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20230925010909-716b0754a135 + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32 // 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 beee47a969..46b6476148 100644 --- a/go.sum +++ b/go.sum @@ -452,8 +452,8 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583 h1:3Matt7/LjZiZkIBPalYazOZcw2B05Ch14dU5TJyqJEc= github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.2.0 h1:dx0DLUl7rxdyZ8NiT6UsrbzKOJx/w7s+BOaewFRH6cg= -github.com/cosmos/ibc-go/v7 v7.2.0/go.mod h1:OOcjKIRku/j1Xs1RgKK0yvKRrJ5iFuZYMetR1n3yMlc= +github.com/cosmos/ibc-go/v7 v7.3.1-0.20230920070810-c3261472c815 h1:raSo7w7B3IXCb7DZozHWz8ajG7HLWZw9foiyCbEgInI= +github.com/cosmos/ibc-go/v7 v7.3.1-0.20230920070810-c3261472c815/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -482,8 +482,8 @@ github.com/crypto-org-chain/cometbft-db v0.0.0-20230921030527-0d47d7537e32 h1:Vq 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.20230905040840-b3af5590283b h1:d2GOFR3i3BjDlPsmJkp8Gsrt9LK2nq2IVEnE/rMv1Fo= github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20230905040840-b3af5590283b/go.mod h1:EHwCeN9IXonsjKcjpS12MqeStdZvIdxt3VYXhus3G3c= -github.com/crypto-org-chain/ethermint v0.6.1-0.20230925010909-716b0754a135 h1:hF+Xu71O4pKb8kvlGRO41qR9dqavoaqg4k1xOKZ0m9k= -github.com/crypto-org-chain/ethermint v0.6.1-0.20230925010909-716b0754a135/go.mod h1:KtjU2MHMCTcLnAoS9C3U3f+vx4f9HHNQRcOlxXiVDxY= +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= github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e/go.mod h1:HBaDqlFjlaXJwVQtA7jHejyaA7xwjXI2o6pU/ccP3tE= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/gomod2nix.toml b/gomod2nix.toml index d132fee81a..f5bf557fb7 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -155,8 +155,8 @@ schema = 3 version = "v0.21.0-alpha.1.0.20230904092046-df3db2d96583" hash = "sha256-3Va8Ljq63IXty0oHlRpqfsC6WsMut6TWZ2R+/nYtfTU=" [mod."github.com/cosmos/ibc-go/v7"] - version = "v7.2.0" - hash = "sha256-fg+0AykvEMzqRGI5CmqwjQtSIwTyT6RuSDpp12wzReM=" + version = "v7.3.1-0.20230920070810-c3261472c815" + hash = "sha256-x/D64hmU+aOc5sm8RzXMB+8y+530+CCEik/Zpj3Rf9A=" [mod."github.com/cosmos/ics23/go"] version = "v0.10.0" hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" @@ -213,8 +213,8 @@ schema = 3 hash = "sha256-GgcReGsIIuBE2TabDYqDO9sBGogdVr9RSh4arQzdPnE=" replaced = "github.com/evmos/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20230925010909-716b0754a135" - hash = "sha256-I4NiYqyR3Cgs4QWrqod9ABCtpU0c5LVlyGr38GNjAxg=" + version = "v0.6.1-0.20230925072753-4062d0cc2a32" + hash = "sha256-8zwdHROHnAVfly2PIaNAfiXfb2fWsTqePaZ58EJtjH4=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/felixge/httpsnoop"] version = "v1.0.2" diff --git a/integration_tests/cosmoscli.py b/integration_tests/cosmoscli.py index f98104f2aa..7749e5a610 100644 --- a/integration_tests/cosmoscli.py +++ b/integration_tests/cosmoscli.py @@ -1315,7 +1315,7 @@ def ica_query_account(self, connid, owner, **kwargs): ) ) - def ica_generate_packet_data(self, tx, memo=None, **kwargs): + def ica_generate_packet_data(self, tx, memo=None, encoding="proto3", **kwargs): return json.loads( self.raw( "tx", @@ -1323,7 +1323,8 @@ def ica_generate_packet_data(self, tx, memo=None, **kwargs): "host", "generate-packet-data", tx, - "--memo" if memo else None, + memo=memo, + encoding=encoding, home=self.data_dir, **kwargs, ) diff --git a/x/cronos/keeper/precompiles/bank.go b/x/cronos/keeper/precompiles/bank.go index f15162fa90..158f639d00 100644 --- a/x/cronos/keeper/precompiles/bank.go +++ b/x/cronos/keeper/precompiles/bank.go @@ -134,11 +134,7 @@ func (bc *BankContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ( token := args[0].(common.Address) addr := args[1].(common.Address) // query from storage - balance := big.NewInt(0) - err = stateDB.ExecuteNativeAction(precompileAddr, nil, func(ctx sdk.Context) error { - balance = bc.bankKeeper.GetBalance(ctx, sdk.AccAddress(addr.Bytes()), EVMDenom(token)).Amount.BigInt() - return err - }) + balance := bc.bankKeeper.GetBalance(stateDB.CacheContext(), sdk.AccAddress(addr.Bytes()), EVMDenom(token)).Amount.BigInt() return method.Outputs.Pack(balance) case "transfer": if readonly {