CosmWasm / CosmWasm/wasmd

SmartQuery errors are redacted

Open
#1,160 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
416
Forks
538
PR merge metrics
No merged PRs in 30d

Description

Currently if you execute a contract that does a SmartQuery to another contract and that query fails, the error message is redacted and you instead only receive `codespace: wasm, code: 9`, which makes it very difficult to figure out why the query failed, or even which query failed if the contract execution is complicated (could be any query in any other contract that the original contract calls). We should figure out a way to forward these errors while avoiding non-determinism issues discussed in #759.

See below of more context:

@ethanfrey Can we get some more insight on what kind of non-determinism this is trying to avoid? I have been spending the past several days trying to track down a smart contract bug, and it would have taken only minutes if the contract error from a SmartQuery were forwarded all the way to the transaction rather than being redacted to `codespace: wasm, code: 9`. If at all possible, I think fixing the propagation of simple SmartQuery errors would be the single most high impact fix for CosmWasm developer quality of life. I only did brief reading of the link in the first post here, but it seems that the non-determinism has to do with Interchain Accounts, so could regular smart contract query errors be passed on without issues? If not, could we at least make it so that the address of the queried contract is included or even the QueryMsg? Even this would speed up debugging by orders of magnitude.

_Originally posted by @apollo-sturdy in https://github.com/CosmWasm/wasmd/issues/759#issuecomment-1386927341_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.