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>
* Introduce multiline call annotations
Call annotations have same format as `;`-annotations, but can allow
multiline JSON literals. They look like `#| ... |#` (that's Common Lisp syntax for multiline comments).
For example:
```
(call "peer_id" ("serv" "func") [a b] var) #|
map = {
"0": null,
"default": 42,
}
|#
```
* A JSON in the assertion parser doesn't have be last
We have been using nom's `rest` for JSON values. Now we have a simple JSON parser
that recognizes JSON to be parsed with `serde_json`, and may have multiple JSON objects
within same assertion.
* Allow annotation after a compound form
It is attached to a rightmost nested element that has to be a `call` special form.
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. Network can be shared between several execution, being used by an Rc-handle.
2. The neighborhood is just network's all peers with removed/inserted hosts delta with respect to network.
3. An AIR script is transformed into a separate value of type `TransformedAirScript`. It allows running several
particles on the same parsed AIR script, sharing state.
4. `TestExecutor` was renamed to `AirScriptExecutor`. It also has a constructor that accepts a `TransformedAirScript`.
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.
Validator checks that stream used in `canon` is populated by a value in a supplied script. This PR removes this check, because it's useful for code generation.
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.