* chore(deps): update rust crate cid to 0.10.0
* One has to update `cid` together with `multihash`
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ivan Boldyrev <ivan@fluence.one>
This PR intended to reduce stream usage scope in order to make AquaVM truly deterministic.
Refs: #297.
Co-authored-by: Ivan Boldyrev <ivan@fluence.one>
Co-authored-by: Anatoly Laskaris <github_me@nahsi.dev>
The current peer ID is passed as a new field of `TestRunParameters` named
`current_peer_id: String`, instead of creating an AVM with peer ID.
This is a breaking API change of `avm-interface` and `avm-server`.
1. Update wasm-bindgen in the wasm-air-beautify to make it buildable with rest of tree.
2. Rename `wasm-air-beautify` to `air-beautify-wasm`, to make it consistent
with other packages.
3. Implement github workflows to build and deploy the `air-beautify-wasm` package.
Try to parse the annotated AIR script with the standard parser to catch
to catch errors early with better error messages.
We do it in the `TestExecutor` only to make testing framwork parser
tests simplier. For user experience, it doesn't matter.
* seq_result` -> `seq_ok`; add `seq_err`
`seq_ok` and `seq_err` are consistent with `ok` and `err`, but produce
results sequentially.
* Accept `;;` and longer comments in the sexp parser
Currently they are just dropped, and resulting AIR has different
character positions in the error messages.
* Add "map" assertion
Lookup result in a map by service's first argument.
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).
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.
`air-trace run` subcommand allows to run AquaVM on any data, it allows to define most AquaVM inputs, providing defaults for most of them, and sets up either human-readable or JSON tracing output, the latter can be later processed by `air-trace stats`.
Anomaly data input is also supported, that is useful for slow data investigation.
Native execution mode can be used for native profiling. Please note, however, that current version cannot be built natively on Apple Sillicon processor yet, as invariably depends on the `avm-server` because of leaking types that should be refactored or hidden. The `--repeat` option can repeat the execution several times for the execution to dominate on input data reading and output.
High-level or rare calls have "info" trace level, instructions are "debug", and sub-instruction calls are "tracing". Over-detailed tracing can induce overhead that spoils timing data.
This PR adds two new methods in DataStore to determine anomaly and collect necessary data. Additionally
- a generic parameter of DataStore turned to be associative
- AVMOutcome contains additionally memory_delta and execution_time
Use pooled `avm::server::AVMRunner` instances of
air_iterpreter_server.wasm to reduce tests' running time. It avoids
repeated WASM loading and compilation.
On my hardware, `cargo test --release` execution time (precompiled)
decreases from almost 6 minutes to 1.5 minutes.