From e5244db6a12034022a6750f5352583d0b3885401 Mon Sep 17 00:00:00 2001 From: vms Date: Wed, 17 Feb 2021 23:36:36 +0300 Subject: [PATCH] Rename stepper to interpreter (#67) --- .circleci/config.yml | 6 +- .github/workflows/aquamarine_tag_release.yml | 2 +- .github/workflows/publish_interpreter.yml | 10 +- .github/workflows/publish_interpreter_dev.yml | 8 +- .gitignore | 2 +- CHANGELOG.md | 2 +- Cargo.lock | 189 ++++++++++++------ Cargo.toml | 10 +- README.md | 2 +- crates/air-interpreter-wasm/Cargo.lock | 2 +- crates/air-interpreter-wasm/Cargo.toml | 2 +- crates/air-parser/benches/parser.rs | 3 +- .../Cargo.toml | 8 +- .../src/lib.rs | 23 ++- crates/test-utils/Cargo.toml | 2 +- crates/test-utils/src/lib.rs | 2 +- .../.rustfmt.toml | 0 {stepper-lib => interpreter-lib}/Cargo.toml | 8 +- .../benches/call_benchmark.rs | 4 +- .../benches/chat_benchmark.rs | 4 +- .../benches/create_service_benchmark.rs | 4 +- {stepper-lib => interpreter-lib}/src/aqua.rs | 6 +- .../src/aqua/outcome.rs | 30 +-- .../src/build_targets/fce_target.rs | 0 .../src/build_targets/mod.rs | 0 .../src/build_targets/wasm_bindgen_target.rs | 0 .../src/contexts/execution_context.rs | 0 .../src/contexts/execution_context/avalue.rs | 0 .../src/contexts/execution_trace_context.rs | 4 +- .../execution_trace_context/executed_state.rs | 0 .../src/contexts/mod.rs | 0 .../src/execution/air/call.rs | 0 .../src/execution/air/call/resolved_call.rs | 0 .../src/execution/air/call/triplet.rs | 0 .../src/execution/air/call/utils.rs | 0 .../compare_matchable/compare_matchable.rs | 0 .../execution/air/compare_matchable/mod.rs | 0 .../src/execution/air/fold.rs | 4 +- .../src/execution/air/fold/utils.rs | 0 .../src/execution/air/match_.rs | 0 .../src/execution/air/mismatch.rs | 0 .../src/execution/air/mod.rs | 0 .../src/execution/air/null.rs | 0 .../src/execution/air/par.rs | 0 .../src/execution/air/seq.rs | 0 .../src/execution/air/xor.rs | 0 .../src/execution/boxed_value/iterable.rs | 0 .../boxed_value/iterable/json_path_result.rs | 0 .../boxed_value/iterable/resolved_call.rs | 0 .../iterable/vec_json_path_result.rs | 0 .../boxed_value/iterable/vec_resolved_call.rs | 0 .../src/execution/boxed_value/jvaluable.rs | 0 .../cell_vec_resolved_call_result.rs | 0 .../boxed_value/jvaluable/iterable_item.rs | 0 .../jvaluable/resolved_call_result.rs | 0 .../src/execution/boxed_value/mod.rs | 0 .../src/execution/errors.rs | 0 .../src/execution/mod.rs | 0 .../src/execution/utils/mod.rs | 0 .../src/execution/utils/resolve.rs | 0 {stepper-lib => interpreter-lib}/src/lib.rs | 4 +- .../src/log_targets.rs | 0 .../src/preparation/data_merging.rs | 0 .../src/preparation/errors.rs | 2 +- .../src/preparation/mod.rs | 0 .../src/preparation/preparation.rs | 0 .../tests/air_basic.rs | 17 +- .../tests/build_test_binaries.sh | 0 .../tests/call_evidence_basic.rs | 29 +-- .../tests/dashboard.rs | 0 .../tests/dashboard/peers | 0 .../tests/data_merge.rs | 8 +- .../tests/join.rs | 24 ++- .../tests/last_error.rs | 2 +- .../tests/network_explore.rs | 0 .../tests/scripts/create_service.clj | 0 .../tests/scripts/create_service_with_xor.clj | 0 .../tests/scripts/dashboard.clj | 0 .../tests/scripts/network_explore.clj | 0 .../tests/security_tetraplets.rs | 10 +- .../auth_module/Cargo.lock | 8 +- .../auth_module/Cargo.toml | 2 +- .../auth_module/src/main.rs | 0 .../log_storage/Cargo.lock | 8 +- .../log_storage/Cargo.toml | 2 +- .../log_storage/src/main.rs | 0 {stepper => interpreter}/.rustfmt.toml | 0 {stepper => interpreter}/Cargo.toml | 6 +- {stepper => interpreter}/src/ast.rs | 2 +- {stepper => interpreter}/src/fce.rs | 6 +- {stepper => interpreter}/src/logger.rs | 2 +- {stepper => interpreter}/src/wasm_bindgen.rs | 4 +- 92 files changed, 284 insertions(+), 189 deletions(-) rename crates/{stepper-interface => interpreter-interface}/Cargo.toml (56%) rename crates/{stepper-interface => interpreter-interface}/src/lib.rs (84%) rename {stepper-lib => interpreter-lib}/.rustfmt.toml (100%) rename {stepper-lib => interpreter-lib}/Cargo.toml (88%) rename {stepper-lib => interpreter-lib}/benches/call_benchmark.rs (88%) rename {stepper-lib => interpreter-lib}/benches/chat_benchmark.rs (96%) rename {stepper-lib => interpreter-lib}/benches/create_service_benchmark.rs (96%) rename {stepper-lib => interpreter-lib}/src/aqua.rs (91%) rename {stepper-lib => interpreter-lib}/src/aqua/outcome.rs (77%) rename {stepper-lib => interpreter-lib}/src/build_targets/fce_target.rs (100%) rename {stepper-lib => interpreter-lib}/src/build_targets/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/build_targets/wasm_bindgen_target.rs (100%) rename {stepper-lib => interpreter-lib}/src/contexts/execution_context.rs (100%) rename {stepper-lib => interpreter-lib}/src/contexts/execution_context/avalue.rs (100%) rename {stepper-lib => interpreter-lib}/src/contexts/execution_trace_context.rs (92%) rename {stepper-lib => interpreter-lib}/src/contexts/execution_trace_context/executed_state.rs (100%) rename {stepper-lib => interpreter-lib}/src/contexts/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/call.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/call/resolved_call.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/call/triplet.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/call/utils.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/compare_matchable/compare_matchable.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/compare_matchable/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/fold.rs (99%) rename {stepper-lib => interpreter-lib}/src/execution/air/fold/utils.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/match_.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/mismatch.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/null.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/par.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/seq.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/air/xor.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/iterable.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/iterable/json_path_result.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/iterable/resolved_call.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/iterable/vec_json_path_result.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/iterable/vec_resolved_call.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/jvaluable.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/jvaluable/cell_vec_resolved_call_result.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/jvaluable/iterable_item.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/jvaluable/resolved_call_result.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/boxed_value/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/errors.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/utils/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/execution/utils/resolve.rs (100%) rename {stepper-lib => interpreter-lib}/src/lib.rs (92%) rename {stepper-lib => interpreter-lib}/src/log_targets.rs (100%) rename {stepper-lib => interpreter-lib}/src/preparation/data_merging.rs (100%) rename {stepper-lib => interpreter-lib}/src/preparation/errors.rs (98%) rename {stepper-lib => interpreter-lib}/src/preparation/mod.rs (100%) rename {stepper-lib => interpreter-lib}/src/preparation/preparation.rs (100%) rename {stepper-lib => interpreter-lib}/tests/air_basic.rs (90%) rename {stepper-lib => interpreter-lib}/tests/build_test_binaries.sh (100%) rename {stepper-lib => interpreter-lib}/tests/call_evidence_basic.rs (93%) rename {stepper-lib => interpreter-lib}/tests/dashboard.rs (100%) rename {stepper-lib => interpreter-lib}/tests/dashboard/peers (100%) rename {stepper-lib => interpreter-lib}/tests/data_merge.rs (97%) rename {stepper-lib => interpreter-lib}/tests/join.rs (91%) rename {stepper-lib => interpreter-lib}/tests/last_error.rs (98%) rename {stepper-lib => interpreter-lib}/tests/network_explore.rs (100%) rename {stepper-lib => interpreter-lib}/tests/scripts/create_service.clj (100%) rename {stepper-lib => interpreter-lib}/tests/scripts/create_service_with_xor.clj (100%) rename {stepper-lib => interpreter-lib}/tests/scripts/dashboard.clj (100%) rename {stepper-lib => interpreter-lib}/tests/scripts/network_explore.clj (100%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets.rs (97%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets/auth_module/Cargo.lock (99%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets/auth_module/Cargo.toml (79%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets/auth_module/src/main.rs (100%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets/log_storage/Cargo.lock (99%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets/log_storage/Cargo.toml (79%) rename {stepper-lib => interpreter-lib}/tests/security_tetraplets/log_storage/src/main.rs (100%) rename {stepper => interpreter}/.rustfmt.toml (100%) rename {stepper => interpreter}/Cargo.toml (83%) rename {stepper => interpreter}/src/ast.rs (96%) rename {stepper => interpreter}/src/fce.rs (92%) rename {stepper => interpreter}/src/logger.rs (95%) rename {stepper => interpreter}/src/wasm_bindgen.rs (92%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 04dfcefe..db80a877 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,11 +22,11 @@ jobs: cargo install fcli - # build a Wasm binary for stepper - (cd stepper; fce build --features fce) + # build a Wasm binary for interpreter + (cd interpreter; fce build --features fce) # build Wasm binaries for tests - (cd stepper-lib/tests/; ./build_test_binaries.sh) + (cd interpreter-lib/tests/; ./build_test_binaries.sh) cargo fmt --all -- --check --color always cargo check diff --git a/.github/workflows/aquamarine_tag_release.yml b/.github/workflows/aquamarine_tag_release.yml index fcfb7dc0..96a0bff8 100644 --- a/.github/workflows/aquamarine_tag_release.yml +++ b/.github/workflows/aquamarine_tag_release.yml @@ -36,7 +36,7 @@ jobs: command: update - name: fce build --release - working-directory: ./stepper + working-directory: ./interpreter shell: bash run: fce build --release --features fce diff --git a/.github/workflows/publish_interpreter.yml b/.github/workflows/publish_interpreter.yml index b18ca506..1197d8e7 100644 --- a/.github/workflows/publish_interpreter.yml +++ b/.github/workflows/publish_interpreter.yml @@ -64,11 +64,11 @@ jobs: # JQ version regex pattern PAT="\\\\d+.\\\\d+.\\\\d+" - STEPPER_CARGO_TOML="stepper/Cargo.toml" + STEPPER_CARGO_TOML="interpreter/Cargo.toml" CARGO_TOML="crates/air-interpreter-wasm/Cargo.toml" # get package name from Cargo.toml RS_PKG_NAME="$(toml get "$CARGO_TOML" package.name | tr -d \")" - JS_PKG_NAME="@fluencelabs/aquamarine-stepper" + JS_PKG_NAME="@fluencelabs/aquamarine-interpreter" # get version from Cargo.toml STEPPER_RUST_VERSION="$(toml get "$STEPPER_CARGO_TOML" package.version | tr -d \")" @@ -97,7 +97,7 @@ jobs: continue-on-error: true - name: Build aquamarine.wasm for JS clients - run: wasm-pack build $GITHUB_WORKSPACE/stepper --no-typescript --release -d $(pwd)/pkg + run: wasm-pack build $GITHUB_WORKSPACE/interpreter --no-typescript --release -d $(pwd)/pkg - name: Generate aquamarine.wasm.base64.js run: | @@ -105,7 +105,7 @@ jobs: module.exports = "$(base64 -w0 pkg/aquamarine_client_bg.wasm)"; EOF - ### Generate index files so import works as: | import {wasmBs64} from "@fluencelabs/aquamarine-stepper"; | + ### Generate index files so import works as: | import {wasmBs64} from "@fluencelabs/aquamarine-interpreter"; | - name: Generate index.js & index.d.ts run: | cat << EOF > index.js @@ -175,7 +175,7 @@ jobs: - name: Build aquamarine.wasm for node run: fce build --release -p aquamarine --features fce - working-directory: stepper + working-directory: interpreter - name: Copy aquamarine.wasm to air-interpreter-wasm run: cp target/wasm32-wasi/release/aquamarine.wasm crates/air-interpreter-wasm/aquamarine.wasm diff --git a/.github/workflows/publish_interpreter_dev.yml b/.github/workflows/publish_interpreter_dev.yml index c6507839..1cfacf61 100644 --- a/.github/workflows/publish_interpreter_dev.yml +++ b/.github/workflows/publish_interpreter_dev.yml @@ -79,7 +79,7 @@ jobs: # get package name from Cargo.toml PKG_NAME="$(toml get "$CARGO_TOML" package.name | tr -d \")" - JS_PKG_NAME="@fluencelabs/aquamarine-stepper" + JS_PKG_NAME="@fluencelabs/aquamarine-interpreter" ### NPM # take all versions from npm and replace single quotes with double quotes @@ -120,7 +120,7 @@ jobs: continue-on-error: true - name: Build aquamarine.wasm for JS clients - run: wasm-pack build $GITHUB_WORKSPACE/stepper --no-typescript --release -d $(pwd)/pkg + run: wasm-pack build $GITHUB_WORKSPACE/interpreter --no-typescript --release -d $(pwd)/pkg - name: Generate aquamarine.wasm.base64.js run: | @@ -128,7 +128,7 @@ jobs: module.exports = "$(base64 -w0 pkg/aquamarine_client_bg.wasm)"; EOF - ### Generate index files so import works as: | import {wasmBs64} from "@fluencelabs/aquamarine-stepper"; | + ### Generate index files so import works as: | import {wasmBs64} from "@fluencelabs/aquamarine-interpreter"; | - name: Generate index.js & index.d.ts run: | cat << EOF > index.js @@ -201,7 +201,7 @@ jobs: - name: Build aquamarine.wasm for node run: fce build -p aquamarine --release --features fce - working-directory: stepper + working-directory: interpreter - name: Copy aquamarine.wasm to air-interpreter-wasm run: cp target/wasm32-wasi/release/aquamarine.wasm crates/air-interpreter-wasm/aquamarine.wasm diff --git a/.gitignore b/.gitignore index 9b8a6718..6c41c426 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .idea/ **/target -stepper-lib/target +interpreter-lib/target .DS_Store .repl_history *.wasm diff --git a/CHANGELOG.md b/CHANGELOG.md index a79864d8..3dbbc725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ - Added new data format ([PR 12](https://github.com/fluencelabs/aquamarine/pull/12)): - previously data was a hashmap with variable names to values, and now it is call evidence path that contains call and par evidence states - logger is refactored and supports now several log targets - - stepper decoupled into two crates: `stepper-lib` and `stepper`. To build it for the FCE target the `fce` feature should be specified (`fce build --features fce`) + - interpreter decoupled into two crates: `interpreter-lib` and `interpreter`. To build it for the FCE target the `fce` feature should be specified (`fce build --features fce`) ## Version 0.1.1 (2020-10-23) diff --git a/Cargo.lock b/Cargo.lock index db08c5f2..bfae44e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,6 +41,26 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +[[package]] +name = "aqua-interpreter-interface" +version = "0.3.1" +dependencies = [ + "fluence", + "fluence-it-types", + "serde", +] + +[[package]] +name = "aqua-interpreter-interface" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c49b8a5fe1336a9c6981be09cb13706c7d9083e48588d692120b5080a13278" +dependencies = [ + "fluence", + "fluence-it-types", + "serde", +] + [[package]] name = "aqua-test-module" version = "0.1.0" @@ -59,29 +79,29 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.5.0" +version = "0.6.0" dependencies = [ "fluence", + "interpreter-lib", "log", "serde", "serde_json", - "stepper-lib", "wasm-bindgen", ] [[package]] name = "aquamarine-vm" -version = "0.1.29" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef719bebed9bf1a31ea528f677d891e914437924e7fc4f9fb3139b0e8cbadba3" +checksum = "170e51ff427660612f237ce4d3e4fd28218f080e97fcfc23ebd587bdac3379fa" dependencies = [ - "fluence-faas", + "aqua-interpreter-interface 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fluence-faas 0.2.0", "log", "maplit", "parking_lot 0.11.1", "serde", "serde_json", - "stepper-interface 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -641,9 +661,33 @@ checksum = "9deb5e4f0e1533694ffbfd3644b8047ae41e8098165cdf5934a60b71f82e30c9" dependencies = [ "boolinator", "fce-utils", - "fce-wit-generator", + "fce-wit-generator 0.1.30", "fce-wit-interfaces", - "fce-wit-parser", + "fce-wit-parser 0.1.29", + "log", + "multi-map", + "multimap", + "parity-wasm", + "pwasm-utils", + "safe-transmute", + "serde", + "wasmer-interface-types-fl", + "wasmer-runtime-core-fl", + "wasmer-runtime-fl", + "wasmer-wasi-fl", +] + +[[package]] +name = "fce" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e680149a26e9b74a140a143d624c1fe83f6a9d28daf8a12b2bdba261343a71" +dependencies = [ + "boolinator", + "fce-utils", + "fce-wit-generator 0.2.0", + "fce-wit-interfaces", + "fce-wit-parser 0.2.0", "log", "multi-map", "multimap", @@ -669,7 +713,22 @@ version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e19c183d232092a59aeaa4f22212699b3da2acf0bcc5329a9de2a7bb7aa9f87" dependencies = [ - "fce-wit-parser", + "fce-wit-parser 0.1.29", + "fluence-sdk-wit", + "once_cell", + "serde", + "serde_json", + "walrus", + "wasmer-interface-types-fl", +] + +[[package]] +name = "fce-wit-generator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eca715cf832f99fd59dae4f639e4437e5ac92a4470e0879624049f6cb1a3910" +dependencies = [ + "fce-wit-parser 0.2.0", "fluence-sdk-wit", "once_cell", "serde", @@ -702,6 +761,20 @@ dependencies = [ "wasmer-runtime-core-fl", ] +[[package]] +name = "fce-wit-parser" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f59267a5533d352406b7203eee4b9fe918f4671f2f66a990cab9632f528c952" +dependencies = [ + "anyhow", + "fce-wit-interfaces", + "serde", + "walrus", + "wasmer-interface-types-fl", + "wasmer-runtime-core-fl", +] + [[package]] name = "fixedbitset" version = "0.2.0" @@ -724,7 +797,7 @@ version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fb49d32cad551606cc6ef324b93b0079e7f7f8a54be15176a314098028195cb" dependencies = [ - "fluence-faas", + "fluence-faas 0.1.30", "log", "maplit", "serde", @@ -741,7 +814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a74511b8a8fc16e3cb3749631824b90f89cecb742cbbaf4e467a0873e34a5a53" dependencies = [ "cmd_lib", - "fce", + "fce 0.1.30", "fce-utils", "fluence-sdk-main", "itertools 0.9.0", @@ -757,6 +830,30 @@ dependencies = [ "wasmer-wasi-fl", ] +[[package]] +name = "fluence-faas" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0696945762ee0d5ed97537bdd0fa1c71957fc23794074ae035d428e90bedae5" +dependencies = [ + "cmd_lib", + "fce 0.2.0", + "fce-utils", + "fluence-sdk-main", + "itertools 0.9.0", + "log", + "safe-transmute", + "serde", + "serde_derive", + "serde_json", + "thiserror", + "toml", + "wasmer-interface-types-fl", + "wasmer-runtime-core-fl", + "wasmer-runtime-fl", + "wasmer-wasi-fl", +] + [[package]] name = "fluence-it-types" version = "0.1.1" @@ -974,6 +1071,31 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "interpreter-lib" +version = "0.6.0" +dependencies = [ + "air-parser", + "aqua-interpreter-interface 0.3.1", + "aqua-test-utils", + "boolinator", + "criterion", + "csv", + "env_logger", + "fluence", + "fluence-app-service", + "jsonpath_lib-fl", + "log", + "maplit", + "once_cell", + "polyplets", + "pretty_assertions", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", +] + [[package]] name = "inventory" version = "0.1.10" @@ -1673,51 +1795,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stepper-interface" -version = "0.1.2" -dependencies = [ - "fluence", - "fluence-it-types", - "serde", -] - -[[package]] -name = "stepper-interface" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95bde63566205ba83b6f55a61a1481a6c2a94fbac9d22d280f68232aab326d27" -dependencies = [ - "fluence", - "fluence-it-types", - "serde", -] - -[[package]] -name = "stepper-lib" -version = "0.5.0" -dependencies = [ - "air-parser", - "aqua-test-utils", - "boolinator", - "criterion", - "csv", - "env_logger", - "fluence", - "fluence-app-service", - "jsonpath_lib-fl", - "log", - "maplit", - "once_cell", - "polyplets", - "pretty_assertions", - "serde", - "serde_json", - "stepper-interface 0.1.2", - "thiserror", - "wasm-bindgen", -] - [[package]] name = "string_cache" version = "0.8.1" diff --git a/Cargo.toml b/Cargo.toml index efa284ee..fc522acb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,17 +2,17 @@ members = [ "crates/air-parser", "crates/polyplets", - "crates/stepper-interface", + "crates/interpreter-interface", "crates/test-module", "crates/test-utils", - "stepper", - "stepper-lib" + "interpreter", + "interpreter-lib" ] exclude = [ "crates/air-interpreter-wasm", - "stepper-lib/tests/security_tetraplets/auth_module", - "stepper-lib/tests/security_tetraplets/log_storage", + "interpreter-lib/tests/security_tetraplets/auth_module", + "interpreter-lib/tests/security_tetraplets/log_storage", ] [profile.release] diff --git a/README.md b/README.md index fa5452a0..a1c60b1d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![crates.io version](https://img.shields.io/crates/v/air-interpreter-wasm?style=flat-square)](https://crates.io/crates/air-interpreter-wasm) -[![npm version](https://img.shields.io/npm/v/@fluencelabs/aquamarine-stepper)](https://www.npmjs.com/package/@fluencelabs/aquamarine-stepper) +[![npm version](https://img.shields.io/npm/v/@fluencelabs/aquamarine-interpreter)](https://www.npmjs.com/package/@fluencelabs/aquamarine-interpreter) # Aquamarine diff --git a/crates/air-interpreter-wasm/Cargo.lock b/crates/air-interpreter-wasm/Cargo.lock index 844b8a39..ae9b0578 100644 --- a/crates/air-interpreter-wasm/Cargo.lock +++ b/crates/air-interpreter-wasm/Cargo.lock @@ -2,7 +2,7 @@ # It is not intended for manual editing. [[package]] name = "air-interpreter-wasm" -version = "0.0.8" +version = "0.1.0" dependencies = [ "built", ] diff --git a/crates/air-interpreter-wasm/Cargo.toml b/crates/air-interpreter-wasm/Cargo.toml index d302c130..e2fe4bf8 100644 --- a/crates/air-interpreter-wasm/Cargo.toml +++ b/crates/air-interpreter-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "air-interpreter-wasm" -version = "0.0.8" +version = "0.1.0" authors = ["Fluence Labs"] description = "Distribution of AIR interpreter as .wasm" license = "Apache-2.0" diff --git a/crates/air-parser/benches/parser.rs b/crates/air-parser/benches/parser.rs index 11fe0392..0ba36c02 100644 --- a/crates/air-parser/benches/parser.rs +++ b/crates/air-parser/benches/parser.rs @@ -152,7 +152,8 @@ fn parse_deep(c: &mut Criterion) { fn parse_dashboard_script(c: &mut Criterion) { let parser = Rc::new(AIRParser::new()); - const DASHBOARD_SCRIPT: &str = include_str!("../../../stepper-lib/tests/scripts/dashboard.clj"); + const DASHBOARD_SCRIPT: &str = + include_str!("../../../interpreter-lib/tests/scripts/dashboard.clj"); c.bench_function( format!("parse {} bytes", DASHBOARD_SCRIPT.len()).as_str(), diff --git a/crates/stepper-interface/Cargo.toml b/crates/interpreter-interface/Cargo.toml similarity index 56% rename from crates/stepper-interface/Cargo.toml rename to crates/interpreter-interface/Cargo.toml index a2856143..7b02b3be 100644 --- a/crates/stepper-interface/Cargo.toml +++ b/crates/interpreter-interface/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "stepper-interface" -description = "Interface of the Aquamarine stepper" -version = "0.1.2" +name = "aqua-interpreter-interface" +description = "Interface of the Aquamarine interpreter" +version = "0.3.1" authors = ["Fluence Labs"] edition = "2018" license = "Apache-2.0" [lib] -name = "stepper_interface" +name = "aqua_interpreter_interface" path = "src/lib.rs" [dependencies] diff --git a/crates/stepper-interface/src/lib.rs b/crates/interpreter-interface/src/lib.rs similarity index 84% rename from crates/stepper-interface/src/lib.rs rename to crates/interpreter-interface/src/lib.rs index 8c998ceb..83f603dd 100644 --- a/crates/stepper-interface/src/lib.rs +++ b/crates/interpreter-interface/src/lib.rs @@ -20,19 +20,19 @@ use fluence_it_types::IValue; use serde::Deserialize; use serde::Serialize; -pub const STEPPER_SUCCESS: i32 = 0; +pub const INTERPRETER_SUCCESS: i32 = 0; -/// Describes a result returned at the end of the stepper execution. +/// Describes a result returned at the end of the interpreter execution. #[fce] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct StepperOutcome { - /// A return code, where STEPPER_SUCCESS means success. +pub struct InterpreterOutcome { + /// A return code, where INTERPRETER_SUCCESS means success. pub ret_code: i32, - /// Contains error message if ret_code != STEPPER_SUCCESS. + /// Contains error message if ret_code != INTERPRETER_SUCCESS. pub error_message: String, - /// Contains script data that should be preserved in an executor of this stepper + /// Contains script data that should be preserved in an executor of this interpreter /// regardless of ret_code value. pub data: Vec, @@ -40,19 +40,24 @@ pub struct StepperOutcome { pub next_peer_pks: Vec, } -impl StepperOutcome { +impl InterpreterOutcome { pub fn from_ivalues(mut ivalues: Vec) -> Result { const OUTCOME_FIELDS_COUNT: usize = 4; let record_values = match ivalues.remove(0) { IValue::Record(record_values) => record_values, - v => return Err(format!("expected record for StepperOutcome, got {:?}", v)), + v => { + return Err(format!( + "expected record for InterpreterOutcome, got {:?}", + v + )) + } }; let mut record_values = record_values.into_vec(); if record_values.len() != OUTCOME_FIELDS_COUNT { return Err(format!( - "expected StepperOutcome struct with {} fields, got {:?}", + "expected InterpreterOutcome struct with {} fields, got {:?}", OUTCOME_FIELDS_COUNT, record_values )); } diff --git a/crates/test-utils/Cargo.toml b/crates/test-utils/Cargo.toml index 5ee7a39e..b2f1159f 100644 --- a/crates/test-utils/Cargo.toml +++ b/crates/test-utils/Cargo.toml @@ -11,5 +11,5 @@ path = "src/lib.rs" [dependencies] fluence = { version = "0.2.18", features = ["logger"] } -aquamarine-vm = { version = "0.1.29", features = ["raw-aquamarine-vm-api"] } +aquamarine-vm = { version = "0.3.1", features = ["raw-aquamarine-vm-api"] } serde_json = "1.0.56" diff --git a/crates/test-utils/src/lib.rs b/crates/test-utils/src/lib.rs index fc1854e4..65c823c0 100644 --- a/crates/test-utils/src/lib.rs +++ b/crates/test-utils/src/lib.rs @@ -32,8 +32,8 @@ pub use aquamarine_vm::AquamarineVMError; pub use aquamarine_vm::CallServiceClosure; pub use aquamarine_vm::IType; pub use aquamarine_vm::IValue; +pub use aquamarine_vm::InterpreterOutcome; pub use aquamarine_vm::ParticleParameters; -pub use aquamarine_vm::StepperOutcome; use std::collections::HashMap; use std::path::PathBuf; diff --git a/stepper-lib/.rustfmt.toml b/interpreter-lib/.rustfmt.toml similarity index 100% rename from stepper-lib/.rustfmt.toml rename to interpreter-lib/.rustfmt.toml diff --git a/stepper-lib/Cargo.toml b/interpreter-lib/Cargo.toml similarity index 88% rename from stepper-lib/Cargo.toml rename to interpreter-lib/Cargo.toml index 6f23d2af..0f62fc4f 100644 --- a/stepper-lib/Cargo.toml +++ b/interpreter-lib/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "stepper-lib" -version = "0.5.0" +name = "interpreter-lib" +version = "0.6.0" authors = ["Fluence Labs"] edition = "2018" [lib] -name = "stepper_lib" +name = "interpreter_lib" path = "src/lib.rs" [dependencies] air-parser = { path = "../crates/air-parser" } fluence = { version = "0.2.18", features = ["logger"] } polyplets = { path = "../crates/polyplets" } -stepper-interface = { path = "../crates/stepper-interface" } +aqua-interpreter-interface = { path = "../crates/interpreter-interface" } serde = { version = "=1.0.118", features = [ "derive", "rc" ] } serde_json = "=1.0.61" diff --git a/stepper-lib/benches/call_benchmark.rs b/interpreter-lib/benches/call_benchmark.rs similarity index 88% rename from stepper-lib/benches/call_benchmark.rs rename to interpreter-lib/benches/call_benchmark.rs index 024475e8..e064e0c4 100644 --- a/stepper-lib/benches/call_benchmark.rs +++ b/interpreter-lib/benches/call_benchmark.rs @@ -2,7 +2,7 @@ use aqua_test_utils::create_aqua_vm; use aqua_test_utils::unit_call_service; use aqua_test_utils::AquamarineVM; use aqua_test_utils::AquamarineVMError; -use aqua_test_utils::StepperOutcome; +use aqua_test_utils::InterpreterOutcome; use criterion::criterion_group; use criterion::criterion_main; @@ -18,7 +18,7 @@ thread_local!(static SCRIPT: String = String::from( ) ); -fn current_peer_id_call() -> Result { +fn current_peer_id_call() -> Result { VM.with(|vm| SCRIPT.with(|script| vm.borrow_mut().call_with_prev_data("", script.clone(), "[]", "[]"))) } diff --git a/stepper-lib/benches/chat_benchmark.rs b/interpreter-lib/benches/chat_benchmark.rs similarity index 96% rename from stepper-lib/benches/chat_benchmark.rs rename to interpreter-lib/benches/chat_benchmark.rs index 7cac5b6a..c84b5720 100644 --- a/stepper-lib/benches/chat_benchmark.rs +++ b/interpreter-lib/benches/chat_benchmark.rs @@ -4,8 +4,8 @@ use aqua_test_utils::AquamarineVM; use aqua_test_utils::AquamarineVMError; use aqua_test_utils::CallServiceClosure; use aqua_test_utils::IValue; +use aqua_test_utils::InterpreterOutcome; use aqua_test_utils::NEVec; -use aqua_test_utils::StepperOutcome; use criterion::criterion_group; use criterion::criterion_main; @@ -31,7 +31,7 @@ thread_local!(static REMOTE_VM: RefCell = RefCell::new({ thread_local!(static CLIENT_1_VM: RefCell = RefCell::new(create_aqua_vm(unit_call_service(), "A"))); thread_local!(static CLIENT_2_VM: RefCell = RefCell::new(create_aqua_vm(unit_call_service(), "B"))); -fn chat_sent_message_benchmark() -> Result { +fn chat_sent_message_benchmark() -> Result { let script = String::from( r#" (seq diff --git a/stepper-lib/benches/create_service_benchmark.rs b/interpreter-lib/benches/create_service_benchmark.rs similarity index 96% rename from stepper-lib/benches/create_service_benchmark.rs rename to interpreter-lib/benches/create_service_benchmark.rs index 7cc9888d..5f156be5 100644 --- a/stepper-lib/benches/create_service_benchmark.rs +++ b/interpreter-lib/benches/create_service_benchmark.rs @@ -4,8 +4,8 @@ use aqua_test_utils::AquamarineVM; use aqua_test_utils::AquamarineVMError; use aqua_test_utils::CallServiceClosure; use aqua_test_utils::IValue; +use aqua_test_utils::InterpreterOutcome; use aqua_test_utils::NEVec; -use aqua_test_utils::StepperOutcome; use serde_json::json; @@ -68,7 +68,7 @@ thread_local!(static SET_VARIABLES_VM: RefCell = RefCell::new({ create_aqua_vm(set_variables_call_service(variables_mapping), "set_variables") })); -fn create_service_benchmark() -> Result { +fn create_service_benchmark() -> Result { let script = String::from( r#" (seq diff --git a/stepper-lib/src/aqua.rs b/interpreter-lib/src/aqua.rs similarity index 91% rename from stepper-lib/src/aqua.rs rename to interpreter-lib/src/aqua.rs index ce2dae2a..d2d15ea5 100644 --- a/stepper-lib/src/aqua.rs +++ b/interpreter-lib/src/aqua.rs @@ -20,9 +20,9 @@ use crate::execution::ExecutableInstruction; use crate::preparation::prepare; use crate::preparation::PreparationDescriptor; -use stepper_interface::StepperOutcome; +use aqua_interpreter_interface::InterpreterOutcome; -pub fn execute_aqua(init_peer_id: String, aqua: String, prev_data: Vec, data: Vec) -> StepperOutcome { +pub fn execute_aqua(init_peer_id: String, aqua: String, prev_data: Vec, data: Vec) -> InterpreterOutcome { use std::convert::identity; log::trace!( @@ -39,7 +39,7 @@ fn execute_aqua_impl( aqua: String, prev_data: Vec, data: Vec, -) -> Result { +) -> Result { let PreparationDescriptor { mut exec_ctx, mut trace_ctx, diff --git a/stepper-lib/src/aqua/outcome.rs b/interpreter-lib/src/aqua/outcome.rs similarity index 77% rename from stepper-lib/src/aqua/outcome.rs rename to interpreter-lib/src/aqua/outcome.rs index d6ae4fc5..f2bb1695 100644 --- a/stepper-lib/src/aqua/outcome.rs +++ b/interpreter-lib/src/aqua/outcome.rs @@ -17,8 +17,8 @@ use crate::execution::ExecutionError; use crate::preparation::PreparationError; -use crate::StepperOutcome; -use crate::STEPPER_SUCCESS; +use crate::InterpreterOutcome; +use crate::INTERPRETER_SUCCESS; use serde::Serialize; @@ -27,30 +27,30 @@ use std::rc::Rc; const EXECUTION_ERRORS_START_ID: i32 = 1000; -/// Create StepperOutcome from supplied data and next_peer_pks, -/// set ret_code to STEPPER_SUCCESS. -pub(crate) fn from_path_and_peers(data: &T, next_peer_pks: Vec) -> StepperOutcome +/// Create InterpreterOutcome from supplied data and next_peer_pks, +/// set ret_code to INTERPRETER_SUCCESS. +pub(crate) fn from_path_and_peers(data: &T, next_peer_pks: Vec) -> InterpreterOutcome where T: ?Sized + Serialize, { let data = serde_json::to_vec(data).expect("default serializer shouldn't fail"); let next_peer_pks = dedup(next_peer_pks); - StepperOutcome { - ret_code: STEPPER_SUCCESS, + InterpreterOutcome { + ret_code: INTERPRETER_SUCCESS, error_message: String::new(), data, next_peer_pks, } } -/// Create StepperOutcome from supplied data and error, +/// Create InterpreterOutcome from supplied data and error, /// set ret_code based on the error. -pub(crate) fn from_preparation_error(data: impl Into>, err: PreparationError) -> StepperOutcome { +pub(crate) fn from_preparation_error(data: impl Into>, err: PreparationError) -> InterpreterOutcome { let ret_code = err.to_error_code() as i32; let data = data.into(); - StepperOutcome { + InterpreterOutcome { ret_code, error_message: format!("{}", err), data, @@ -58,9 +58,13 @@ pub(crate) fn from_preparation_error(data: impl Into>, err: PreparationE } } -/// Create StepperOutcome from supplied data, next_peer_pks and error, +/// Create InterpreterOutcome from supplied data, next_peer_pks and error, /// set ret_code based on the error. -pub(crate) fn from_execution_error(data: &T, next_peer_pks: Vec, err: Rc) -> StepperOutcome +pub(crate) fn from_execution_error( + data: &T, + next_peer_pks: Vec, + err: Rc, +) -> InterpreterOutcome where T: ?Sized + Serialize, { @@ -70,7 +74,7 @@ where let data = serde_json::to_vec(data).expect("default serializer shouldn't fail"); let next_peer_pks = dedup(next_peer_pks); - StepperOutcome { + InterpreterOutcome { ret_code, error_message: format!("{}", err), data, diff --git a/stepper-lib/src/build_targets/fce_target.rs b/interpreter-lib/src/build_targets/fce_target.rs similarity index 100% rename from stepper-lib/src/build_targets/fce_target.rs rename to interpreter-lib/src/build_targets/fce_target.rs diff --git a/stepper-lib/src/build_targets/mod.rs b/interpreter-lib/src/build_targets/mod.rs similarity index 100% rename from stepper-lib/src/build_targets/mod.rs rename to interpreter-lib/src/build_targets/mod.rs diff --git a/stepper-lib/src/build_targets/wasm_bindgen_target.rs b/interpreter-lib/src/build_targets/wasm_bindgen_target.rs similarity index 100% rename from stepper-lib/src/build_targets/wasm_bindgen_target.rs rename to interpreter-lib/src/build_targets/wasm_bindgen_target.rs diff --git a/stepper-lib/src/contexts/execution_context.rs b/interpreter-lib/src/contexts/execution_context.rs similarity index 100% rename from stepper-lib/src/contexts/execution_context.rs rename to interpreter-lib/src/contexts/execution_context.rs diff --git a/stepper-lib/src/contexts/execution_context/avalue.rs b/interpreter-lib/src/contexts/execution_context/avalue.rs similarity index 100% rename from stepper-lib/src/contexts/execution_context/avalue.rs rename to interpreter-lib/src/contexts/execution_context/avalue.rs diff --git a/stepper-lib/src/contexts/execution_trace_context.rs b/interpreter-lib/src/contexts/execution_trace_context.rs similarity index 92% rename from stepper-lib/src/contexts/execution_trace_context.rs rename to interpreter-lib/src/contexts/execution_trace_context.rs index 0cb16227..4d21b294 100644 --- a/stepper-lib/src/contexts/execution_trace_context.rs +++ b/interpreter-lib/src/contexts/execution_trace_context.rs @@ -30,14 +30,14 @@ pub type ExecutionTrace = std::collections::VecDeque; #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub(crate) struct ExecutionTraceCtx { /// Contains trace (serialized tree of states) after merging current and previous data, - /// stepper used it to realize which instructions've been already executed. + /// interpreter used it to realize which instructions've been already executed. pub(crate) current_trace: ExecutionTrace, /// Size of a current considered subtree inside current path. pub(crate) current_subtree_size: usize, // TODO: consider change it to Vec for optimization - /// Accumulator for resulted path produced by the stepper after execution. + /// Accumulator for resulted path produced by the interpreter after execution. pub(crate) new_trace: ExecutionTrace, } diff --git a/stepper-lib/src/contexts/execution_trace_context/executed_state.rs b/interpreter-lib/src/contexts/execution_trace_context/executed_state.rs similarity index 100% rename from stepper-lib/src/contexts/execution_trace_context/executed_state.rs rename to interpreter-lib/src/contexts/execution_trace_context/executed_state.rs diff --git a/stepper-lib/src/contexts/mod.rs b/interpreter-lib/src/contexts/mod.rs similarity index 100% rename from stepper-lib/src/contexts/mod.rs rename to interpreter-lib/src/contexts/mod.rs diff --git a/stepper-lib/src/execution/air/call.rs b/interpreter-lib/src/execution/air/call.rs similarity index 100% rename from stepper-lib/src/execution/air/call.rs rename to interpreter-lib/src/execution/air/call.rs diff --git a/stepper-lib/src/execution/air/call/resolved_call.rs b/interpreter-lib/src/execution/air/call/resolved_call.rs similarity index 100% rename from stepper-lib/src/execution/air/call/resolved_call.rs rename to interpreter-lib/src/execution/air/call/resolved_call.rs diff --git a/stepper-lib/src/execution/air/call/triplet.rs b/interpreter-lib/src/execution/air/call/triplet.rs similarity index 100% rename from stepper-lib/src/execution/air/call/triplet.rs rename to interpreter-lib/src/execution/air/call/triplet.rs diff --git a/stepper-lib/src/execution/air/call/utils.rs b/interpreter-lib/src/execution/air/call/utils.rs similarity index 100% rename from stepper-lib/src/execution/air/call/utils.rs rename to interpreter-lib/src/execution/air/call/utils.rs diff --git a/stepper-lib/src/execution/air/compare_matchable/compare_matchable.rs b/interpreter-lib/src/execution/air/compare_matchable/compare_matchable.rs similarity index 100% rename from stepper-lib/src/execution/air/compare_matchable/compare_matchable.rs rename to interpreter-lib/src/execution/air/compare_matchable/compare_matchable.rs diff --git a/stepper-lib/src/execution/air/compare_matchable/mod.rs b/interpreter-lib/src/execution/air/compare_matchable/mod.rs similarity index 100% rename from stepper-lib/src/execution/air/compare_matchable/mod.rs rename to interpreter-lib/src/execution/air/compare_matchable/mod.rs diff --git a/stepper-lib/src/execution/air/fold.rs b/interpreter-lib/src/execution/air/fold.rs similarity index 99% rename from stepper-lib/src/execution/air/fold.rs rename to interpreter-lib/src/execution/air/fold.rs index c61a3221..69ce4e7a 100644 --- a/stepper-lib/src/execution/air/fold.rs +++ b/interpreter-lib/src/execution/air/fold.rs @@ -165,7 +165,7 @@ mod tests { use aqua_test_utils::echo_string_call_service; use aqua_test_utils::set_variable_call_service; use aqua_test_utils::AquamarineVMError; - use aqua_test_utils::StepperOutcome; + use aqua_test_utils::InterpreterOutcome; use serde_json::json; use std::rc::Rc; @@ -443,7 +443,7 @@ mod tests { use crate::contexts::execution_trace::CallResult::*; use crate::contexts::execution_trace::ExecutedState::*; - fn execute_script(script: String) -> Result { + fn execute_script(script: String) -> Result { let mut set_variables_vm = create_aqua_vm(set_variable_call_service(r#"["1","2"]"#), "set_variable"); let mut vm_a = create_aqua_vm(echo_string_call_service(), "A"); let mut vm_b = create_aqua_vm(echo_string_call_service(), "B"); diff --git a/stepper-lib/src/execution/air/fold/utils.rs b/interpreter-lib/src/execution/air/fold/utils.rs similarity index 100% rename from stepper-lib/src/execution/air/fold/utils.rs rename to interpreter-lib/src/execution/air/fold/utils.rs diff --git a/stepper-lib/src/execution/air/match_.rs b/interpreter-lib/src/execution/air/match_.rs similarity index 100% rename from stepper-lib/src/execution/air/match_.rs rename to interpreter-lib/src/execution/air/match_.rs diff --git a/stepper-lib/src/execution/air/mismatch.rs b/interpreter-lib/src/execution/air/mismatch.rs similarity index 100% rename from stepper-lib/src/execution/air/mismatch.rs rename to interpreter-lib/src/execution/air/mismatch.rs diff --git a/stepper-lib/src/execution/air/mod.rs b/interpreter-lib/src/execution/air/mod.rs similarity index 100% rename from stepper-lib/src/execution/air/mod.rs rename to interpreter-lib/src/execution/air/mod.rs diff --git a/stepper-lib/src/execution/air/null.rs b/interpreter-lib/src/execution/air/null.rs similarity index 100% rename from stepper-lib/src/execution/air/null.rs rename to interpreter-lib/src/execution/air/null.rs diff --git a/stepper-lib/src/execution/air/par.rs b/interpreter-lib/src/execution/air/par.rs similarity index 100% rename from stepper-lib/src/execution/air/par.rs rename to interpreter-lib/src/execution/air/par.rs diff --git a/stepper-lib/src/execution/air/seq.rs b/interpreter-lib/src/execution/air/seq.rs similarity index 100% rename from stepper-lib/src/execution/air/seq.rs rename to interpreter-lib/src/execution/air/seq.rs diff --git a/stepper-lib/src/execution/air/xor.rs b/interpreter-lib/src/execution/air/xor.rs similarity index 100% rename from stepper-lib/src/execution/air/xor.rs rename to interpreter-lib/src/execution/air/xor.rs diff --git a/stepper-lib/src/execution/boxed_value/iterable.rs b/interpreter-lib/src/execution/boxed_value/iterable.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/iterable.rs rename to interpreter-lib/src/execution/boxed_value/iterable.rs diff --git a/stepper-lib/src/execution/boxed_value/iterable/json_path_result.rs b/interpreter-lib/src/execution/boxed_value/iterable/json_path_result.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/iterable/json_path_result.rs rename to interpreter-lib/src/execution/boxed_value/iterable/json_path_result.rs diff --git a/stepper-lib/src/execution/boxed_value/iterable/resolved_call.rs b/interpreter-lib/src/execution/boxed_value/iterable/resolved_call.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/iterable/resolved_call.rs rename to interpreter-lib/src/execution/boxed_value/iterable/resolved_call.rs diff --git a/stepper-lib/src/execution/boxed_value/iterable/vec_json_path_result.rs b/interpreter-lib/src/execution/boxed_value/iterable/vec_json_path_result.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/iterable/vec_json_path_result.rs rename to interpreter-lib/src/execution/boxed_value/iterable/vec_json_path_result.rs diff --git a/stepper-lib/src/execution/boxed_value/iterable/vec_resolved_call.rs b/interpreter-lib/src/execution/boxed_value/iterable/vec_resolved_call.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/iterable/vec_resolved_call.rs rename to interpreter-lib/src/execution/boxed_value/iterable/vec_resolved_call.rs diff --git a/stepper-lib/src/execution/boxed_value/jvaluable.rs b/interpreter-lib/src/execution/boxed_value/jvaluable.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/jvaluable.rs rename to interpreter-lib/src/execution/boxed_value/jvaluable.rs diff --git a/stepper-lib/src/execution/boxed_value/jvaluable/cell_vec_resolved_call_result.rs b/interpreter-lib/src/execution/boxed_value/jvaluable/cell_vec_resolved_call_result.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/jvaluable/cell_vec_resolved_call_result.rs rename to interpreter-lib/src/execution/boxed_value/jvaluable/cell_vec_resolved_call_result.rs diff --git a/stepper-lib/src/execution/boxed_value/jvaluable/iterable_item.rs b/interpreter-lib/src/execution/boxed_value/jvaluable/iterable_item.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/jvaluable/iterable_item.rs rename to interpreter-lib/src/execution/boxed_value/jvaluable/iterable_item.rs diff --git a/stepper-lib/src/execution/boxed_value/jvaluable/resolved_call_result.rs b/interpreter-lib/src/execution/boxed_value/jvaluable/resolved_call_result.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/jvaluable/resolved_call_result.rs rename to interpreter-lib/src/execution/boxed_value/jvaluable/resolved_call_result.rs diff --git a/stepper-lib/src/execution/boxed_value/mod.rs b/interpreter-lib/src/execution/boxed_value/mod.rs similarity index 100% rename from stepper-lib/src/execution/boxed_value/mod.rs rename to interpreter-lib/src/execution/boxed_value/mod.rs diff --git a/stepper-lib/src/execution/errors.rs b/interpreter-lib/src/execution/errors.rs similarity index 100% rename from stepper-lib/src/execution/errors.rs rename to interpreter-lib/src/execution/errors.rs diff --git a/stepper-lib/src/execution/mod.rs b/interpreter-lib/src/execution/mod.rs similarity index 100% rename from stepper-lib/src/execution/mod.rs rename to interpreter-lib/src/execution/mod.rs diff --git a/stepper-lib/src/execution/utils/mod.rs b/interpreter-lib/src/execution/utils/mod.rs similarity index 100% rename from stepper-lib/src/execution/utils/mod.rs rename to interpreter-lib/src/execution/utils/mod.rs diff --git a/stepper-lib/src/execution/utils/resolve.rs b/interpreter-lib/src/execution/utils/resolve.rs similarity index 100% rename from stepper-lib/src/execution/utils/resolve.rs rename to interpreter-lib/src/execution/utils/resolve.rs diff --git a/stepper-lib/src/lib.rs b/interpreter-lib/src/lib.rs similarity index 92% rename from stepper-lib/src/lib.rs rename to interpreter-lib/src/lib.rs index 1902fe43..8afd2c81 100644 --- a/stepper-lib/src/lib.rs +++ b/interpreter-lib/src/lib.rs @@ -34,10 +34,10 @@ mod preparation; mod aqua; pub mod log_targets; +pub use aqua_interpreter_interface::InterpreterOutcome; +pub use aqua_interpreter_interface::INTERPRETER_SUCCESS; pub use polyplets::ResolvedTriplet; pub use polyplets::SecurityTetraplet; -pub use stepper_interface::StepperOutcome; -pub use stepper_interface::STEPPER_SUCCESS; pub use aqua::execute_aqua; diff --git a/stepper-lib/src/log_targets.rs b/interpreter-lib/src/log_targets.rs similarity index 100% rename from stepper-lib/src/log_targets.rs rename to interpreter-lib/src/log_targets.rs diff --git a/stepper-lib/src/preparation/data_merging.rs b/interpreter-lib/src/preparation/data_merging.rs similarity index 100% rename from stepper-lib/src/preparation/data_merging.rs rename to interpreter-lib/src/preparation/data_merging.rs diff --git a/stepper-lib/src/preparation/errors.rs b/interpreter-lib/src/preparation/errors.rs similarity index 98% rename from stepper-lib/src/preparation/errors.rs rename to interpreter-lib/src/preparation/errors.rs index 781308ee..8e301b1a 100644 --- a/stepper-lib/src/preparation/errors.rs +++ b/interpreter-lib/src/preparation/errors.rs @@ -23,7 +23,7 @@ use thiserror::Error as ThisError; use std::env::VarError; use std::error::Error; -/// Errors happened during the stepper preparation step. +/// Errors happened during the interpreter preparation step. #[derive(Debug)] pub enum PreparationError { /// Error occurred while parsing AIR script diff --git a/stepper-lib/src/preparation/mod.rs b/interpreter-lib/src/preparation/mod.rs similarity index 100% rename from stepper-lib/src/preparation/mod.rs rename to interpreter-lib/src/preparation/mod.rs diff --git a/stepper-lib/src/preparation/preparation.rs b/interpreter-lib/src/preparation/preparation.rs similarity index 100% rename from stepper-lib/src/preparation/preparation.rs rename to interpreter-lib/src/preparation/preparation.rs diff --git a/stepper-lib/tests/air_basic.rs b/interpreter-lib/tests/air_basic.rs similarity index 90% rename from stepper-lib/tests/air_basic.rs rename to interpreter-lib/tests/air_basic.rs index e096311b..ac610bb9 100644 --- a/stepper-lib/tests/air_basic.rs +++ b/interpreter-lib/tests/air_basic.rs @@ -30,8 +30,8 @@ type JValue = serde_json::Value; #[test] fn seq_par_call() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let vm_peer_id = String::from("some_peer_id"); let mut vm = create_aqua_vm(unit_call_service(), vm_peer_id.clone()); @@ -49,7 +49,8 @@ fn seq_par_call() { ); let res = call_vm!(vm, "asd", script, "[]", "[]"); - let actual_trace: Vec = serde_json::from_slice(&res.data).expect("stepper should return valid json"); + let actual_trace: Vec = + serde_json::from_slice(&res.data).expect("interpreter should return valid json"); let test_string = String::from("test"); let expected_trace = vec![ @@ -65,8 +66,8 @@ fn seq_par_call() { #[test] fn par_par_call() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let vm_peer_id = String::from("some_peer_id"); let mut vm = create_aqua_vm(unit_call_service(), vm_peer_id.clone()); @@ -85,7 +86,7 @@ fn par_par_call() { let res = call_vm!(vm, "asd", script, "[]", "[]"); let resulted_trace: Vec = - serde_json::from_slice(&res.data).expect("stepper should return valid json"); + serde_json::from_slice(&res.data).expect("interpreter should return valid json"); let test_string = String::from("test"); let expected_trace = vec![ @@ -102,8 +103,8 @@ fn par_par_call() { #[test] fn create_service() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let module = "greeting"; let module_config = json!( diff --git a/stepper-lib/tests/build_test_binaries.sh b/interpreter-lib/tests/build_test_binaries.sh similarity index 100% rename from stepper-lib/tests/build_test_binaries.sh rename to interpreter-lib/tests/build_test_binaries.sh diff --git a/stepper-lib/tests/call_evidence_basic.rs b/interpreter-lib/tests/call_evidence_basic.rs similarity index 93% rename from stepper-lib/tests/call_evidence_basic.rs rename to interpreter-lib/tests/call_evidence_basic.rs index ddd24d90..5d731bc9 100644 --- a/stepper-lib/tests/call_evidence_basic.rs +++ b/interpreter-lib/tests/call_evidence_basic.rs @@ -30,8 +30,8 @@ type JValue = serde_json::Value; #[test] fn executed_trace_seq_par_call() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let local_peer_id = "local_peer_id"; let mut vm = create_aqua_vm(unit_call_service(), local_peer_id); @@ -56,7 +56,8 @@ fn executed_trace_seq_par_call() { .to_string(); let res = call_vm!(vm, "asd", script, "[]", initial_state); - let actual_trace: Vec = serde_json::from_slice(&res.data).expect("stepper should return valid json"); + let actual_trace: Vec = + serde_json::from_slice(&res.data).expect("interpreter should return valid json"); let test_string = String::from("test"); let expected_trace = vec![ @@ -72,8 +73,8 @@ fn executed_trace_seq_par_call() { #[test] fn executed_trace_par_par_call() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let local_peer_id = "local_peer_id"; let mut vm = create_aqua_vm(unit_call_service(), local_peer_id); @@ -99,7 +100,8 @@ fn executed_trace_par_par_call() { .to_string(); let res = call_vm!(vm, "asd", script, "[]", initial_state); - let actual_trace: Vec = serde_json::from_slice(&res.data).expect("stepper should return valid json"); + let actual_trace: Vec = + serde_json::from_slice(&res.data).expect("interpreter should return valid json"); let test_string = String::from("test"); let expected_trace = vec![ @@ -116,8 +118,8 @@ fn executed_trace_par_par_call() { #[test] fn executed_trace_seq_seq() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let peer_id_1 = String::from("12D3KooWHk9BjDQBUqnavciRPhAYFvqKBe4ZiPPvde7vDaqgn5er"); let peer_id_2 = String::from("12D3KooWAzJcYitiZrerycVB4Wryrx22CFKdDGx7c4u31PFdfTbR"); @@ -145,7 +147,8 @@ fn executed_trace_seq_seq() { let res = call_vm!(vm2, "asd", script, "[]", res.data); - let actual_trace: Vec = serde_json::from_slice(&res.data).expect("stepper should return valid json"); + let actual_trace: Vec = + serde_json::from_slice(&res.data).expect("interpreter should return valid json"); let test_string = String::from("test"); let expected_trace = vec![ @@ -159,8 +162,8 @@ fn executed_trace_seq_seq() { #[test] fn executed_trace_create_service() { - use stepper_lib::execution_trace::CallResult::*; - use stepper_lib::execution_trace::ExecutedState::{self, *}; + use interpreter_lib::execution_trace::CallResult::*; + use interpreter_lib::execution_trace::ExecutedState::{self, *}; let module = "greeting"; let module_config = json!( @@ -345,7 +348,7 @@ fn executed_trace_par_seq_fold_in_cycle_call() { data = res.data; } - let resulted_json: JValue = serde_json::from_slice(&data).expect("stepper should return valid json"); + let resulted_json: JValue = serde_json::from_slice(&data).expect("interpreter should return valid json"); let expected_json = json!( [ { "par": [21,1] }, @@ -409,7 +412,7 @@ fn executed_trace_seq_par_seq_seq() { let res = call_vm!(vm2, "asd", script, "[]", res.data); - let resulted_json: JValue = serde_json::from_slice(&res.data).expect("stepper should return valid json"); + let resulted_json: JValue = serde_json::from_slice(&res.data).expect("interpreter should return valid json"); let expected_json = json!( [ { "par": [2,2] }, diff --git a/stepper-lib/tests/dashboard.rs b/interpreter-lib/tests/dashboard.rs similarity index 100% rename from stepper-lib/tests/dashboard.rs rename to interpreter-lib/tests/dashboard.rs diff --git a/stepper-lib/tests/dashboard/peers b/interpreter-lib/tests/dashboard/peers similarity index 100% rename from stepper-lib/tests/dashboard/peers rename to interpreter-lib/tests/dashboard/peers diff --git a/stepper-lib/tests/data_merge.rs b/interpreter-lib/tests/data_merge.rs similarity index 97% rename from stepper-lib/tests/data_merge.rs rename to interpreter-lib/tests/data_merge.rs index 40308ae4..3d8e4458 100644 --- a/stepper-lib/tests/data_merge.rs +++ b/interpreter-lib/tests/data_merge.rs @@ -77,7 +77,7 @@ fn data_merge() { let res3 = call_vm!(vm1, "asd", script.clone(), res1.data.clone(), res2.data.clone()); let res4 = call_vm!(vm2, "asd", script, res1.data.clone(), res2.data.clone()); - let resulted_json1: JValue = serde_json::from_slice(&res1.data).expect("stepper should return valid json"); + let resulted_json1: JValue = serde_json::from_slice(&res1.data).expect("interpreter should return valid json"); let expected_json1 = json!( [ { "call": { "executed": ["A", "B"] } }, @@ -96,7 +96,7 @@ fn data_merge() { assert_eq!(resulted_json1, expected_json1); assert_eq!(res1.next_peer_pks, vec![String::from("B")]); - let resulted_json2: JValue = serde_json::from_slice(&res2.data).expect("stepper should return valid json"); + let resulted_json2: JValue = serde_json::from_slice(&res2.data).expect("interpreter should return valid json"); let expected_json2 = json!( [ { "call": { "executed": ["A", "B"] } }, @@ -114,7 +114,7 @@ fn data_merge() { assert_eq!(resulted_json2, expected_json2); assert_eq!(res2.next_peer_pks, vec![String::from("A")]); - let resulted_json3: JValue = serde_json::from_slice(&res3.data).expect("stepper should return valid json"); + let resulted_json3: JValue = serde_json::from_slice(&res3.data).expect("interpreter should return valid json"); let expected_json3 = json!( [ { "call": { "executed": ["A", "B"] } }, @@ -133,7 +133,7 @@ fn data_merge() { assert_eq!(resulted_json3, expected_json3); assert!(res3.next_peer_pks.is_empty()); - let resulted_json4: JValue = serde_json::from_slice(&res4.data).expect("stepper should return valid json"); + let resulted_json4: JValue = serde_json::from_slice(&res4.data).expect("interpreter should return valid json"); let expected_json4 = json!( [ { "call": { "executed": ["A", "B"] } }, diff --git a/stepper-lib/tests/join.rs b/interpreter-lib/tests/join.rs similarity index 91% rename from stepper-lib/tests/join.rs rename to interpreter-lib/tests/join.rs index fc4d9e04..3292b6a7 100644 --- a/stepper-lib/tests/join.rs +++ b/interpreter-lib/tests/join.rs @@ -72,7 +72,7 @@ fn join_chat() { let client_1_res = call_vm!(client_1, "asd", script.clone(), "[]", "[]"); let client_1_res_json: JValue = - serde_json::from_slice(&client_1_res.data).expect("stepper should return valid json"); + serde_json::from_slice(&client_1_res.data).expect("interpreter should return valid json"); let client_1_expected_json = json!([ { "call": {"request_sent_by": "A" } }, @@ -83,7 +83,8 @@ fn join_chat() { let relay_1_res = call_vm!(relay_1, "asd", script.clone(), client_1_res.data, "[]"); - let relay_1_res_json: JValue = serde_json::from_slice(&relay_1_res.data).expect("stepper should return valid json"); + let relay_1_res_json: JValue = + serde_json::from_slice(&relay_1_res.data).expect("interpreter should return valid json"); let relay_1_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -95,7 +96,8 @@ fn join_chat() { let remote_res = call_vm!(remote, "asd", script.clone(), relay_1_res.data, "[]"); - let remote_res_json: JValue = serde_json::from_slice(&remote_res.data).expect("stepper should return valid json"); + let remote_res_json: JValue = + serde_json::from_slice(&remote_res.data).expect("interpreter should return valid json"); let remote_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -118,7 +120,8 @@ fn join_chat() { let relay_1_res = call_vm!(relay_1, "asd", script.clone(), remote_res.data.clone(), "[]"); - let relay_1_res_json: JValue = serde_json::from_slice(&relay_1_res.data).expect("stepper should return valid json"); + let relay_1_res_json: JValue = + serde_json::from_slice(&relay_1_res.data).expect("interpreter should return valid json"); let relay_1_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -137,7 +140,7 @@ fn join_chat() { let client_1_res = call_vm!(client_1, "asd", script.clone(), relay_1_res.data, "[]"); let client_1_res_json: JValue = - serde_json::from_slice(&client_1_res.data).expect("stepper should return valid json"); + serde_json::from_slice(&client_1_res.data).expect("interpreter should return valid json"); let client_1_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -155,7 +158,8 @@ fn join_chat() { let relay_2_res = call_vm!(relay_2, "asd", script.clone(), remote_res.data, "[]"); - let relay_2_res_json: JValue = serde_json::from_slice(&relay_2_res.data).expect("stepper should return valid json"); + let relay_2_res_json: JValue = + serde_json::from_slice(&relay_2_res.data).expect("interpreter should return valid json"); let relay_2_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -174,7 +178,7 @@ fn join_chat() { let client_2_res = call_vm!(client_2, "asd", script, relay_2_res.data, "[]"); let client_2_res_json: JValue = - serde_json::from_slice(&client_2_res.data).expect("stepper should return valid json"); + serde_json::from_slice(&client_2_res.data).expect("interpreter should return valid json"); let client_2_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -230,7 +234,7 @@ fn join() { let client_1_res = call_vm!(client_1, "asd", script, relay_1_res.data, "[]"); let client_1_res_json: JValue = - serde_json::from_slice(&client_1_res.data).expect("stepper should return valid json"); + serde_json::from_slice(&client_1_res.data).expect("interpreter should return valid json"); let client_1_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -310,7 +314,7 @@ fn init_peer_id() { ); let client_1_res_json: JValue = - serde_json::from_slice(&client_1_res.data).expect("stepper should return valid json"); + serde_json::from_slice(&client_1_res.data).expect("interpreter should return valid json"); let client_1_expected_json = json!( [ { "call": { "executed" : "test" } }, @@ -330,7 +334,7 @@ fn init_peer_id() { let initiator_1_res = call_vm!(initiator, initiator_peer_id, script, client_1_res.data, ""); let initiator_1_res_json: JValue = - serde_json::from_slice(&initiator_1_res.data).expect("stepper should return valid json"); + serde_json::from_slice(&initiator_1_res.data).expect("interpreter should return valid json"); let initiator_1_expected_json = json!( [ { "call": { "executed" : "test" } }, diff --git a/stepper-lib/tests/last_error.rs b/interpreter-lib/tests/last_error.rs similarity index 98% rename from stepper-lib/tests/last_error.rs rename to interpreter-lib/tests/last_error.rs index fa114a50..6983fb9b 100644 --- a/stepper-lib/tests/last_error.rs +++ b/interpreter-lib/tests/last_error.rs @@ -21,7 +21,7 @@ use aqua_test_utils::unit_call_service; use aqua_test_utils::CallServiceClosure; use aqua_test_utils::IValue; use aqua_test_utils::NEVec; -use stepper_lib::SecurityTetraplet; +use interpreter_lib::SecurityTetraplet; fn create_check_service_closure() -> CallServiceClosure { Box::new(move |_, args| -> Option { diff --git a/stepper-lib/tests/network_explore.rs b/interpreter-lib/tests/network_explore.rs similarity index 100% rename from stepper-lib/tests/network_explore.rs rename to interpreter-lib/tests/network_explore.rs diff --git a/stepper-lib/tests/scripts/create_service.clj b/interpreter-lib/tests/scripts/create_service.clj similarity index 100% rename from stepper-lib/tests/scripts/create_service.clj rename to interpreter-lib/tests/scripts/create_service.clj diff --git a/stepper-lib/tests/scripts/create_service_with_xor.clj b/interpreter-lib/tests/scripts/create_service_with_xor.clj similarity index 100% rename from stepper-lib/tests/scripts/create_service_with_xor.clj rename to interpreter-lib/tests/scripts/create_service_with_xor.clj diff --git a/stepper-lib/tests/scripts/dashboard.clj b/interpreter-lib/tests/scripts/dashboard.clj similarity index 100% rename from stepper-lib/tests/scripts/dashboard.clj rename to interpreter-lib/tests/scripts/dashboard.clj diff --git a/stepper-lib/tests/scripts/network_explore.clj b/interpreter-lib/tests/scripts/network_explore.clj similarity index 100% rename from stepper-lib/tests/scripts/network_explore.clj rename to interpreter-lib/tests/scripts/network_explore.clj diff --git a/stepper-lib/tests/security_tetraplets.rs b/interpreter-lib/tests/security_tetraplets.rs similarity index 97% rename from stepper-lib/tests/security_tetraplets.rs rename to interpreter-lib/tests/security_tetraplets.rs index 8d0de697..9481048a 100644 --- a/stepper-lib/tests/security_tetraplets.rs +++ b/interpreter-lib/tests/security_tetraplets.rs @@ -19,8 +19,8 @@ use aqua_test_utils::create_aqua_vm; use aqua_test_utils::CallServiceClosure; use aqua_test_utils::IValue; use aqua_test_utils::NEVec; -use stepper_lib::ResolvedTriplet; -use stepper_lib::SecurityTetraplet; +use interpreter_lib::ResolvedTriplet; +use interpreter_lib::SecurityTetraplet; use std::cell::RefCell; use std::rc::Rc; @@ -199,10 +199,10 @@ use fluence_app_service::AppService; use fluence_app_service::AppServiceConfig; use fluence_app_service::FaaSConfig; +use interpreter_lib::execution_trace::CallResult; +use interpreter_lib::execution_trace::ExecutedState; +use interpreter_lib::execution_trace::ExecutionTrace; use std::path::PathBuf; -use stepper_lib::execution_trace::CallResult; -use stepper_lib::execution_trace::ExecutedState; -use stepper_lib::execution_trace::ExecutionTrace; fn construct_service_config(module_name: impl Into) -> AppServiceConfig { let module_name = module_name.into(); diff --git a/stepper-lib/tests/security_tetraplets/auth_module/Cargo.lock b/interpreter-lib/tests/security_tetraplets/auth_module/Cargo.lock similarity index 99% rename from stepper-lib/tests/security_tetraplets/auth_module/Cargo.lock rename to interpreter-lib/tests/security_tetraplets/auth_module/Cargo.lock index 78fc5af3..1b9637eb 100644 --- a/stepper-lib/tests/security_tetraplets/auth_module/Cargo.lock +++ b/interpreter-lib/tests/security_tetraplets/auth_module/Cargo.lock @@ -67,7 +67,7 @@ name = "auth_module" version = "0.1.0" dependencies = [ "fluence", - "stepper-lib", + "interpreter-lib", ] [[package]] @@ -673,7 +673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" [[package]] -name = "stepper-interface" +name = "interpreter-interface" version = "0.1.2" dependencies = [ "fluence", @@ -682,7 +682,7 @@ dependencies = [ ] [[package]] -name = "stepper-lib" +name = "interpreter-lib" version = "0.5.0" dependencies = [ "air-parser", @@ -693,7 +693,7 @@ dependencies = [ "polyplets", "serde", "serde_json", - "stepper-interface", + "interpreter-interface", "thiserror", "wasm-bindgen", ] diff --git a/stepper-lib/tests/security_tetraplets/auth_module/Cargo.toml b/interpreter-lib/tests/security_tetraplets/auth_module/Cargo.toml similarity index 79% rename from stepper-lib/tests/security_tetraplets/auth_module/Cargo.toml rename to interpreter-lib/tests/security_tetraplets/auth_module/Cargo.toml index 184f33c5..e6e52dc7 100644 --- a/stepper-lib/tests/security_tetraplets/auth_module/Cargo.toml +++ b/interpreter-lib/tests/security_tetraplets/auth_module/Cargo.toml @@ -9,7 +9,7 @@ name = "auth_module" path = "src/main.rs" [dependencies] -stepper-lib = { path = "../../../../stepper-lib" } +interpreter-lib = { path = "../../../../interpreter-lib" } fluence = { version = "0.2.18", features = ["logger"] } [workspace] diff --git a/stepper-lib/tests/security_tetraplets/auth_module/src/main.rs b/interpreter-lib/tests/security_tetraplets/auth_module/src/main.rs similarity index 100% rename from stepper-lib/tests/security_tetraplets/auth_module/src/main.rs rename to interpreter-lib/tests/security_tetraplets/auth_module/src/main.rs diff --git a/stepper-lib/tests/security_tetraplets/log_storage/Cargo.lock b/interpreter-lib/tests/security_tetraplets/log_storage/Cargo.lock similarity index 99% rename from stepper-lib/tests/security_tetraplets/log_storage/Cargo.lock rename to interpreter-lib/tests/security_tetraplets/log_storage/Cargo.lock index 303428cf..daed4b37 100644 --- a/stepper-lib/tests/security_tetraplets/log_storage/Cargo.lock +++ b/interpreter-lib/tests/security_tetraplets/log_storage/Cargo.lock @@ -491,7 +491,7 @@ name = "log_storage" version = "0.1.0" dependencies = [ "fluence", - "stepper-lib", + "interpreter-lib", ] [[package]] @@ -673,7 +673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" [[package]] -name = "stepper-interface" +name = "interpreter-interface" version = "0.1.2" dependencies = [ "fluence", @@ -682,7 +682,7 @@ dependencies = [ ] [[package]] -name = "stepper-lib" +name = "interpreter-lib" version = "0.5.0" dependencies = [ "air-parser", @@ -693,7 +693,7 @@ dependencies = [ "polyplets", "serde", "serde_json", - "stepper-interface", + "interpreter-interface", "thiserror", "wasm-bindgen", ] diff --git a/stepper-lib/tests/security_tetraplets/log_storage/Cargo.toml b/interpreter-lib/tests/security_tetraplets/log_storage/Cargo.toml similarity index 79% rename from stepper-lib/tests/security_tetraplets/log_storage/Cargo.toml rename to interpreter-lib/tests/security_tetraplets/log_storage/Cargo.toml index 7380f48e..1c7eed23 100644 --- a/stepper-lib/tests/security_tetraplets/log_storage/Cargo.toml +++ b/interpreter-lib/tests/security_tetraplets/log_storage/Cargo.toml @@ -9,7 +9,7 @@ name = "log_storage" path = "src/main.rs" [dependencies] -stepper-lib = { path = "../../../../stepper-lib" } +interpreter-lib = { path = "../../../../interpreter-lib" } fluence = { version = "0.2.18", features = ["logger"] } [workspace] diff --git a/stepper-lib/tests/security_tetraplets/log_storage/src/main.rs b/interpreter-lib/tests/security_tetraplets/log_storage/src/main.rs similarity index 100% rename from stepper-lib/tests/security_tetraplets/log_storage/src/main.rs rename to interpreter-lib/tests/security_tetraplets/log_storage/src/main.rs diff --git a/stepper/.rustfmt.toml b/interpreter/.rustfmt.toml similarity index 100% rename from stepper/.rustfmt.toml rename to interpreter/.rustfmt.toml diff --git a/stepper/Cargo.toml b/interpreter/Cargo.toml similarity index 83% rename from stepper/Cargo.toml rename to interpreter/Cargo.toml index b714076a..aed77da1 100644 --- a/stepper/Cargo.toml +++ b/interpreter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aquamarine" -version = "0.5.0" +version = "0.6.0" authors = ["Fluence Labs"] edition = "2018" @@ -14,7 +14,7 @@ name = "aquamarine" path = "src/fce.rs" [dependencies] -stepper-lib = { path = "../stepper-lib" } +interpreter-lib = { path = "../interpreter-lib" } fluence = { version = "0.2.18", features = ["logger"] } @@ -26,4 +26,4 @@ serde = { version = "=1.0.118", features = [ "derive", "rc" ] } serde_json = "1.0" [features] -fce = ["stepper-lib/fce"] +fce = ["interpreter-lib/fce"] diff --git a/stepper/src/ast.rs b/interpreter/src/ast.rs similarity index 96% rename from stepper/src/ast.rs rename to interpreter/src/ast.rs index 4d29c973..56466f4b 100644 --- a/stepper/src/ast.rs +++ b/interpreter/src/ast.rs @@ -14,7 +14,7 @@ * limitations under the License. */ -use stepper_lib::parser::parse; +use interpreter_lib::parser::parse; /// Parse AIR script and return it as minified JSON pub fn ast(script: String) -> String { diff --git a/stepper/src/fce.rs b/interpreter/src/fce.rs similarity index 92% rename from stepper/src/fce.rs rename to interpreter/src/fce.rs index f9afed5f..47bfcbad 100644 --- a/stepper/src/fce.rs +++ b/interpreter/src/fce.rs @@ -30,9 +30,9 @@ mod ast; mod logger; use fluence::fce; +use interpreter_lib::execute_aqua; +use interpreter_lib::InterpreterOutcome; use logger::DEFAULT_LOG_LEVEL; -use stepper_lib::execute_aqua; -use stepper_lib::StepperOutcome; use log::Level as LogLevel; @@ -43,7 +43,7 @@ pub fn main() { } #[fce] -pub fn invoke(init_peer_id: String, aqua: String, prev_data: Vec, data: Vec) -> StepperOutcome { +pub fn invoke(init_peer_id: String, aqua: String, prev_data: Vec, data: Vec) -> InterpreterOutcome { let log_level = get_log_level(); log::set_max_level(log_level.to_level_filter()); diff --git a/stepper/src/logger.rs b/interpreter/src/logger.rs similarity index 95% rename from stepper/src/logger.rs rename to interpreter/src/logger.rs index b9d2bc72..1a7948ed 100644 --- a/stepper/src/logger.rs +++ b/interpreter/src/logger.rs @@ -14,7 +14,7 @@ * limitations under the License. */ -use stepper_lib::log_targets::TARGET_MAP; +use interpreter_lib::log_targets::TARGET_MAP; use log::Level as LogLevel; diff --git a/stepper/src/wasm_bindgen.rs b/interpreter/src/wasm_bindgen.rs similarity index 92% rename from stepper/src/wasm_bindgen.rs rename to interpreter/src/wasm_bindgen.rs index 217bdf7b..2bbfa74a 100644 --- a/stepper/src/wasm_bindgen.rs +++ b/interpreter/src/wasm_bindgen.rs @@ -29,8 +29,8 @@ mod ast; mod logger; +use interpreter_lib::execute_aqua; use logger::DEFAULT_LOG_LEVEL; -use stepper_lib::execute_aqua; use wasm_bindgen::prelude::*; @@ -47,7 +47,7 @@ pub fn invoke(init_peer_id: String, aqua: String, prev_data: Vec, data: Vec< log::set_max_level(log_level.to_level_filter()); let outcome = execute_aqua(init_peer_id, aqua, prev_data, data); - serde_json::to_string(&outcome).expect("Cannot parse StepperOutcome") + serde_json::to_string(&outcome).expect("Cannot parse InterpreterOutcome") } #[wasm_bindgen]