diff --git a/README.md b/README.md index bac47a2ec5..8cb6be5d61 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ See [Release procedure](CONTRIBUTING.md#release-procedure) for more information | v6.2.x | ✓ | v0.47.6+ | v7.2.x | --- | umee/v2.3.0 | --- | v1.5.0 | | v6.3.x | ✓ | v0.47.7+ | v7.3.1 | --- | umee/v2.3.0+ | --- | v1.5.0 | | v6.4.x | x | v0.47.10+ | v7.3.2 | --- | umee/v2.4.1+ | --- | v1.5.2 | -| v6.5.x | x | v0.47.11+ | v7.5.1 | --- | umee/v2.4.3+ | --- | v1.5.2 | +| v6.5.x | x | v0.47.11+ | v7.6.0 | --- | umee/v2.4.3+ | --- | v1.5.2 | #### Price Feeder diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 6278fc0fb3..ade320b7ed 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -12,7 +12,7 @@ In this release, we are introducing validations for the IBC transfer message rec - Maximum length for IBC transfer memo field: 32'768 characters - Maximum length for IBC transfer receiver address field: 2'048 characters -- Bump `ibc-go` to v7.5.1. +- Bump `ibc-go` to v7.6.0 ### Validators diff --git a/go.mod b/go.mod index 73cc0bc4db..d191da3569 100644 --- a/go.mod +++ b/go.mod @@ -12,11 +12,11 @@ require ( github.com/cometbft/cometbft v0.37.6 github.com/cometbft/cometbft-db v0.11.0 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.47.11 + github.com/cosmos/cosmos-sdk v0.47.12 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 // NOTE: v1.4.11+ is not compatible with sdk v0.47 github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 - github.com/cosmos/ibc-go/v7 v7.5.1 + github.com/cosmos/ibc-go/v7 v7.6.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 diff --git a/go.sum b/go.sum index 9ac3e887c8..480b15c27f 100644 --- a/go.sum +++ b/go.sum @@ -405,8 +405,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.47.11 h1:0Qx7eORw0RJqPv+mvDuU8NQ1LV3nJJKJnPoYblWHolc= -github.com/cosmos/cosmos-sdk v0.47.11/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= +github.com/cosmos/cosmos-sdk v0.47.12 h1:KOZHAVWrcilHywBN/FabBaXbDFMzoFmtdX0hqy5Ory8= +github.com/cosmos/cosmos-sdk v0.47.12/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -419,8 +419,8 @@ github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= -github.com/cosmos/ibc-go/v7 v7.5.1 h1:KqS/g7W7EMX1OtOvufS8lWMJibOKpdgtNNZIU6fAgVU= -github.com/cosmos/ibc-go/v7 v7.5.1/go.mod h1:ktFg5GvKOyrGCqTWtW7Grj5uweU4ZapxrNeVS1CLLbo= +github.com/cosmos/ibc-go/v7 v7.6.0 h1:S1G5hcIVe9go+jQV6F9+I9yy+hylbJeLiVHUmktQNrM= +github.com/cosmos/ibc-go/v7 v7.6.0/go.mod h1:LifBA7JHRHl95ujjHIaBEHmUqy2qCGyqDCXB7qmAsZk= 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= diff --git a/tests/e2e/e2e_ibc_memo_test.go b/tests/e2e/e2e_ibc_memo_test.go index 5d312b5b2b..9f02663551 100644 --- a/tests/e2e/e2e_ibc_memo_test.go +++ b/tests/e2e/e2e_ibc_memo_test.go @@ -44,7 +44,7 @@ func (s *E2ETest) testIBCTokenTransferWithMemo(umeeAPIEndpoint string, atomQuota invalidMemoBZ, err := cdc.MarshalJSON(&invalidMemo) assert.Nil(err) - s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, false, "", string(invalidMemoBZ)) + s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, "", string(invalidMemoBZ), "") updatedIBCAtomBalance := atomFromGaia.Amount.Add(prevIBCAtomBalance) s.checkSupply(umeeAPIEndpoint, uatomIBCHash, updatedIBCAtomBalance) s.checkLeverageAccountBalance(umeeAPIEndpoint, fallbackAddr, uatomIBCHash, math.ZeroInt()) @@ -60,7 +60,7 @@ func (s *E2ETest) testIBCTokenTransferWithMemo(umeeAPIEndpoint string, atomQuota invalidMemo = uibc.ICS20Memo{Messages: anyMsgOfCollateralize, FallbackAddr: ""} invalidMemoBZ, err = cdc.MarshalJSON(&invalidMemo) assert.Nil(err) - s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, false, "", string(invalidMemoBZ)) + s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, "", string(invalidMemoBZ), "") updatedIBCAtomBalance = updatedIBCAtomBalance.Add(atomFromGaia.Amount) s.checkSupply(umeeAPIEndpoint, uatomIBCHash, updatedIBCAtomBalance) s.checkLeverageAccountBalance(umeeAPIEndpoint, fallbackAddr, uatomIBCHash, math.ZeroInt()) @@ -82,7 +82,7 @@ func (s *E2ETest) testIBCTokenTransferWithMemo(umeeAPIEndpoint string, atomQuota bz, err := cdc.MarshalJSON(&memo) assert.Nil(err) - s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, false, "", string(bz)) + s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, "", string(bz), "") updatedIBCAtomBalance = updatedIBCAtomBalance.Add(atomFromGaia.Amount) s.checkSupply(umeeAPIEndpoint, uatomIBCHash, updatedIBCAtomBalance) s.checkLeverageAccountBalance(umeeAPIEndpoint, accs.Alice.String(), uatomIBCHash, atomFromGaia.Amount) diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index 8d519e2788..3032ec7fe6 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -27,6 +27,8 @@ const ( atomSymbol = "ATOM" umeeSymbol = "UMEE" + + errQuotaExceed = "quota transfer exceeded" ) var powerReduction = sdk.MustNewDecFromStr("10").Power(6) @@ -136,7 +138,7 @@ func (s *E2ETest) TestIBCTokenTransfer() { recipient := s.AccountAddr(0).String() token := sdk.NewInt64Coin("stake", 3300000000) // 3300stake - s.SendIBC(setup.GaiaChainID, s.Chain.ID, recipient, token, false, "", "") + s.SendIBC(setup.GaiaChainID, s.Chain.ID, recipient, token, "", "", "") s.checkSupply(umeeAPIEndpoint, stakeIBCHash, token.Amount) }) @@ -145,7 +147,7 @@ func (s *E2ETest) TestIBCTokenTransfer() { // send $500 ATOM from gaia to umee. (ibc_quota will not check token limit) atomFromGaia := mulCoin(atomQuota, "5.0") atomFromGaia.Denom = "uatom" - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", atomFromGaia, false, "", "") + s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", atomFromGaia, "", "", "") s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount) // <<< OUTLOW : umee -> gaia >> @@ -161,7 +163,7 @@ func (s *E2ETest) TestIBCTokenTransfer() { // << TOKEN QUOTA EXCCEED >> // send $110 UMEE from umee to gaia (token_quota is 100$) exceedUmee := mulCoin(umeeQuota, "1.1") - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedUmee, true, "", "") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedUmee, "", "", errQuotaExceed) // check the ibc (umee) quota after ibc txs - this one should have failed // supply don't change s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt()) @@ -169,37 +171,37 @@ func (s *E2ETest) TestIBCTokenTransfer() { // << Receiver Addr = maximum length + 1 // send $110 UMEE from umee to gaia (token_quota is 100$) recvAddr := tsdk.GenerateString(ibcutil.MaximumMemoLength + 1) - s.SendIBC(s.Chain.ID, setup.GaiaChainID, recvAddr, exceedUmee, true, "", "") - // check the ibc (umee) quota after ibc txs - this one should have failed - // supply don't change + s.SendIBC(s.Chain.ID, setup.GaiaChainID, recvAddr, exceedUmee, "", "", + "recipient address must not exceed 2048 bytes") + // supply should not change s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt()) // send $110 ATOM from umee to gaia exceedAtom := mulCoin(atomQuota, "1.1") // supply will be not be decreased because sending amount is more than token quota so it will fail - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAtom, true, "uatom from umee to gaia", "") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAtom, "uatom from umee to gaia", "", errQuotaExceed) s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount) // << BELOW TOKEN QUOTA >> // send $90 UMEE from umee to gaia (ibc_quota will check) // Note: receiver is null so hermes will default send to key_name (from config) of target chain (gaia) sendUmee := mulCoin(umeeQuota, "0.9") - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", sendUmee, false, fmt.Sprintf( - "sending %s (less than token quota) ", sendUmee.String()), "") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", sendUmee, + fmt.Sprintf("sending %s (less than token quota) ", sendUmee.String()), "", "") s.checkOutflows(umeeAPIEndpoint, appparams.BondDenom, true, sdk.NewDecFromInt(sendUmee.Amount), appparams.Name) s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, sendUmee.Amount) // << BELOW TOKEN QUOTA 40$ but ATOM_QUOTA (40$)+ UMEE_QUOTA(90$) >= TOTAL QUOTA (120$) >> // send $40 ATOM from umee to gaia atom40 := mulCoin(atomQuota, "0.4") - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", atom40, true, "below token quota but not total quota", "") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", atom40, "below token quota but not total quota", "", errQuotaExceed) // supply will be not be decreased because sending more than total quota from umee to gaia s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount) // ✅ << BELOW TOKEN QUTOA 5$ but ATOM_QUOTA (5$)+ UMEE_QUOTA(90$) <= TOTAL QUOTA (120$) // send $5 ATOM from umee to gaia sendAtom := mulCoin(atomQuota, "0.05") - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", sendAtom, false, "below both quotas", "") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", sendAtom, "below both quotas", "", "") // remaing supply decreased uatom on umee s.checkSupply(umeeAPIEndpoint, uatomIBCHash, atomFromGaia.Amount.Sub(sendAtom.Amount)) s.checkOutflows(umeeAPIEndpoint, uatomIBCHash, true, sdk.NewDecFromInt(sendAtom.Amount), atomSymbol) @@ -210,11 +212,11 @@ func (s *E2ETest) TestIBCTokenTransfer() { coins, err := s.QueryTotalSupply(gaiaAPIEndpoint) // before sending back remainingTokens := coins.AmountOf(umeeIBCHash).Sub(returnUmee.Amount) s.Require().NoError(err) - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", returnUmee, false, "send back some umee", "") + s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", returnUmee, "send back some umee", "", "") s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, remainingTokens) // sending back remaining amount - s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewCoin(umeeIBCHash, remainingTokens), false, "send back remaining umee", "") + s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewCoin(umeeIBCHash, remainingTokens), "send back remaining umee", "", "") s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt()) /* @@ -267,7 +269,7 @@ func (s *E2ETest) TestIBCTokenTransfer() { s.Require().Equal(uibcParams.IbcStatus, uibc.IBCTransferStatus_IBC_TRANSFER_STATUS_QUOTA_DISABLED) // sending the umee tokens - they would have exceeded quota before - s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedUmee, false, "sending umee", "") + s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedUmee, "sending umee", "", "") s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, exceedUmee.Amount) // Check the outflows s.Require().Eventually( diff --git a/tests/e2e/setup/utils.go b/tests/e2e/setup/utils.go index 6332195f5d..576b91c9dc 100644 --- a/tests/e2e/setup/utils.go +++ b/tests/e2e/setup/utils.go @@ -55,11 +55,11 @@ func (s *E2ETestSuite) Delegate(testAccount, valIndex int, amount uint64) error return s.BroadcastTxWithRetry(msg, s.AccountClient(testAccount)) } -func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token sdk.Coin, failDueToQuota bool, - desc, memo string) { - if failDueToQuota { - s.T().Logf("sending %s from %s to %s (exceed quota: %v) %s", - token, srcChainID, dstChainID, failDueToQuota, desc) +func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token sdk.Coin, + desc, memo, expectedErr string) { + if expectedErr != "" { + s.T().Logf("sending %s from %s to %s, %s (expectedErr: %s)", + token, srcChainID, dstChainID, desc, expectedErr) } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -131,9 +131,8 @@ func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token s // Note: we are cchecking only one side of ibc , we don't know whethever ibc transfer is succeed on one side // some times relayer can't send the packets to another chain - // // don't check for the tx hash if we expect this to fail due to quota - if strings.Contains(errBuf.String(), "quota transfer exceeded") { - s.Require().True(failDueToQuota) + if expectedErr != "" { + s.Require().Contains(outBuf.String(), expectedErr) return } @@ -142,7 +141,7 @@ func (s *E2ETestSuite) SendIBC(srcChainID, dstChainID, recipient string, token s if i < 4 { continue } - if !strings.Contains(outBuf.String(), "bad packet in rate limit's SendPacket") { + if !strings.Contains(outBuf.String(), "must not exceed") { s.Require().Failf("failed to find transaction hash in output outBuf: %s errBuf: %s", outBuf.String(), errBuf.String()) }