At the moment `Ap` state contains vector of generations, although the ap instruction itself allow to specify only one stream. It was done to support several streams in a result position in a future. But the current realization allows to handle empty vector that was implemented to support states for scalars and it turned out (for more info see #326) that states for scalars aren't actually needed.
Closes#355.
This PR refactors call merger of `TraceHandler`. Previously it requires `CallOutputValue` to determine a type of call output value (stream or scalar). And internally it checked correspondence between data result and call output type and return a error if they are not equal. Although execution engine component also had a match over these values and does nothing if they are not matched since `TraceHandler` did this job. This PR eliminate such behaviour and improve isolation of AquaVM modules.
feat(execution-engine): change behaviour of fold over streams
Change behaviour of fold over streams to make it more similar to pi-calculus channels/names (for more info see #333).
Closes#333.
BREAKING CHANGE:
The new stream behaviour is not compatible with old one, such as
```
(fold $stream iterator
(seq
(call ...)
(next iterator)))
```
will never end after this change (for more info again see #333).
* Get rid of unsafe code unless really necessary
* Add lint levels where appropriate
Some crates (air-beautifier, air-testing-framework) have lot of
rust_2018_idioms violations, that will be resolved later.
Testing framework for AquaVM
Its primary features are:
1. It generates services declaratively by annotation in the comments inserted just after calls.
2. Ephemeral network keeps each node's data and incoming data queue. The network can be also generated based on peer IDs featured in the script.
3. One can explicitly add additional peers and services.
The example of the script annotations:
```
(seq
(call "peer_1" ("service" "func") [] var) ; ok=42
(call "peer_2" ("service" "func") [var]) ; err={"ret_code": 1, "result":"no towel"}
)
```
Passing this script to `air_test_framework::TestExecutor::new(...)` will create a virtual network with peers "peer_1" and "peer_2" (and any peer you provide in the `TestRunParameters`), and the particular calls will return respective values.
Please note that autogenerated services use modified service name as a side channel for finding a correct value: "..{N}" is added to each service name (two dots and serial number). Be careful with service names taken from a variable.
* Refactor `avm-server` interface mod to new crate (#294)
The new crate name is `avm-interface`.
It allows to build fully native air-trace, including pure WASM build.
* Make fully native air-trace build
Unless `wasm` feature is enabled (default), fully native build is
produced. You may build WASM air-trace binary with
`cargo build --target wasm32-wasi --no-default-features --release -p air-trace`
* Fix tracing output on native air-trace build
Wrong option was used.
1. Introduce --runner-tracing-params for enable and disable tracing of runner.
2. Adjust some function's tracing levels to make default traces less noisy.
1. change names to use kebab naming:
`--call_results` -> `--call-results`
`--prev_data` -> `--prev-data`
2. rename `--runtime` option to `--interpreter`, and the associated env variable to `AIR_INTERPRETER_WASM_PATH`.
3. print trace into to stderr
Refs: VM-113.
Co-authored-by: ValeryAntopol