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

fix(engine): return engine error from instruction invocation #655

Merged
merged 3 commits into from
Aug 15, 2023

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Aug 11, 2023

Description

fix(engine): return engine error from instruction invocation
fix: only unlock on abort if inputs were originally locked
fix(wallet): propagate result error from vn to wallet cli
fix(wallet/cli): enable amounts bigger than u32::MAX to be input as an arg

Motivation and Context

Hook up errors returned by the runtime to the final transaction result. This takes precedence over a panic (which MUST always occur after an engine error).

Hook up the result properly so that it is returned even when the transaction is aborted. This allows the client to get the actual error that occurred during execution.

How Has This Been Tested?

New engine unit test that performs an invalid engine call, the WASM panics and we check that the result includes the underlying engine error rather than the null ptr panic error.
Manually, send more funds than available.

What process can a PR reviewer use to test or verify this change?

Create a wallet and send more funds than available, the error is now output rather than a unknown error or WASM panic text

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

@github-actions
Copy link

github-actions bot commented Aug 11, 2023

Test Results (CI)

128 tests  +1   128 ✔️ +1   1h 19m 55s ⏱️ - 1h 14m 26s
  42 suites ±0       0 💤 ±0 
    2 files   ±0       0 ±0 

Results for commit 3c8e589. ± Comparison against base commit ac8ddb9.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

Nice, much simpler than what I was trying to do

Copy link
Contributor

@Cifko Cifko left a comment

Choose a reason for hiding this comment

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

cool, the new error message Fee transaction rejected: Shard was rejected: Validators decided to abort: Execution failure: Runtime error: Resource did not contain sufficient balance: Bucket contained insufficient revealed funds. Required: 1500, Available: 100 this will be super useful when testing

Merged via the queue into tari-project:development with commit a52f4b7 Aug 15, 2023
9 checks passed
@sdbondi sdbondi deleted the engine-error-details branch August 16, 2023 05:29
sdbondi added a commit to sdbondi/tari-dan that referenced this pull request Aug 16, 2023
* development:
  fix!: peer sync (tari-project#657)
  fix(vn/ui): committee bucket information (tari-project#656)
  fix(engine): return engine error from instruction invocation  (tari-project#655)
  fix(walletd): fix race condition causing transaction to be marked as invalid (tari-project#654)
  ci: double test timeout
  fix(vn-webui): fix incorrect jsonrpc address (tari-project#645)
  fix: add feeclaim_xxx address parsing (tari-project#648)
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.

4 participants