44 Commits

Author SHA1 Message Date
Valery Antopol
bf9414e8d4
feat(runtime)!: switch to async marine (#815)
* bench results for sync marine

* WIP

* start updating tests

* most of initial issues fixed

* tests compile without warnings

* rustfmt

* merge with master

* use git dependency

* merge fix + fmt

* fix bench builder

* add Cargo.lock

* fix + fmt after merge

* fix build with latest marine

* use released marine
2024-04-15 19:17:17 +04:00
Ivan Boldyrev
0d53f2bab1
feat(execution-engine): Rc-based JSON value (#813)
Use custom JSON value type with Rc inside.  It cannot be edited, but producing new values based on child element is very cheap.

This new type is used exclusively in AquaVM internals.  Interface APIs use serde_json's Value or JSON strings, as before.
---------

Co-authored-by: raftedproc <71657594+raftedproc@users.noreply.github.com>
2024-02-13 19:11:21 +07:00
Mike Voronov
0a8827bb3c
chore: use resolver 2 and 2021 edition (#769) 2023-12-18 18:48:46 +03:00
Ivan Boldyrev
771d42dec4
feat(data)!: flexible serialization formats (#757)
New crate air_interpreter_sede introduces a flexible serialization and deserialization infrastructure.

Low level API: the Format trait and related. It includes simple and universal mechanisms for serializing any possible (e.g. implementing the Serde traits) value.

High level API: Representation trait and related. It allows declaring representation types that can serialize and deserialize only certain types (for example, InterpreterDataRepr can serialize only the InterpreterData, but deserialize InterpreterData and Versions` types), producing newtype values as serialization results.

The serialized representation of CallResults now contains byte arrays, not strings, because the new infrastructure serializes to byte arrays only.

Also, the basic support for multicodecs is added.
2023-12-15 21:23:09 +07:00
Valery Antopol
7a8a460572
feat(polyplets)!: move SecurityTetraplets to marine-rs-sdk (#674)
* wip

* remove patch.crates-io section

* switch from Into to From

* fmt + Cargo.lock update

* try use marine-rs-sdk 0.9.0

* Revert "try use marine-rs-sdk 0.9.0"

This reverts commit 603c18fb71e88c2ad9f221990bb0bca4fc053dca.
2023-08-17 00:04:36 +03:00
Ivan Boldyrev
f8b734abde
feat(aquavm-air,air-interpreter-signature,air-interpreter-data)!: Peer signatures (#598)
A peer signs the multiset of call results and canon results it has produced.

New field signatures, a map from peer public key to signature, is added to the interpreter data.

Signatures verification is yet to be done.
2023-05-15 22:21:57 +07:00
Ivan Boldyrev
79ac153f1d
feat(tools): merge some tools into the air CLI tool (#509)
* feat(tools): merge some tools into the `air` CLI tool

`air-beautify` and `air-trace` are merged into a single `air` tool.  Its
crate name is `fluence-air-cli` as otherwise it confilicts with `air`
interpreter crate.  The tool has subcommands `beautify`, `run`
and `stats`.

* Add one-letter aliases to `air` CLI subcommands

+ `air beautify` => `air b`
+ `air run` => `air r`
+ `air stats` => `air s`

---------

Co-authored-by: Mike Voronov <michail.vms@gmail.com>
2023-03-15 16:59:30 +07:00
Ivan Boldyrev
5fdc8e68ac
feat(tools): VM-194 performance metering (#440)
* Experimental performance metering
* Average on repeated runs with `--repeat` option
* Add "version" field to the report
The version is got from `air/Cargo.toml`.

* Allow disabling preparing binaries
with the `--no-prepare-binaries` option.

* Human-readable execution time in the report

* Add dashboard benchmark
* Human-readable text report
2023-02-03 23:26:06 +07:00
Ivan Boldyrev
0226c062f8
feat!(execution-engine): Store call executed values as CIDs in the data (#401)
The trace stores CID strings for call result values.  These strings are to be resolved to real values with `InterpreterData::cid_store` map.
2022-12-26 15:45:14 +07:00
Ivan Boldyrev
ea934ab9a9
air-beautify-wasm in the tree (#336)
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.
2022-10-25 14:54:51 +07:00
Ivan Boldyrev
b929614b4c
wasm-air-beautify WASM module (#325)
It provides a `beautify` method to output a "beautified"
(python-style formatted) AIR script.

The method returns a string or raises an exception.
2022-09-19 19:31:12 +07:00
Ivan Boldyrev
513eb0e126
Testing framework, chapter I (#293)
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.
2022-09-01 18:12:55 +07:00
Ivan Boldyrev
5c7e88e0f2
Refactor avm-server interface mod to new crate (#294)
* 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.
2022-08-19 16:29:21 +07:00
Ivan Boldyrev
c3cea695c8
air-trace util for measuring AquaVM performance with tracing crate.
`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.
2022-07-07 18:44:58 +07:00
Ivan Boldyrev
1c0ff2c979
air-beautifier lib and air-beautify binary (#266)
The `air-beautify` util takes an AIR script input with Lisp-like syntax
and transforms it into experimental indentation-based syntax.

Closing #184.
2022-05-20 21:07:22 +07:00
Valery Antopol
44c87097c7
remove patch (#258) 2022-04-26 13:29:16 +03:00
Valery Antopol
298d796c09
update faas & app-service (#257) 2022-04-26 13:12:10 +03:00
Mike Voronov
d9f10cb26d
Deduplicate SecuityTetraplet with marine-rs-sdk (#164) 2021-11-04 16:59:05 +03:00
Mike Voronov
1c55d34981
Use custom logic for lambda instead of json path (#154) 2021-10-18 23:23:30 +03:00
Mike Voronov
4251a36842
decouple instruction tracker to a separate crate (#160) 2021-10-15 14:26:46 +03:00
Mike Voronov
e282a93ce7
Delete double description field from Cargo.toml (#155) 2021-10-15 12:19:33 +03:00
Mike Voronov
582d07d2bb
fix issue 143 (#144) 2021-10-11 12:17:30 +03:00
Mike Voronov
f291c77d26
Update crate info; housekeeping (#153) 2021-10-05 20:08:10 +03:00
Mike Voronov
e99c352a95
Decouple log targets to a separate crate (#152) 2021-10-05 16:55:04 +03:00
Mike Voronov
adba9e8e65
Decouple trace handler (#150) 2021-10-05 14:07:38 +03:00
Mike Voronov
4a4fc0889b
Make interpreter async (#130)
Co-authored-by: folex <0xdxdy@gmail.com>
Co-authored-by: Pavel Murygin <pavel.murygin@gmail.com>
2021-10-04 10:58:00 +03:00
Mike Voronov
3c86d36566
Introduce CRDT data (#74) 2021-08-24 16:14:15 +03:00
Mike Voronov
7cb636a02e
Refactor tests (#104) 2021-05-16 22:52:22 +03:00
Mike Voronov
2ac0304d3e
Rename Aqua to AIR, move AVM from FCE (#99) 2021-05-10 14:25:34 +03:00
vms
e5244db6a1
Rename stepper to interpreter (#67) 2021-02-17 23:36:36 +03:00
vms
7241175472
Introduce security tetraplets (#32) 2020-12-22 21:05:04 +03:00
vms
0f9ec42b1a
New stepper outcome (#39) 2020-12-17 21:44:24 +03:00
folex
bf78530156
Automatically release to crates.io & NPM (#38) 2020-12-16 21:59:11 +03:00
folex
1786ab8f4b
LALRPOP parser for AIR (#13) 2020-11-03 17:43:58 +03:00
vms
fbca76444b
New data format (#12) 2020-10-30 20:29:05 +03:00
vms
6e754f023f
Introduce Seq, Par, Fold instructions (#5) 2020-10-08 12:43:23 +03:00
vms
d5527b75a4 the first prototype of request-response stepper 2020-09-30 20:23:32 +03:00
vms
030a4c9069 rename main to fce, lib to wasm_bindgen 2020-09-30 11:58:53 +03:00
Dima
f6541aae32
Bindgen support (#2) 2020-09-30 11:42:18 +03:00
vms
00fe26b6db change path 2020-09-28 18:21:23 +03:00
vms
26626fdc8d poor call implementation 2020-09-28 15:40:27 +03:00
vms
aee41603e8 first prototype 2020-09-24 12:55:29 +03:00
vms
0bba055ad5 return data instead of script; update binary 2020-09-22 16:27:33 +03:00
vms
247e0b00a9 introduce echo-stepper 2020-09-21 14:11:34 +03:00