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

Receive callback on ics-20 ack/timeout #1652

Closed
alpe opened this issue Mar 29, 2023 · 3 comments
Closed

Receive callback on ics-20 ack/timeout #1652

alpe opened this issue Mar 29, 2023 · 3 comments

Comments

@alpe
Copy link
Member

alpe commented Mar 29, 2023

Example:
Contract A on chain X sends an ics-20 transfer to chain Y. On ack/timeout the contract gets a callback when the ack/timeout is processed back to chain X.

Ideally this should work with other IBC app level messages, too.

Some useful data for the contract would be:

  • packet sequence
  • packet type: ics-20,...
  • operation: timeout or ack
  • success or failure
  • the contract may want to loop some metadata

Not sure if raw packet or ack data should be added.

I assume that we may need a new ibc message to return to handle this scenario differently than classic ics20 messages. Probably with a new entrypoint for the callback.

The IBC part can be implemented in wasmd with some additional middleware. There needs to be some way to prevent random ics-20 messages to call the contract callback.

This is inspired by adr-8

@alpe
Copy link
Member Author

alpe commented Apr 24, 2023

I was thinking today, that a popular ibc use case is nice start but a more generic approach would bring us in a much better position.
We should aim to support any custom or official protocol and let the contract handle the data on ack/ timeout itself. There can be support in the stdlib for data convertions like ics-20 but that would be a nice to have step.
A new endpoint for contracts would make sense so that they can receive the callback.
The ibc-go callback provides the following data:

  • packet channeltypes.Packet,
  • acknowledgement []byte,
  • relayer sdk.AccAddress,

The next question would be: how a contract can opt in to receive callbacks for certain packages?

Analogue to the ics-29 fees message, we could have a "un-/registerIBCCallback" Msg that can contain the package ID. Another option would be a "wildcard" for a sourcePortID, sourceChannelID pair. Or we support both

@webmaster128
Copy link
Member

Can this be closed if we do #1938?

@alpe
Copy link
Member Author

alpe commented Nov 8, 2023

yes, I had opened this to support ADR-8 use cases

@alpe alpe closed this as completed Nov 8, 2023
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

2 participants