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

Liorzilp/25 upgrade v3.4.0 #26

Merged
merged 76 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4290a00
override default docsBranch (#1355) (#1390)
mergify[bot] May 17, 2022
996fa1c
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.3 to 0.45.4 …
mergify[bot] May 18, 2022
4438d4e
add empty keepers checking in ibc NewKeeper (backport #1284) (#1382)
mergify[bot] May 18, 2022
fa3526a
fix: prefix ResponseResultType enum for proto linting (#1143) (#1393)
mergify[bot] May 18, 2022
c55d71f
chore : add selected channel version to MsgChanOpenInitResponse and M…
mergify[bot] May 19, 2022
d8271ea
feat: Add sender to fungible_token_packet events (backport #1414) (#1…
mergify[bot] May 24, 2022
c007cb1
add swagger for interchain accounts (#1402) (#1411)
mergify[bot] May 24, 2022
d5d40b0
add actual parameter example to denom-trace and denom-hash CLI querie…
mergify[bot] May 30, 2022
7d84ede
Emit channel close event on ordered channel close (backport #1464) (#…
mergify[bot] Jun 2, 2022
a7f3278
backport #1416 (#1496)
crodriguezvega Jun 8, 2022
45d9cae
chore: improve DenomTrace grpc (backport #1342) (#1504)
mergify[bot] Jun 9, 2022
c90d900
Emit an event to indicate a successful acknowledgement in the ICA mod…
mergify[bot] Jun 9, 2022
744351f
chore: Add consensus state heights query (backport #1336) (#1507)
mergify[bot] Jun 11, 2022
4f22170
fix: deprecate AllowUpdateAfter...check (backport #1511) (#1521)
mergify[bot] Jun 12, 2022
b7144a9
fix to correctly parse denoms with slashes in the base denom (backpor…
mergify[bot] Jun 14, 2022
1d5551f
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
7dc63b4
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
708f813
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
5d68351
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
bf062ad
feat: added check for wildcard * to allow all message types (#1512) (…
mergify[bot] Jun 14, 2022
d30c28c
Update versions
crodriguezvega Jun 16, 2022
4e1c547
Update config.js
crodriguezvega Jun 17, 2022
7e1ed0b
Delete v3-to-v4.md
crodriguezvega Jun 20, 2022
0fae77f
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.4 to 0.45.5 …
mergify[bot] Jun 20, 2022
1551ba1
add migration for base denoms with slashes to docs site (#1544) (#1557)
mergify[bot] Jun 23, 2022
d362f15
docs: add upgrade client proposal event (#1596) (#1635)
mergify[bot] Jul 1, 2022
4c19221
feat: emitting an event when handling a client upgrade proposal (back…
mergify[bot] Jul 5, 2022
86da821
deps: bumping go version 1.18 (backport #1627) (#1656)
mergify[bot] Jul 6, 2022
4a87ed7
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.5 to 0.45.6 …
mergify[bot] Jul 7, 2022
a57ae0e
Update CHANGELOG.md
crodriguezvega Jul 14, 2022
d85319b
fix typo
crodriguezvega Jul 18, 2022
ef9c475
chore: denom traces migration handler (backport #1680) (#1754)
mergify[bot] Jul 22, 2022
7331efa
feat: allow governance to update the TrustingPeriod of the 07-tenderm…
mergify[bot] Jul 22, 2022
936dfbe
fix broken link (#1776) (#1808)
mergify[bot] Jul 28, 2022
6e0d4c7
fix: add cosmos_proto.implements_interface (backport #1740) (#1817)
mergify[bot] Jul 29, 2022
c60104f
fix: ics27 check packet data length explicitly over nil check (#1882)…
mergify[bot] Aug 7, 2022
245f887
chore: adding dockerfile and release task to release/3.2.x (#1932)
chatton Aug 9, 2022
e385fce
fix: prevent blocked addresses from sending ICS 20 transfers (backpor…
mergify[bot] Aug 9, 2022
ee3180d
Fixing github action workflows (backport #1428) (#1939)
mergify[bot] Aug 10, 2022
6461278
chore: backport #1905 (#1978)
crodriguezvega Aug 11, 2022
14cc82b
fix: "acknowledgement written" logs unsupported type (backport #1919)…
mergify[bot] Aug 12, 2022
ce44f4d
Update CHANGELOG.md
crodriguezvega Aug 12, 2022
06f5e34
Update CHANGELOG.md
crodriguezvega Aug 12, 2022
62593e2
fix broken link (#2059) (#2096)
mergify[bot] Aug 23, 2022
82aafb0
gofumpt v3.2.x (#1735)
faddat Sep 7, 2022
5562746
remove empty line in comments
crodriguezvega Sep 7, 2022
3d61f16
chore: fix broken link to bank module spec (backport #2201) (#2208)
mergify[bot] Sep 7, 2022
59f22c5
feat: adding interchain account address query to controller submodule…
mergify[bot] Sep 14, 2022
2abfd4f
`release/v3.3.x` - Bump SDK to v0.45.8 and Tendermint to v0.34.21 (#2…
crodriguezvega Sep 15, 2022
4b3d3b8
Merge pull request from GHSA-832c-mq9v-367r
colin-axner Sep 20, 2022
2c06894
fix: add nil checks for controller and host keeper services (backport…
mergify[bot] Sep 20, 2022
250157f
update changelog for v3.3.0 release
crodriguezvega Sep 20, 2022
35c4218
Update CHANGELOG.md
crodriguezvega Sep 20, 2022
c3b3fd0
fix broken link/update link (#2338) (#2346)
mergify[bot] Sep 21, 2022
2f472ad
Fix ICAControllerKeeper (#2303) (#2332)
mergify[bot] Sep 21, 2022
1564e79
Adding `paramsKeeper.Subspace(icahosttypes.SubModuleName)` (#2220) (#…
mergify[bot] Sep 21, 2022
dd7ff9d
MsgTransferResponse add sequence (backport #2377) (#2465)
mergify[bot] Oct 6, 2022
d4aeb26
fixing dead link to sdk v0.44 (#2488) (#2493)
mergify[bot] Oct 7, 2022
329a3f3
chore: fix broken links (backport #2511) (#2521)
mergify[bot] Oct 11, 2022
be0902c
Added optional packet metadata to the packet and message types (backp…
mergify[bot] Oct 14, 2022
048d80f
add entry for #2305
crodriguezvega Oct 25, 2022
0089c93
refactor: adapting transfer metadata bytes field to memo string (back…
mergify[bot] Oct 26, 2022
68845e5
use controller module address instead of module name for NewMsgChanne…
mergify[bot] Oct 27, 2022
ffc5a79
remove port prefix requirement (backport #2590) (#2632)
mergify[bot] Oct 31, 2022
79a10f0
release/v3.4.x: bump to SDK v0.45.10 (#2589)
faddat Nov 3, 2022
3a2244b
fix: skip emission of unpopulated memo field in ics20 (backport #2651…
mergify[bot] Nov 3, 2022
b36dc31
add check send enabled (backport #2679) (#2688)
mergify[bot] Nov 5, 2022
9571a79
prepare changelog for v3.4.0 release
crodriguezvega Nov 7, 2022
d409970
typo in tag link
crodriguezvega Nov 7, 2022
2407616
Update CHANGELOG.md
crodriguezvega Nov 7, 2022
2d2dedc
Update incorrect PR link in changelog regarding "check x/bank send en…
mergify[bot] Nov 9, 2022
7d10f0a
docs: add missing set order functions for ICA (backport #2740) (#2754)
mergify[bot] Nov 15, 2022
696993b
Merge branch 'release_v3.0.x' into release_v3.4.x
mtsitrin Dec 29, 2022
b64187d
Merge branch 'main-dym' into support_v3.4.x
mtsitrin Dec 29, 2022
13630bf
tests compiles
mtsitrin Dec 29, 2022
c3711bf
1. remove allow_update_after_expiry & allow_update_after_misbehaviour…
liorzilp Jan 3, 2023
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
Prev Previous commit
Next Next commit
refactor: adapting transfer metadata bytes field to memo string (back…
…port cosmos#2595) (cosmos#2597)

* refactor: adapting transfer metadata bytes field to memo string (cosmos#2595)

* adapting transfer metadata bytes field to memo string

* updating changelog

(cherry picked from commit 05685b3)

# Conflicts:
#	CHANGELOG.md
#	docs/ibc/proto-docs.md
#	go.mod
#	go.sum
#	modules/apps/29-fee/transfer_test.go
#	modules/apps/transfer/client/cli/tx.go
#	modules/apps/transfer/ibc_module.go
#	modules/apps/transfer/keeper/mbt_relay_test.go
#	modules/apps/transfer/keeper/msg_server_test.go
#	modules/apps/transfer/keeper/relay.go
#	modules/apps/transfer/keeper/relay_test.go
#	modules/apps/transfer/transfer_test.go
#	modules/apps/transfer/types/msgs.go
#	modules/apps/transfer/types/msgs_test.go
#	modules/apps/transfer/types/packet.go
#	modules/apps/transfer/types/packet.pb.go
#	modules/apps/transfer/types/packet_test.go
#	modules/apps/transfer/types/tx.pb.go

* resolving conflicts

Co-authored-by: Damian Nolan <[email protected]>
  • Loading branch information
mergify[bot] and damiannolan authored Oct 26, 2022
commit 0089c9393f187383d36242de169a38a90f0c7a0b
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

* (apps/transfer) [\#2305](https://github.com/cosmos/ibc-go/pull/2305) Added optional metadata field to `FungibleTokenPacketData` and `MsgTransfer`.
* (apps/transfer) [\#2595](https://github.com/cosmos/ibc-go/pull/2595) Adding optional memo field to `FungibleTokenPacketData` and `MsgTransfer`.

### Bug Fixes

Expand Down
4 changes: 2 additions & 2 deletions docs/ibc/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transf
| `receiver` | [string](#string) | | the recipient address on the destination chain |
| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. |
| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp in absolute nanoseconds since unix epoch. The timeout is disabled when set to 0. |
| `metadata` | [bytes](#bytes) | | optional metadata |
| `memo` | [string](#string) | | optional memo |



Expand Down Expand Up @@ -1008,7 +1008,7 @@ https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transf
| `amount` | [string](#string) | | the token amount to be transferred |
| `sender` | [string](#string) | | the sender address |
| `receiver` | [string](#string) | | the recipient address on the destination chain |
| `metadata` | [bytes](#bytes) | | optional metadata |
| `memo` | [string](#string) | | optional memo |



Expand Down
8 changes: 4 additions & 4 deletions modules/apps/transfer/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
flagPacketTimeoutHeight = "packet-timeout-height"
flagPacketTimeoutTimestamp = "packet-timeout-timestamp"
flagAbsoluteTimeouts = "absolute-timeouts"
flagMetadata = "metadata"
flagMemo = "memo"
)

// NewTransferTxCmd returns the command to create a NewMsgTransfer transaction
Expand Down Expand Up @@ -77,7 +77,7 @@ corresponding to the counterparty channel. Any timeout set to 0 is disabled.`),
return err
}

metadataStr, err := cmd.Flags().GetString(flagMetadata)
memo, err := cmd.Flags().GetString(flagMemo)
if err != nil {
return err
}
Expand Down Expand Up @@ -119,7 +119,7 @@ corresponding to the counterparty channel. Any timeout set to 0 is disabled.`),
msg := types.NewMsgTransfer(
srcPort, srcChannel, coin, sender, receiver, timeoutHeight, timeoutTimestamp,
)
msg.Metadata = []byte(metadataStr)
msg.Memo = memo

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
Expand All @@ -128,7 +128,7 @@ corresponding to the counterparty channel. Any timeout set to 0 is disabled.`),
cmd.Flags().String(flagPacketTimeoutHeight, types.DefaultRelativePacketTimeoutHeight, "Packet timeout block height. The timeout is disabled when set to 0-0.")
cmd.Flags().Uint64(flagPacketTimeoutTimestamp, types.DefaultRelativePacketTimeoutTimestamp, "Packet timeout timestamp in nanoseconds from now. Default is 10 minutes. The timeout is disabled when set to 0.")
cmd.Flags().Bool(flagAbsoluteTimeouts, false, "Timeout flags are used as absolute timeouts.")
cmd.Flags().String(flagMetadata, "", "Metadata to be sent along with the packet. The CLI accepts only strings here but you can construct a packet with arbitrary bytes via code.")
cmd.Flags().String(flagMemo, "", "Memo to be sent along with the packet.")
flags.AddTxFlagsToCmd(cmd)

return cmd
Expand Down
7 changes: 3 additions & 4 deletions modules/apps/transfer/ibc_module.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package transfer

import (
"encoding/hex"
"fmt"
"math"

Expand Down Expand Up @@ -195,7 +194,7 @@ func (im IBCModule) OnRecvPacket(
sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver),
sdk.NewAttribute(types.AttributeKeyDenom, data.Denom),
sdk.NewAttribute(types.AttributeKeyAmount, data.Amount),
sdk.NewAttribute(types.AttributeKeyMetadata, hex.EncodeToString(data.Metadata)),
sdk.NewAttribute(types.AttributeKeyMemo, data.Memo),
sdk.NewAttribute(types.AttributeKeyAckSuccess, fmt.Sprintf("%t", ack.Success())),
),
)
Expand Down Expand Up @@ -232,7 +231,7 @@ func (im IBCModule) OnAcknowledgementPacket(
sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver),
sdk.NewAttribute(types.AttributeKeyDenom, data.Denom),
sdk.NewAttribute(types.AttributeKeyAmount, data.Amount),
sdk.NewAttribute(types.AttributeKeyMetadata, hex.EncodeToString(data.Metadata)),
sdk.NewAttribute(types.AttributeKeyMemo, data.Memo),
sdk.NewAttribute(types.AttributeKeyAck, ack.String()),
),
)
Expand Down Expand Up @@ -279,7 +278,7 @@ func (im IBCModule) OnTimeoutPacket(
sdk.NewAttribute(types.AttributeKeyRefundReceiver, data.Sender),
sdk.NewAttribute(types.AttributeKeyRefundDenom, data.Denom),
sdk.NewAttribute(types.AttributeKeyRefundAmount, data.Amount),
sdk.NewAttribute(types.AttributeKeyMetadata, hex.EncodeToString(data.Metadata)),
sdk.NewAttribute(types.AttributeKeyMemo, data.Memo),
),
)

Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.

sequence, err := k.sendTransfer(
ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp,
msg.Metadata)
msg.Memo)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (suite *KeeperTestSuite) TestMsgTransfer() {
coin, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(),
suite.chainB.GetTimeoutHeight(), 0, // only use timeout height
)
msg.Metadata = []byte("custom metadata")
msg.Memo = "memo"

tc.malleate()

Expand Down
6 changes: 3 additions & 3 deletions modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (k Keeper) SendTransfer(
receiver,
timeoutHeight,
timeoutTimestamp,
nil,
"",
)
return err
}
Expand All @@ -84,7 +84,7 @@ func (k Keeper) sendTransfer(
receiver string,
timeoutHeight clienttypes.Height,
timeoutTimestamp uint64,
metadata []byte,
memo string,
) (uint64, error) {
if !k.GetSendEnabled(ctx) {
return 0, types.ErrSendDisabled
Expand Down Expand Up @@ -177,7 +177,7 @@ func (k Keeper) sendTransfer(
packetData := types.NewFungibleTokenPacketData(
fullDenomPath, token.Amount.String(), sender.String(), receiver,
)
packetData.Metadata = metadata
packetData.Memo = memo

packet := channeltypes.NewPacket(
packetData.GetBytes(),
Expand Down
16 changes: 8 additions & 8 deletions modules/apps/transfer/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
trace types.DenomTrace
amount sdk.Int
receiver string
metadata []byte
memo string
)

testCases := []struct {
Expand All @@ -172,12 +172,12 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
expPass bool
}{
{"success receive on source chain", func() {}, true, true},
{"success receive on source chain with metadata", func() {
metadata = []byte("metadata")
{"success receive on source chain with memo", func() {
memo = "memo"
}, true, true},
{"success receive with coin from another chain as source", func() {}, false, true},
{"success receive with coin from another chain as source with metadata", func() {
metadata = []byte("metadata")
{"success receive with coin from another chain as source with memo", func() {
memo = "memo"
}, false, true},
{"empty coin", func() {
trace = types.DenomTrace{}
Expand Down Expand Up @@ -219,7 +219,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
suite.coordinator.Setup(path)
receiver = suite.chainB.SenderAccount.GetAddress().String() // must be explicitly changed in malleate

metadata = []byte{} // can be explicitly changed in malleate
memo = "" // can be explicitly changed in malleate
amount = sdk.NewInt(100) // must be explicitly changed in malleate
seq := uint64(1)

Expand All @@ -246,14 +246,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {

// send coin from chainA to chainB
transferMsg := types.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, sdk.NewCoin(trace.IBCDenom(), amount), suite.chainA.SenderAccount.GetAddress().String(), receiver, clienttypes.NewHeight(0, 110), 0)
transferMsg.Metadata = metadata
transferMsg.Memo = memo
_, err := suite.chainA.SendMsgs(transferMsg)
suite.Require().NoError(err) // message committed

tc.malleate()

data := types.NewFungibleTokenPacketData(trace.GetFullDenomPath(), amount.String(), suite.chainA.SenderAccount.GetAddress().String(), receiver)
data.Metadata = metadata
data.Memo = memo
packet := channeltypes.NewPacket(data.GetBytes(), seq, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, clienttypes.NewHeight(0, 100), 0)

err = suite.chainB.GetSimApp().TransferKeeper.OnRecvPacket(suite.chainB.GetContext(), packet, data)
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/spec/04_messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type MsgTransfer struct {
Receiver string
TimeoutHeight ibcexported.Height
TimeoutTimestamp uint64
Metadata []byte
Memo string
}
```

Expand Down
6 changes: 3 additions & 3 deletions modules/apps/transfer/spec/05_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ order: 5
| fungible_token_packet | denom | {denom} |
| fungible_token_packet | amount | {amount} |
| fungible_token_packet | success | {ackSuccess} |
| fungible_token_packet | metadata | {metadata} |
| fungible_token_packet | memo | {memo} |
| denomination_trace | trace_hash | {hex_hash} |

## OnAcknowledgePacket callback
Expand All @@ -33,7 +33,7 @@ order: 5
| fungible_token_packet | receiver | {receiver} |
| fungible_token_packet | denom | {denom} |
| fungible_token_packet | amount | {amount} |
| fungible_token_packet | metadata | {metadata} |
| fungible_token_packet | memo | {memo} |
| fungible_token_packet | acknowledgement | {ack.String()} |
| fungible_token_packet | success | error | {ack.Response} |

Expand All @@ -45,4 +45,4 @@ order: 5
| fungible_token_packet | refund_receiver | {receiver} |
| fungible_token_packet | denom | {denom} |
| fungible_token_packet | amount | {amount} |
| fungible_token_packet | metadata | {metadata} |
| fungible_token_packet | memo | {memo} |
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ const (
AttributeKeyAck = "acknowledgement"
AttributeKeyAckError = "error"
AttributeKeyTraceHash = "trace_hash"
AttributeKeyMetadata = "metadata"
AttributeKeyMemo = "memo"
)
71 changes: 34 additions & 37 deletions modules/apps/transfer/types/packet.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading