pallet-revive: Adjust error handling of sub calls (#6741)
We were trapping the host context in case a sub call was exhausting the
storage deposit limit set for this sub call. This prevents the caller
from handling this error. In this PR we added a new error code that is
returned when either gas or storage deposit limit is exhausted by the
sub call.
We also remove the longer used `NotCallable` error. No longer used
because this is no longer an error: It will just be a balance transfer.
We also make `set_code_hash` infallible to be consistent with other host
functions which just trap on any error condition.
---------
Co-authored-by:
GitHub Action <action@github.com>
Showing
- prdoc/pr_6741.prdoc 16 additions, 0 deletionsprdoc/pr_6741.prdoc
- substrate/frame/revive/fixtures/contracts/caller_contract.rs 4 additions, 4 deletionssubstrate/frame/revive/fixtures/contracts/caller_contract.rs
- substrate/frame/revive/fixtures/contracts/create_storage_and_call.rs 5 additions, 3 deletions...rame/revive/fixtures/contracts/create_storage_and_call.rs
- substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs 5 additions, 3 deletions...vive/fixtures/contracts/create_storage_and_instantiate.rs
- substrate/frame/revive/fixtures/contracts/delegate_call_deposit_limit.rs 5 additions, 1 deletion.../revive/fixtures/contracts/delegate_call_deposit_limit.rs
- substrate/frame/revive/fixtures/contracts/set_code_hash.rs 1 addition, 1 deletionsubstrate/frame/revive/fixtures/contracts/set_code_hash.rs
- substrate/frame/revive/src/exec.rs 8 additions, 8 deletionssubstrate/frame/revive/src/exec.rs
- substrate/frame/revive/src/tests.rs 32 additions, 43 deletionssubstrate/frame/revive/src/tests.rs
- substrate/frame/revive/src/wasm/runtime.rs 16 additions, 30 deletionssubstrate/frame/revive/src/wasm/runtime.rs
- substrate/frame/revive/uapi/src/host.rs 6 additions, 6 deletionssubstrate/frame/revive/uapi/src/host.rs
- substrate/frame/revive/uapi/src/host/riscv64.rs 3 additions, 4 deletionssubstrate/frame/revive/uapi/src/host/riscv64.rs
- substrate/frame/revive/uapi/src/lib.rs 8 additions, 10 deletionssubstrate/frame/revive/uapi/src/lib.rs
Please register or sign in to comment