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

Misleading error message could be improved on custom wasm code execution #3062

Closed
McDaan opened this issue Apr 11, 2024 · 2 comments · Fixed by #3757
Closed

Misleading error message could be improved on custom wasm code execution #3062

McDaan opened this issue Apr 11, 2024 · 2 comments · Fixed by #3757

Comments

@McDaan
Copy link
Contributor

McDaan commented Apr 11, 2024

Note

This issue has been submitted on behalf of the CosmicValidator and Mandragora teams, participants of the Namada Shielded Expedition.


When trying to execute the transaction from a custom wasm binary such as

namadac tx --owner mandragora --tx-path $HOME/.local/share/namada/shielded-expedition.88f17d1d14/wasm/tx_proposal_break.380dd66bea4edfe12c4fac70b5a81b4fada8f6d51ccaf3cd72f3bca3b3a0d28a.wasm --signing-keys mandragora --memo $MEMO

the following error is returned: Invalid tx deserialization.

After further investigation, It is our understanding that the cause of the error is the binary/tx not being part of Namada's allow-list. However, the error message is misleading as it seems to suggest that a format error of some sort caused it instead.

We recommend improving the error message to something more descriptive such as:

  • Transaction is not allow-listed
  • Wasm module is not allow-listed
  • Checksum doesn't match allowed transactions
@Rigorously
Copy link

Last time I tried something like that I received the error

The corresponding wasm code of the code path tx_code.wasm doesn't exist on chain

@cwgoes cwgoes added the client label Aug 27, 2024
@cwgoes cwgoes added this to the Nice to have and non-breaking milestone Aug 27, 2024
@brentstone
Copy link
Collaborator

brentstone commented Sep 5, 2024

I've been investigating this, and the cause is actually not because of absence from the tx whitelist. The --tx-path flag is meant to take a file in .tx format (usually from the output of a tx dump). Rather, a wasm file should be passed to --code-path, which correctly describes the error from not being in the whitelist. For example,

target/release/namadac tx --owner brent-0 --signing-keys brent-0 --code-path wasm_for_tests/tx_no_op.wasm --node $DO_NODE     
The corresponding wasm code of the code path wasm_for_tests/tx_no_op.wasm doesn't exist on chain.
Error: 
   0: Querying error: Wasm code path wasm_for_tests/tx_no_op.wasm does not exist on chain
   1: Wasm code path wasm_for_tests/tx_no_op.wasm does not exist on chain

Going to improve the error message and some help messages to make this very clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants