Update marine-rs-sdk to 0.7.0 to fix memory leak (#287)

This commit is contained in:
Valery Antopol 2022-07-27 16:40:27 +03:00 committed by GitHub
parent 7d46ae914d
commit 52f0390eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 354 additions and 322 deletions

363
Cargo.lock generated
View File

@ -13,7 +13,7 @@ dependencies = [
[[package]]
name = "air"
version = "0.24.0"
version = "0.25.0"
dependencies = [
"air-execution-info-collector",
"air-interpreter-data",
@ -72,7 +72,7 @@ version = "0.1.0"
[[package]]
name = "air-interpreter"
version = "0.24.0"
version = "0.25.0"
dependencies = [
"air",
"air-log-targets",
@ -99,7 +99,7 @@ dependencies = [
[[package]]
name = "air-interpreter-interface"
version = "0.10.0"
version = "0.11.0"
dependencies = [
"fluence-it-types",
"marine-rs-sdk",
@ -161,7 +161,7 @@ dependencies = [
[[package]]
name = "air-test-utils"
version = "0.2.1"
version = "0.3.0"
dependencies = [
"air",
"air-interpreter-interface",
@ -270,15 +270,15 @@ dependencies = [
[[package]]
name = "avm-server"
version = "0.23.0"
version = "0.24.0"
dependencies = [
"air-interpreter-interface",
"air-utils",
"avm-data-store",
"eyre",
"fluence-faas",
"log",
"maplit",
"marine-runtime",
"parking_lot 0.11.2",
"polyplets",
"serde",
@ -873,47 +873,17 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
[[package]]
name = "fluence-app-service"
version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8057f761b34a5bfb840e9062c9228306c8c8dd72f7bccf1c311d03f0ece13966"
version = "0.18.0"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"fluence-faas",
"log",
"maplit",
"marine-min-it-version",
"serde",
"serde_derive",
"serde_json",
"toml",
"wasmer-wasi-fl",
]
[[package]]
name = "fluence-faas"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc936ee9f17ecd8f0cf10f9364c17fe76cbf6a07299f1d35c649e9415bc8821c"
dependencies = [
"bytesize",
"cmd_lib",
"it-json-serde",
"itertools 0.9.0",
"log",
"marine-module-interface",
"marine-rs-sdk",
"marine-rs-sdk-main",
"marine-runtime",
"marine-utils",
"safe-transmute",
"serde",
"serde_derive",
"serde_json",
"serde_with",
"thiserror",
"toml",
"wasmer-interface-types-fl",
"wasmer-runtime-core-fl",
"wasmer-runtime-fl",
"wasmer-wasi-fl",
]
@ -1132,8 +1102,7 @@ dependencies = [
[[package]]
name = "it-json-serde"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e3b7efb8eeb6892a947928c10ac963e5d5101c173924453466314bf004306b4"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"serde",
"serde_derive",
@ -1308,147 +1277,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]]
name = "marine-it-generator"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25eea53765b0886afd41197861c9a2a6a2d09dbd5f723833df35f38a71affa2a"
dependencies = [
"cargo_toml",
"it-lilo",
"marine-it-parser",
"marine-macro-impl",
"once_cell",
"serde",
"serde_json",
"thiserror",
"walrus",
"wasmer-interface-types-fl",
]
[[package]]
name = "marine-it-interfaces"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3236d1068eaa0f1a07ab74b098b777c150c0c354a16d8869cd69ae3ff847014"
dependencies = [
"multimap",
"wasmer-interface-types-fl",
]
[[package]]
name = "marine-it-parser"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edea8966aa56f373e3b2db95432b023e20137c7d58798f74a67ee5749370d289"
dependencies = [
"anyhow",
"itertools 0.10.3",
"marine-it-interfaces",
"marine-module-interface",
"nom",
"semver 0.11.0",
"serde",
"thiserror",
"walrus",
"wasmer-interface-types-fl",
"wasmer-runtime-core-fl",
]
[[package]]
name = "marine-macro"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfc907943772cf966ebe2a2d462d09bc79e898ef102ed065ba3d3abcc93fbb71"
dependencies = [
"marine-macro-impl",
"marine-rs-sdk-main",
]
[[package]]
name = "marine-macro-impl"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdbed3a10ae9b22df06bee8cd0023255358935aae8e8daf9d1a006cfaeeb11e"
dependencies = [
"proc-macro2",
"quote",
"serde",
"serde_json",
"syn",
"uuid",
]
[[package]]
name = "marine-min-it-version"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "890269754a531810b8c16cf00e6161e01c1183ef7ff4ff20117656316e9fdbd1"
dependencies = [
"once_cell",
"semver 0.11.0",
]
[[package]]
name = "marine-module-info-parser"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ec8f4ab2eeeb5c1d66d9b56fe6b0b5bf39820aa8cc2f1d7be42bdf95654d529"
dependencies = [
"anyhow",
"chrono",
"marine-rs-sdk-main",
"semver 0.11.0",
"serde",
"thiserror",
"walrus",
"wasmer-runtime-core-fl",
]
[[package]]
name = "marine-module-interface"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb284ad998636d64bfad9fef2849d8a02127ce9c094b4a3e53b2eb62c14e5e5f"
dependencies = [
"anyhow",
"itertools 0.10.3",
"marine-it-interfaces",
"nom",
"semver 0.11.0",
"serde",
"thiserror",
"walrus",
"wasmer-interface-types-fl",
]
[[package]]
name = "marine-rs-sdk"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d17d44016675abdf18caf3ac1bdd4437cc17ec0db019da141bb06a9ea991726"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
"marine-timestamp-macro",
"polyplets",
"serde",
]
[[package]]
name = "marine-rs-sdk-main"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ff262801664ce22f9d274504d6e8088c217034aba0ca431eca8d0258f3699c6"
dependencies = [
"log",
"serde",
]
[[package]]
name = "marine-runtime"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d36a361cb7ce770c78c979d784d877982042a16fef97043cb3bec1a4eaff5935"
name = "marine-core"
version = "0.16.0"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"anyhow",
"boolinator",
@ -1478,10 +1309,169 @@ dependencies = [
]
[[package]]
name = "marine-timestamp-macro"
version = "0.6.15"
name = "marine-it-generator"
version = "0.8.1"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"cargo_toml",
"it-lilo",
"marine-it-parser",
"marine-macro-impl",
"once_cell",
"serde",
"serde_json",
"thiserror",
"walrus",
"wasmer-interface-types-fl",
]
[[package]]
name = "marine-it-interfaces"
version = "0.7.1"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"multimap",
"wasmer-interface-types-fl",
]
[[package]]
name = "marine-it-parser"
version = "0.9.1"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"anyhow",
"itertools 0.10.3",
"marine-it-interfaces",
"marine-module-interface",
"nom",
"semver 0.11.0",
"serde",
"thiserror",
"walrus",
"wasmer-interface-types-fl",
"wasmer-runtime-core-fl",
]
[[package]]
name = "marine-macro"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85a9f5b1adeff98ac5a14cfc5fa814185a807ba4a0d3849c9f9e9fd868b27d1f"
checksum = "c5f21b40612e9da310a6df1e394cc30b4962bb4ddc13ee50faec6d2704861b7b"
dependencies = [
"marine-macro-impl",
"marine-rs-sdk-main",
]
[[package]]
name = "marine-macro-impl"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f43b2b1e5bc5aebdaac7029cfd84a038cd11b23a023e724548f863618716f44e"
dependencies = [
"proc-macro2",
"quote",
"serde",
"serde_json",
"syn",
"uuid",
]
[[package]]
name = "marine-min-it-version"
version = "0.1.0"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"once_cell",
"semver 0.11.0",
]
[[package]]
name = "marine-module-info-parser"
version = "0.2.2"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"anyhow",
"chrono",
"marine-rs-sdk-main",
"semver 0.11.0",
"serde",
"thiserror",
"walrus",
"wasmer-runtime-core-fl",
]
[[package]]
name = "marine-module-interface"
version = "0.4.1"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"anyhow",
"itertools 0.10.3",
"marine-it-interfaces",
"nom",
"semver 0.11.0",
"serde",
"thiserror",
"walrus",
"wasmer-interface-types-fl",
]
[[package]]
name = "marine-rs-sdk"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4208762a010c41a6352a651061fcd1a7bb077c6a3548be8ccd84fe79c3e1ddbd"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
"marine-timestamp-macro",
"polyplets",
"serde",
]
[[package]]
name = "marine-rs-sdk-main"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0751f4093511b4d8942bed9402dba70ff927cb4df9b18632443294d1cbc51e1a"
dependencies = [
"log",
"serde",
]
[[package]]
name = "marine-runtime"
version = "0.18.0"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
dependencies = [
"bytesize",
"cmd_lib",
"it-json-serde",
"itertools 0.9.0",
"log",
"marine-core",
"marine-module-interface",
"marine-rs-sdk",
"marine-rs-sdk-main",
"marine-utils",
"safe-transmute",
"serde",
"serde_derive",
"serde_json",
"serde_with",
"thiserror",
"toml",
"wasmer-interface-types-fl",
"wasmer-runtime-core-fl",
"wasmer-runtime-fl",
"wasmer-wasi-fl",
]
[[package]]
name = "marine-timestamp-macro"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5297d57cecd75d71feb0c94da9027891e3c31215e23425b0e5dea9a5a7e60230"
dependencies = [
"chrono",
"quote",
@ -1490,8 +1480,7 @@ dependencies = [
[[package]]
name = "marine-utils"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cff7a23a7f3925a712c34dfb9cd87994012d7743f016fd1533e12ab5a8335ca"
source = "git+https://github.com/fluencelabs/marine?branch=feat/support-handmade-reactors#9e0812d02341e52ad0c810cc542827a732bbf2c4"
[[package]]
name = "matchers"
@ -1813,7 +1802,7 @@ dependencies = [
[[package]]
name = "polyplets"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",

View File

@ -1,6 +1,6 @@
[package]
name = "air-interpreter"
version = "0.24.0"
version = "0.25.0"
description = "Crate-wrapper for air"
authors = ["Fluence Labs"]
edition = "2018"
@ -21,7 +21,7 @@ path = "src/marine.rs"
air = { path = "../air" }
air-log-targets = { path = "../crates/air-lib/log-targets" }
marine-rs-sdk = { version = "0.6.15", features = ["logger"] }
marine-rs-sdk = { version = "0.7.0", features = ["logger"] }
# Keep 0.2.65 until this is resolved https://github.com/rustwasm/wasm-pack/issues/886
wasm-bindgen = "=0.2.65"

View File

@ -37,29 +37,7 @@ use marine_rs_sdk::module_manifest;
module_manifest!();
/*
_initialize function that calls __wasm_call_ctors is required to mitigate memory leak
that is described in https://github.com/WebAssembly/wasi-libc/issues/298.
In short, without this code rust wraps every export function
with __wasm_call_ctors/__wasm_call_dtors calls. This causes memory leaks. When compiler sees
an explicit call to __wasm_call_ctors in _initialize function, it disables export wrapping.
TODO: remove when updating to marine-rs-sdk with fix
*/
extern "C" {
fn __wasm_call_ctors();
}
#[no_mangle]
pub fn _initialize() {
unsafe {
__wasm_call_ctors();
}
}
pub fn main() {
_initialize(); // As __wasm_call_ctors still does necessary work, we call it at the start of the module.
logger::init_logger(None);
}

View File

@ -1,6 +1,6 @@
[package]
name = "air"
version = "0.24.0"
version = "0.25.0"
description = "Interpreter of AIR scripts intended to coordinate request flow in the Fluence network"
authors = ["Fluence Labs"]
edition = "2018"
@ -25,7 +25,7 @@ air-lambda-parser = { path = "../crates/air-lib/lambda/parser" }
air-trace-handler = { path = "../crates/air-lib/trace-handler" }
air-utils = { version = "0.1.0", path = "../crates/air-lib/utils" }
polyplets = { path = "../crates/air-lib/polyplets" }
marine-rs-sdk = { version = "0.6.15", features = ["logger"] }
marine-rs-sdk = { version = "0.7.0", features = ["logger"] }
serde = { version = "1.0.118", features = [ "derive", "rc" ] }
serde_json = "1.0.61"
@ -46,7 +46,7 @@ wasm-bindgen = "=0.2.65"
[dev_dependencies]
air-test-utils = { path = "../crates/air-lib/test-utils" }
fluence-app-service = "0.17.2"
fluence-app-service = "0.18.0"
# the feature just silence a warning in the criterion 0.3.x.
criterion = { version = "0.3.3", features = ["html_reports"] }

View File

@ -198,7 +198,7 @@ fn check_tetraplet_works_correctly() {
use fluence_app_service::AppService;
use fluence_app_service::AppServiceConfig;
use fluence_app_service::FaaSConfig;
use fluence_app_service::MarineConfig;
use fluence_app_service::ModuleDescriptor;
use air_test_utils::trace_from_result;
@ -214,7 +214,7 @@ fn construct_service_config(module_name: impl Into<String>) -> AppServiceConfig
..<_>::default()
};
let faas_config = FaaSConfig {
let marine_config = MarineConfig {
modules_dir: Some(PathBuf::from(module_path)),
modules_config: vec![module_descriptor],
default_modules_config: None,
@ -224,7 +224,7 @@ fn construct_service_config(module_name: impl Into<String>) -> AppServiceConfig
let config = AppServiceConfig {
service_base_dir,
faas_config,
marine_config,
};
config

View File

@ -13,7 +13,7 @@ dependencies = [
[[package]]
name = "air"
version = "0.24.0"
version = "0.25.0"
dependencies = [
"air-execution-info-collector",
"air-interpreter-data",
@ -23,6 +23,7 @@ dependencies = [
"air-log-targets",
"air-parser",
"air-trace-handler",
"air-utils",
"boolinator",
"concat-idents",
"fstrings",
@ -30,12 +31,13 @@ dependencies = [
"maplit",
"marine-rs-sdk",
"non-empty-vec",
"polyplets 0.2.0",
"polyplets",
"serde",
"serde_json",
"strum",
"strum_macros",
"thiserror",
"tracing",
"wasm-bindgen",
]
@ -47,15 +49,17 @@ version = "0.1.0"
name = "air-interpreter-data"
version = "0.2.2"
dependencies = [
"air-utils",
"once_cell",
"semver",
"serde",
"serde_json",
"tracing",
]
[[package]]
name = "air-interpreter-interface"
version = "0.10.0"
version = "0.11.0"
dependencies = [
"fluence-it-types",
"marine-rs-sdk",
@ -109,6 +113,7 @@ dependencies = [
"serde",
"serde_json",
"thiserror",
"tracing",
]
[[package]]
@ -121,8 +126,13 @@ dependencies = [
"log",
"serde_json",
"thiserror",
"tracing",
]
[[package]]
name = "air-utils"
version = "0.1.0"
[[package]]
name = "ascii-canvas"
version = "3.0.0"
@ -457,9 +467,8 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]]
name = "marine-macro"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfc907943772cf966ebe2a2d462d09bc79e898ef102ed065ba3d3abcc93fbb71"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"marine-macro-impl",
"marine-rs-sdk-main",
@ -467,9 +476,8 @@ dependencies = [
[[package]]
name = "marine-macro-impl"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdbed3a10ae9b22df06bee8cd0023255358935aae8e8daf9d1a006cfaeeb11e"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"proc-macro2",
"quote",
@ -481,22 +489,20 @@ dependencies = [
[[package]]
name = "marine-rs-sdk"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d17d44016675abdf18caf3ac1bdd4437cc17ec0db019da141bb06a9ea991726"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
"marine-timestamp-macro",
"polyplets 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"polyplets",
"serde",
]
[[package]]
name = "marine-rs-sdk-main"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ff262801664ce22f9d274504d6e8088c217034aba0ca431eca8d0258f3699c6"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"log",
"serde",
@ -504,9 +510,8 @@ dependencies = [
[[package]]
name = "marine-timestamp-macro"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85a9f5b1adeff98ac5a14cfc5fa814185a807ba4a0d3849c9f9e9fd868b27d1f"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"chrono",
"quote",
@ -563,9 +568,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.8.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "petgraph"
@ -593,19 +598,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d7afeb98c5a10e0bffcc7fc16e105b04d06729fac5fd6384aebf7ff5cb5a67d"
[[package]]
name = "polyplets"
version = "0.2.0"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
"serde",
]
name = "pin-project-lite"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
[[package]]
name = "polyplets"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cc56e7803860fa903c27675a17215e1cfb39fb26e111c0b93f6c049f9cf8d8e"
version = "0.3.0"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
@ -837,6 +837,38 @@ dependencies = [
"crunchy",
]
[[package]]
name = "tracing"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160"
dependencies = [
"cfg-if 1.0.0",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tracing-core"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7"
dependencies = [
"once_cell",
]
[[package]]
name = "unicode-segmentation"
version = "1.9.0"

View File

@ -10,6 +10,6 @@ path = "src/main.rs"
[dependencies]
air = { path = "../../../../../../../air" }
marine-rs-sdk = "0.6.15"
marine-rs-sdk = "0.7.0"
[workspace]

View File

@ -13,7 +13,7 @@ dependencies = [
[[package]]
name = "air"
version = "0.24.0"
version = "0.25.0"
dependencies = [
"air-execution-info-collector",
"air-interpreter-data",
@ -23,6 +23,7 @@ dependencies = [
"air-log-targets",
"air-parser",
"air-trace-handler",
"air-utils",
"boolinator",
"concat-idents",
"fstrings",
@ -30,12 +31,13 @@ dependencies = [
"maplit",
"marine-rs-sdk",
"non-empty-vec",
"polyplets 0.2.0",
"polyplets",
"serde",
"serde_json",
"strum",
"strum_macros",
"thiserror",
"tracing",
"wasm-bindgen",
]
@ -47,15 +49,17 @@ version = "0.1.0"
name = "air-interpreter-data"
version = "0.2.2"
dependencies = [
"air-utils",
"once_cell",
"semver",
"serde",
"serde_json",
"tracing",
]
[[package]]
name = "air-interpreter-interface"
version = "0.10.0"
version = "0.11.0"
dependencies = [
"fluence-it-types",
"marine-rs-sdk",
@ -109,6 +113,7 @@ dependencies = [
"serde",
"serde_json",
"thiserror",
"tracing",
]
[[package]]
@ -121,8 +126,13 @@ dependencies = [
"log",
"serde_json",
"thiserror",
"tracing",
]
[[package]]
name = "air-utils"
version = "0.1.0"
[[package]]
name = "ascii-canvas"
version = "3.0.0"
@ -457,9 +467,8 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]]
name = "marine-macro"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfc907943772cf966ebe2a2d462d09bc79e898ef102ed065ba3d3abcc93fbb71"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"marine-macro-impl",
"marine-rs-sdk-main",
@ -467,9 +476,8 @@ dependencies = [
[[package]]
name = "marine-macro-impl"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdbed3a10ae9b22df06bee8cd0023255358935aae8e8daf9d1a006cfaeeb11e"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"proc-macro2",
"quote",
@ -481,22 +489,20 @@ dependencies = [
[[package]]
name = "marine-rs-sdk"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d17d44016675abdf18caf3ac1bdd4437cc17ec0db019da141bb06a9ea991726"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
"marine-timestamp-macro",
"polyplets 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"polyplets",
"serde",
]
[[package]]
name = "marine-rs-sdk-main"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ff262801664ce22f9d274504d6e8088c217034aba0ca431eca8d0258f3699c6"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"log",
"serde",
@ -504,9 +510,8 @@ dependencies = [
[[package]]
name = "marine-timestamp-macro"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85a9f5b1adeff98ac5a14cfc5fa814185a807ba4a0d3849c9f9e9fd868b27d1f"
version = "0.7.0"
source = "git+https://github.com/fluencelabs/marine-rs-sdk?branch=feat/VM-115-wasm_ctors_workaround#cb08224a3ed89926383af771fee9541322711eb5"
dependencies = [
"chrono",
"quote",
@ -563,9 +568,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.8.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "petgraph"
@ -593,19 +598,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d7afeb98c5a10e0bffcc7fc16e105b04d06729fac5fd6384aebf7ff5cb5a67d"
[[package]]
name = "polyplets"
version = "0.2.0"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
"serde",
]
name = "pin-project-lite"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
[[package]]
name = "polyplets"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cc56e7803860fa903c27675a17215e1cfb39fb26e111c0b93f6c049f9cf8d8e"
version = "0.3.0"
dependencies = [
"marine-macro",
"marine-rs-sdk-main",
@ -837,6 +837,38 @@ dependencies = [
"crunchy",
]
[[package]]
name = "tracing"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160"
dependencies = [
"cfg-if 1.0.0",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tracing-core"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7"
dependencies = [
"once_cell",
]
[[package]]
name = "unicode-segmentation"
version = "1.9.0"

View File

@ -10,6 +10,6 @@ path = "src/main.rs"
[dependencies]
air = { path = "../../../../../../../air" }
marine-rs-sdk = "0.6.15"
marine-rs-sdk = "0.7.0"
[workspace]

View File

@ -1,7 +1,7 @@
[package]
name = "avm-server"
description = "Fluence AIR VM"
version = "0.23.0"
version = "0.24.0"
authors = ["Fluence Labs"]
edition = "2018"
license = "Apache-2.0"
@ -16,11 +16,11 @@ name = "avm_server"
path = "src/lib.rs"
[dependencies]
air-interpreter-interface = { version = "0.10.0", path = "../../crates/air-lib/interpreter-interface" }
air-interpreter-interface = { version = "0.11.0", path = "../../crates/air-lib/interpreter-interface" }
air-utils = { version = "0.1.0", path = "../../crates/air-lib/utils" }
avm-data-store = { version = "0.4.0", path = "../../crates/data-store" }
fluence-faas = "0.16.2"
polyplets = { version = "0.2.0", path = "../../crates/air-lib/polyplets" }
marine-runtime = "0.18.0"
polyplets = { version = "0.3.0", path = "../../crates/air-lib/polyplets" }
eyre = "0.6.5"
thiserror = "1.0.29"

View File

@ -15,8 +15,8 @@
*/
use crate::interface::ErrorAVMOutcome;
use fluence_faas::FaaSError;
use fluence_faas::IValue;
use marine::IValue;
use marine::MarineError;
use serde_json::Error as SerdeError;
use thiserror::Error as ThisError;
@ -48,7 +48,7 @@ pub enum AVMError<E> {
pub enum RunnerError {
/// This errors are encountered from FaaS.
#[error(transparent)]
FaaSError(#[from] FaaSError),
MarineError(#[from] MarineError),
/// Specified path to AIR interpreter .wasm file was invalid
#[error("path to AIR interpreter .wasm ({invalid_path:?}) is invalid: {reason}; IO Error: {io_error:?}")]
@ -62,10 +62,10 @@ pub enum RunnerError {
#[error("{0}")]
InterpreterResultDeError(String),
/// FaaS call returns Vec<IValue> to support multi-value in a future,
/// Marine call returns Vec<IValue> to support multi-value in a future,
/// but actually now it could return empty vec or a vec with one value.
/// This error is encountered when it returns vec with not a one value.
#[error("result `{0:?}` returned from FaaS should contain only one element")]
#[error("result `{0:?}` returned from Marine should contain only one element")]
IncorrectInterpreterResult(Vec<IValue>),
/// This errors are encountered from an call results/params se/de.

View File

@ -42,13 +42,13 @@ pub mod avm_runner {
}
// Re-exports
pub use fluence_faas::ne_vec;
pub use fluence_faas::Ctx;
pub use fluence_faas::HostExportedFunc;
pub use fluence_faas::HostImportDescriptor;
pub use fluence_faas::HostImportError;
pub use fluence_faas::IType;
pub use fluence_faas::IValue;
pub use marine::ne_vec;
pub use marine::Ctx;
pub use marine::HostExportedFunc;
pub use marine::HostImportDescriptor;
pub use marine::HostImportError;
pub use marine::IType;
pub use marine::IValue;
pub use polyplets::SecurityTetraplet;

View File

@ -21,15 +21,15 @@ use crate::RunnerResult;
use air_interpreter_interface::InterpreterOutcome;
use air_utils::measure;
use fluence_faas::FaaSConfig;
use fluence_faas::FluenceFaaS;
use fluence_faas::IValue;
use fluence_faas::ModuleDescriptor;
use marine::IValue;
use marine::Marine;
use marine::MarineConfig;
use marine::ModuleDescriptor;
use std::path::PathBuf;
pub struct AVMRunner {
faas: FluenceFaaS,
marine: Marine,
current_peer_id: String,
/// file name of the AIR interpreter .wasm
wasm_filename: String,
@ -54,12 +54,13 @@ impl AVMRunner {
) -> RunnerResult<Self> {
let (wasm_dir, wasm_filename) = split_dirname(air_wasm_path)?;
let faas_config = make_faas_config(wasm_dir, &wasm_filename, max_heap_size, logging_mask);
let faas = FluenceFaaS::with_raw_config(faas_config)?;
let marine_config =
make_marine_config(wasm_dir, &wasm_filename, max_heap_size, logging_mask);
let marine = Marine::with_raw_config(marine_config)?;
let current_peer_id = current_peer_id.into();
let avm = Self {
faas,
marine,
current_peer_id,
wasm_filename,
};
@ -90,10 +91,10 @@ impl AVMRunner {
);
let result = measure!(
self.faas
self.marine
.call_with_ivalues(&self.wasm_filename, "invoke", &args, <_>::default())?,
tracing::Level::INFO,
"faas.call_with_ivalues",
"marine.call_with_ivalues",
method = "invoke",
);
@ -132,14 +133,14 @@ impl AVMRunner {
args.push(IValue::U8(tracing_output_mode));
let result = measure!(
self.faas.call_with_ivalues(
self.marine.call_with_ivalues(
&self.wasm_filename,
"invoke_tracing",
&args,
<_>::default(),
)?,
tracing::Level::INFO,
"faas.call_with_ivalues",
"marine.call_with_ivalues",
method = "invoke_tracing",
);
@ -152,9 +153,9 @@ impl AVMRunner {
}
pub fn memory_stats(&self) -> AVMMemoryStats {
let stats = self.faas.module_memory_stats();
let stats = self.marine.module_memory_stats();
// only the interpreters must be loaded in FaaS
// only the interpreters must be loaded in Marine
debug_assert!(stats.len() == 1);
AVMMemoryStats {
@ -237,13 +238,13 @@ fn split_dirname(path: PathBuf) -> RunnerResult<(PathBuf, String)> {
Ok((path, file_name))
}
fn make_faas_config(
fn make_marine_config(
air_wasm_dir: PathBuf,
air_wasm_file: &str,
max_heap_size: Option<u64>,
logging_mask: i32,
) -> FaaSConfig {
let air_module_config = fluence_faas::FaaSModuleConfig {
) -> MarineConfig {
let air_module_config = marine::MarineModuleConfig {
mem_pages_count: None,
max_heap_size,
logger_enabled: true,
@ -252,7 +253,7 @@ fn make_faas_config(
logging_mask,
};
FaaSConfig {
MarineConfig {
modules_dir: Some(air_wasm_dir),
modules_config: vec![ModuleDescriptor {
file_name: String::from(air_wasm_file),

View File

@ -1,7 +1,7 @@
[package]
name = "air-interpreter-interface"
description = "Interface of the AIR interpreter"
version = "0.10.0"
version = "0.11.0"
authors = ["Fluence Labs"]
edition = "2018"
license = "Apache-2.0"
@ -16,7 +16,7 @@ name = "air_interpreter_interface"
path = "src/lib.rs"
[dependencies]
marine-rs-sdk = "0.6.15"
marine-rs-sdk = "0.7.0"
fluence-it-types = "0.3.0"
serde = "1.0.118"

View File

@ -1,6 +1,6 @@
[package]
name = "polyplets"
version = "0.2.0"
version = "0.3.0"
description = "Security primitives to verify origin of service calls in Fluence network"
authors = ["Fluence Labs"]
edition = "2018"
@ -16,7 +16,7 @@ name = "polyplets"
path = "src/lib.rs"
[dependencies]
marine-macro = "0.6.15"
marine-rs-sdk-main = "0.6.15"
marine-macro = "0.7.0"
marine-rs-sdk-main = "0.7.0"
serde = { version = "1.0.118", features = ["rc", "derive"] }

View File

@ -1,6 +1,6 @@
[package]
name = "air-test-utils"
version = "0.2.1"
version = "0.3.0"
description = "Test utils for the AIR interpreter"
authors = ["Fluence Labs"]
edition = "2018"
@ -17,7 +17,7 @@ path = "src/lib.rs"
air = { path = "../../../air" }
air-interpreter-interface = { path = "../interpreter-interface" }
avm-server = { path = "../../../avm/server" }
marine-rs-sdk = "0.6.15"
marine-rs-sdk = "0.7.0"
fstrings = "0.2.3"
object-pool = "0.5.4"