iroha icon indicating copy to clipboard operation
iroha copied to clipboard

refactor(wasm): make wasm execution part of Instruction

Open aoyako opened this issue 7 months ago • 0 comments

First part of #5147 (Draft)

This PR refactors the following:

  1. Previously, in a transaction, a single wasm executable can be submitted instead of instructions. Here, WASM execution was transferred from the transaction level to the instruction level.

As a result:

  1. Multiple WASM can be submitted in contrast to a single executable.
  2. Custom executor can handle wasm-related call visit_execute_wasm_smartcontract.

Breaking changes:

  1. Replace Executable::Wasm to Executable::Instruction ( WasmExecutable<WasmSmartContract>).
  2. The errors related to the error in the WASM execution will be associated with Instruction in contrast to Transaction.
  3. Genesis transaction accepts WASM.

Issues to be addressed:

  1. Since WASM execution is now at the instruction level, the runtime (fuel) should be reused from the transaction (see smartcontract and trigger). It is planned to be addressed in https://github.com/hyperledger-iroha/iroha/issues/5494.

aoyako avatar Jun 12 '25 07:06 aoyako