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

Emit event for ibc error returned #1288

Closed
alpe opened this issue Mar 23, 2023 · 0 comments
Closed

Emit event for ibc error returned #1288

alpe opened this issue Mar 23, 2023 · 0 comments
Assignees
Milestone

Comments

@alpe
Copy link
Contributor

alpe commented Mar 23, 2023

The json returned for contract errors on IBC package receive is redacted:

{"error":"ABCI code: 5: error handling packet: see events for details"}`

It is the responsibility of the application developer to emit error details in events.

https://github.com/cosmos/ibc-go/pull/1565/files#diff-c84c5415c1edd86b6332b4c8e95c325d4551550993fafc997bf9453a81f1b192R31

Update:

With the work in #1220 and #1289 there should not be any need for emitting the original error message as event. The contract's error string is included in the error Ack.
But this is not the case for sub-messages that fail. See https://github.com/cosmos/ibc-go/blob/v7.0.0/modules/apps/transfer/ibc_module.go#L202 for an example event

In ibc-go all events are emitted on error Ack as well. This is a different behaviour than we have with other contract calls.
There are 2 cases to consider:

  1. the contract returns an error Ack and events
  2. the contract returns a success Ack but any of the sub-messages returned fails

As a simple solution, we can drop all events on error Ack in wasm/ibc.go
Or we always accept contract events but drop sub-message events on error in keeper/relay.go.

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

1 participant