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

Need an upgrade for ibc-go proto #33

Closed
giorgionocera opened this issue Apr 7, 2023 · 13 comments
Closed

Need an upgrade for ibc-go proto #33

giorgionocera opened this issue Apr 7, 2023 · 13 comments

Comments

@giorgionocera
Copy link

There seems to be a misalignment between the latest cosmos proto and the osmojs ones for the IBC transactions.

As you can see, the proto file available on the cosmos repo in the ibc-go folder includes the info for the IBC memo parameter:
https://github.com/cosmos/ibc-go/blob/10324f5bf6840892cd7bba8a40231fc52a8b1745/proto/ibc/applications/transfer/v2/packet.proto#L5-L21

As you can see here:

option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
// FungibleTokenPacketData defines a struct for the packet payload
// See FungibleTokenPacketData spec:
// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures
message FungibleTokenPacketData {
// the token denomination to be transferred
string denom = 1;
// the token amount to be transferred
string amount = 2;
// the sender address
string sender = 3;
// the recipient address on the destination chain
string receiver = 4;
}

osmojs seems to be not yet updated 😬, nor at its last version:

option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
// FungibleTokenPacketData defines a struct for the packet payload
// See FungibleTokenPacketData spec:
// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures
message FungibleTokenPacketData {
// the token denomination to be transferred
string denom = 1;
// the token amount to be transferred
string amount = 2;
// the sender address
string sender = 3;
// the recipient address on the destination chain
string receiver = 4;
}

On the other hand, it seems that cosmjs already provide such a feature:
https://github.com/confio/cosmjs-types/blob/6e3448a046b86f4448d577a73edf8f2229e8ad61/src/ibc/applications/transfer/v2/packet.ts#L11-L26

Moreover, could you please construct the MessageComposer as you did for the IBC transfer message?

@DavideSegullo
Copy link

Hello,
I also suggest to update the ibc-go v1 transfer,because they added the memo field:
https://github.com/cosmos/ibc-go/blob/10324f5bf6840892cd7bba8a40231fc52a8b1745/proto/ibc/applications/transfer/v1/tx.proto#L41

As you can see here, the memo field is missing:

uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];

Thank you!

@pyramation
Copy link
Collaborator

working on this now, will be using git submodules to get the latest. Had to make some updates to telescope for some new syntax that is popping up in here.

@pyramation
Copy link
Collaborator

tracking #35

@pyramation
Copy link
Collaborator

pyramation commented Apr 7, 2023

some amino messages have changed, not sure if this is the correct version of the SDK

-   "type": "cosmos-sdk/MsgVote",
+   "type": "cosmos-sdk/v1/MsgVote",
-   "type": "cosmos-sdk/MsgDeposit",
+   "type": "cosmos-sdk/v1/MsgDeposit",
-   "type": "cosmos-sdk/MsgWithdrawValidatorCommission",
+   "type": "cosmos-sdk/MsgWithdrawValCommission",

@nicolaslara
Copy link

The new amino names seem correct. It matches both the osmosis sdk fork and upstream:
https://github.com/osmosis-labs/cosmos-sdk/blob/6ed904cdb75fe08a9310e7df49eaf9c5b2b64692/proto/cosmos/distribution/v1beta1/tx.proto#L62
https://github.com/cosmos/cosmos-sdk/blob/59e5ca20b65a43896f4704f879f78358b060bc58/proto/cosmos/distribution/v1beta1/tx.proto#L101

This seems to have been introduced in November (cosmos/cosmos-sdk#13501) was the previous generation of osmojs older than that?

@pyramation
Copy link
Collaborator

ok cool, I've upgraded and published

@DavideSegullo
Copy link

Thank you! But it seems that "memo" fields are still missing, or am I missing something?

@nicolaslara
Copy link

@DavideSegullo
Copy link

Oh sorry, the linter probably hadn't updated and was still showing me the old type definitions, now it seems good, I'll give it a try!
Thank you for your support!

@DavideSegullo
Copy link

Everything seems okay to me, I even tested with transfer messages using the memo!

@giorgionocera
Copy link
Author

Yup, thank you, guys! 🙏
I think we're done with this issue. It can be closed.

@giorgionocera
Copy link
Author

We only saw that amino is not working with this message: it seems that the encoded message does not have the memo. But we do not know if it is an issue due to this implementation.
At the moment we are using the "sign direct".

@giorgionocera
Copy link
Author

My fault 😬 amino types are working. The signer called by cosmos-kit refers to not updated amino types. In fact, if you overwrite the default ones with the ones exported by osmojs, everything works smoothly.

I hope this could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants