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

How to write acknowledgement (commitments) in the IBC module? #26

Closed
livelybug opened this issue Nov 1, 2021 · 9 comments
Closed

How to write acknowledgement (commitments) in the IBC module? #26

livelybug opened this issue Nov 1, 2021 · 9 comments

Comments

@livelybug
Copy link

Hello,

I have a question about the usage of the function Writing acknowledgments.

In the life cycle of a packet, there's a functionWriting acknowledgements.

After reading the PR about it, no suggestion on the integration was found.

Is there any suggested place to call the function Writing acknowledgments?
How about ibc-rs provides an option to call the function after this line?

Or it's suggested to call the function on the IBC app?

Thank you

@adizere
Copy link
Contributor

adizere commented Nov 2, 2021

Hello,

Is there any suggested place to call the function Writing acknowledgments?

I think writing acknowledgement (commitments) should be done as part of the method ChannelKeeper::store_packet_commitment. An example implementation is in the Mock Context:

https://github.com/informalsystems/ibc-rs/blob/8212fc8ebaa0a51fb45bc04cc656f42eab1cee68/modules/src/mock/context.rs#L674-L685

Let me know if this makes sense or further details would be of help!

@adizere adizere changed the title usage of write_acknowledgement.rs How to write acknowledgement (commitments) in the IBC module? Nov 3, 2021
@boern
Copy link

boern commented Nov 21, 2021

Hi,guys:
I think the best time is after the application layer callback interface returns the ACK and then writes the ACK to the chain. Please refer to icS26 and IBC-Go for details.

@adizere
Copy link
Contributor

adizere commented Nov 22, 2021

Hi,guys:
I think the best time is after the application layer callback interface returns the ACK and then writes the ACK to the chain. Please refer to icS26 and IBC-Go for details.

Thank you for your feedback.

I agree. The method I described earlier, ChannelKeeper::store_packet_commitment is consistent with your suggestion to use the ICS26-level handling logic. We call that logic ChannelKeeper.

@yito88
Copy link
Contributor

yito88 commented Apr 19, 2022

I have a question about how to make an acknowledgment. I'm not sure that it is good to ask about it here.
I tried to use ibc_proto::ibc::core::channel::v1::Acknowledgement. However, it couldn't be serialized as that of ibc-go. Cosmos(gaiad) couldn't verify the ack.
https://github.com/cosmos/ibc-go/blob/457095517b7832c42ecf13571fee1e550fec02d0/modules/core/04-channel/types/acknowledgement.go#L58-L60

@adizere
Copy link
Contributor

adizere commented Apr 21, 2022

I have a question about how to make an acknowledgment. I'm not sure that it is good to ask about it here.
I tried to use ibc_proto::ibc::core::channel::v1::Acknowledgement. However, it couldn't be serialized as that of ibc-go. Cosmos(gaiad) couldn't verify the ack.
https://github.com/cosmos/ibc-go/blob/457095517b7832c42ecf13571fee1e550fec02d0/modules/core/04-channel/types/acknowledgement.go#L58-L60

Is this related to informalsystems/hermes#2105 ? If so, we'll have a look there.

@yito88
Copy link
Contributor

yito88 commented Apr 21, 2022

It's not related to informalsystems/hermes#2105.
I mean I want to know how to encode/decode the acknowledgment like ibc-go.
In ibc-go, it is encoded as JSON. Then, ibc-go hashes the encoded value and stores it to the storage.
https://github.com/cosmos/ibc-go/blob/13df199d70c4e3bd55419182270413491ee8a6d1/modules/core/04-channel/types/acknowledgement.go#L61
I also have the same issue for ibc_proto::ibc::applications::transfer::v2::FungibleTokenPacketData.

@hu55a1n1
Copy link
Contributor

Hi @yito88! We're currently working on ICS20 in informalsystems/hermes#1989. Here's how we are handling serde for PacketData -> https://github.com/informalsystems/ibc-rs/pull/1989/files#diff-8f9bde3d68bd2354e1fa18e322a80e0c6d0b595d6b281db282116f948b44b8d5R305

@yito88
Copy link
Contributor

yito88 commented Apr 21, 2022

@hu55a1n1 Thank you for sharing!

@hu55a1n1 hu55a1n1 transferred this issue from informalsystems/hermes Sep 28, 2022
@plafer
Copy link
Contributor

plafer commented Dec 13, 2022

Closing this as stale; if this is still an issue please open a new question in the discussion tab.

@plafer plafer closed this as completed Dec 13, 2022
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

6 participants