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 any redacted errors as events #1122

Open
nicolaslara opened this issue Dec 12, 2022 · 2 comments
Open

Emit any redacted errors as events #1122

nicolaslara opened this issue Dec 12, 2022 · 2 comments

Comments

@nicolaslara
Copy link

Since #759, any errors from submessages are redacted to avoid issues with non-determinism.

This means that a parent contract only has codespace/code as information to guess what happened and notify the user, which ends up leaving the user in the dark about what actually made their message fail.

A simple solution is to keep track of any errors generated in submessages and emit them as events. This leaves the interaction between contracts unaffected while surfacing the errors to the users (and contract devs in the process of debugging).

This can easily be implemented here: https://github.com/CosmWasm/wasmd/blob/main/x/wasm/keeper/msg_dispatcher.go#L150-L152 (or inside redactError if we pass the context)

@alpe
Copy link
Contributor

alpe commented Dec 19, 2022

Thanks for bringing attention to this topic. 👍

@alpe
Copy link
Contributor

alpe commented Jun 5, 2023

Events are emitted for successful TX, only.
There may be no need to redact the contract errors with CosmWasm/cosmwasm#1707

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