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

Improve error messages returned by TX execution #2958

Merged
merged 24 commits into from
Apr 12, 2024
Merged

Conversation

sug0
Copy link
Contributor

@sug0 sug0 commented Mar 26, 2024

Describe your changes

Closes #2673.

Return error messages from tx execution, instead of aborting execution with no context.

Indicate on which release or other PRs this topic is based on

#2940

Diff for review: https://github.com/anoma/namada/compare/tiago/wasm-errs-ux..tiago/tx-errs (in PR https://github.com/anoma/namada/pull/2958/files/620d3d8403794b818a03eddd391dc1153244319e..f707ee96ab8f3abdd45d1afac820a7ce53f6cd6a)

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@sug0 sug0 added enhancement New feature or request ledger UX client labels Mar 26, 2024
sug0 added a commit that referenced this pull request Mar 26, 2024
@sug0 sug0 marked this pull request as ready for review March 26, 2024 14:14
sug0 added a commit that referenced this pull request Mar 26, 2024
sug0 added a commit that referenced this pull request Mar 26, 2024
sug0 added a commit that referenced this pull request Mar 26, 2024
sug0 added a commit that referenced this pull request Mar 26, 2024
@@ -41,12 +41,13 @@ fn apply_tx(ctx: &mut Ctx, tx: Tx) -> TxResult {
.map_err(|err| {
ctx.set_commitment_sentinel();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in a future PR we could also get rid of this other sentinel just like you did for the vps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sug0 and others added 3 commits March 27, 2024 09:02
This change permits error messages to be encoded in the `Err` branch of
`Result` types, to facilitate debugging in case of software problems,
and to improve the user experience in Namada.
sug0 added a commit that referenced this pull request Mar 27, 2024
tzemanovic added a commit that referenced this pull request Apr 8, 2024
* origin/tiago/tx-errs:
  Changelog for #2958
  Charge gas for yielding values form txs/vps
  Rebuild wasms for tests
  Return errs from txs
  Link against tx yielding host fn
  Remove panics and improve err handling on tx wasms
  Yield byte array from txs
  Add yielded value tx host field
tzemanovic added a commit that referenced this pull request Apr 8, 2024
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Attention: Patch coverage is 36.55462% with 1057 lines in your changes are missing coverage. Please review.

Project coverage is 53.14%. Comparing base (5e0b162) to head (f707ee9).
Report is 4 commits behind head on main.

Files Patch % Lines
crates/namada/src/ledger/governance/mod.rs 0.00% 456 Missing ⚠️
crates/namada/src/ledger/native_vp/masp.rs 0.00% 155 Missing ⚠️
crates/namada/src/ledger/pgf/mod.rs 0.00% 104 Missing ⚠️
crates/vp_prelude/src/lib.rs 35.77% 79 Missing ⚠️
crates/namada/src/ledger/native_vp/mod.rs 36.00% 48 Missing ⚠️
crates/namada/src/ledger/pos/vp.rs 0.00% 42 Missing ⚠️
crates/namada/src/ledger/native_vp/multitoken.rs 62.68% 25 Missing ⚠️
...ledger/native_vp/ethereum_bridge/bridge_pool_vp.rs 83.46% 21 Missing ⚠️
crates/namada/src/ledger/native_vp/parameters.rs 27.27% 16 Missing ⚠️
crates/namada/src/vm/host_env.rs 87.09% 16 Missing ⚠️
... and 16 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2958      +/-   ##
==========================================
- Coverage   53.44%   53.14%   -0.30%     
==========================================
  Files         310      311       +1     
  Lines      101574   102150     +576     
==========================================
+ Hits        54288    54292       +4     
- Misses      47286    47858     +572     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tzemanovic added a commit that referenced this pull request Apr 10, 2024
* origin/tiago/tx-errs:
  Changelog for #2958
  Charge gas for yielding values form txs/vps
  Rebuild wasms for tests
  Return errs from txs
  Link against tx yielding host fn
  Remove panics and improve err handling on tx wasms
  Yield byte array from txs
  Add yielded value tx host field

# Conflicts:
#	wasm/wasm_source/src/tx_init_account.rs
#	wasm/wasm_source/src/tx_resign_steward.rs
#	wasm/wasm_source/src/tx_transfer.rs
#	wasm/wasm_source/src/tx_update_steward_commission.rs
#	wasm_for_tests/tx_fail.wasm
#	wasm_for_tests/tx_memory_limit.wasm
#	wasm_for_tests/tx_mint_tokens.wasm
#	wasm_for_tests/tx_no_op.wasm
#	wasm_for_tests/tx_proposal_code.wasm
#	wasm_for_tests/tx_proposal_ibc_token_inflation.wasm
#	wasm_for_tests/tx_proposal_masp_reward.wasm
#	wasm_for_tests/tx_read_storage_key.wasm
#	wasm_for_tests/tx_write.wasm
#	wasm_for_tests/tx_write_storage_key.wasm
#	wasm_for_tests/vp_always_false.wasm
#	wasm_for_tests/vp_always_true.wasm
#	wasm_for_tests/vp_eval.wasm
#	wasm_for_tests/vp_memory_limit.wasm
#	wasm_for_tests/vp_read_storage_key.wasm
#	wasm_for_tests/wasm_source/src/lib.rs
@tzemanovic tzemanovic merged commit 0c24b71 into main Apr 12, 2024
16 of 19 checks passed
@tzemanovic tzemanovic deleted the tiago/tx-errs branch April 12, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction execution should return a more clear error
3 participants