Description
Executor stdout needs to account for a lot of different data types and RPCs now:
- the final result;
- debug logs;
- reentrant calls;
- wasmedge statistics;
- wasmedge errors (early exit due to excessive resource consumption)
This means that stdout should provide clear start and end signals so that the executor interfaces can understand the nature of each piece of output. The structure might look like
start debug log { someLog: ... } end debug log start reentrant call { Z1K1: 'Z7', Z7K1: ... } end reentrant call start result { Z1K1: 'Z6', ... } end result [<datetime>] [info] ========== Statistics =========== # these are the wasmedge statistics
Some amount of stateful awareness is necessary because wasmegdge's timeout/gas/memory limits could cancel execution at any time, e.g.
start debug log { someLog: ... } end debug log start reentrant call [2024-03-29 00:24:09.675] [error] Create memory instance failed -- exceeded limit page size: 100 [2024-03-29 00:24:09.676] [error] Cost exceeded limit. Force terminate the execution. [2024-03-29 00:24:09.676] [error] In instruction: ref.func (0xd2) , Bytecode offset: 0x00000000 [2024-03-29 00:24:09.676] [error] At AST node: expression [2024-03-29 00:24:09.676] [error] At AST node: element segment [2024-03-29 00:24:09.676] [error] At AST node: element section [2024-03-29 00:24:09.676] [error] At AST node: module [2024-03-29 00:24:09.676] [info] ==================== Statistics ==================== ...
Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- executors send start/end signals before and after every discrete RPC or return value
- executor classes maintain awareness of current state and delegate accordingly
- executor classes' stdout parsing can identify anomalous exit conditions and respond accordingly
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist