From 93f71908e0ec79a0f9316e282f078e4cb5c460e5 Mon Sep 17 00:00:00 2001 From: Mike Voronov Date: Thu, 3 Jun 2021 11:41:25 +0300 Subject: [PATCH] AIR 0.10.0 (#113) Co-authored-by: Pavel Murygin --- Cargo.lock | 115 +++++++++--------- air-interpreter/Cargo.toml | 2 +- air/Cargo.toml | 2 +- avm/client/package-lock.json | 2 +- avm/client/src/index.ts | 8 +- .../air-parser/src/parser/lexer/air_lexer.rs | 6 +- 6 files changed, 71 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b71b721..b21036bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "air" -version = "0.9.0" +version = "0.10.0" dependencies = [ "air-interpreter-interface", "air-parser", @@ -38,7 +38,7 @@ dependencies = [ [[package]] name = "air-interpreter" -version = "0.9.0" +version = "0.10.0" dependencies = [ "air", "fluence", @@ -214,9 +214,9 @@ dependencies = [ [[package]] name = "blake3" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" +checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" dependencies = [ "arrayref", "arrayvec", @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[package]] name = "byteorder" @@ -270,18 +270,18 @@ dependencies = [ [[package]] name = "cast" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc38c385bfd7e444464011bb24820f40dd1c76bcdfa1b78611cb7c2e5cafab75" +checksum = "57cdfa5d50aad6cb4d44dcab6101a7f79925bd59d82ca42f38a9856a28865374" dependencies = [ - "rustc_version", + "rustc_version 0.3.3", ] [[package]] name = "cc" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" [[package]] name = "cfg-if" @@ -478,9 +478,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52fb27eab85b17fbb9f6fd667089e07d6a2eb8743d02639ee7f6a7a7729c9c94" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -491,11 +491,10 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg", "cfg-if 1.0.0", "lazy_static", ] @@ -619,9 +618,9 @@ dependencies = [ [[package]] name = "erased-serde" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" +checksum = "e5b36e6f2295f393f44894c6031f67df4d185b984cd54d08f768ce678007efcd" dependencies = [ "serde", ] @@ -655,9 +654,9 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "fluence" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92116bbed3be3afee952d62d6009f1a365bde985a1cf59fb933144308660743" +checksum = "88b09e1cd11a51ba4d169db347d009fe41ece2714eef4d5df720343733a1d5a6" dependencies = [ "fluence-sdk-main", "marine-macro", @@ -720,9 +719,9 @@ dependencies = [ [[package]] name = "fluence-sdk-main" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbf30472768d331ea6a6853bdf1fc6166ba697d46a9ce74c3ccf5764a58414a" +checksum = "68d93cde99e1494e11755a39b93863333397245c9959c774fe3bebd9e4143879" dependencies = [ "log", "marine-macro", @@ -813,9 +812,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1059,9 +1058,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" +checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" [[package]] name = "lock_api" @@ -1143,18 +1142,18 @@ dependencies = [ [[package]] name = "marine-macro" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9107f5956f578d4815a17c963836cffadf481801ae453e0247693e87f1de734" +checksum = "f63d927851847cc3dd9e3bd0f10bdeb313859d4822d5b5f650d9d34d461ed419" dependencies = [ "marine-macro-impl", ] [[package]] name = "marine-macro-impl" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7244dd6e5d624bb9d1e63777c3bbc3a8c857973d2b7633aa8d0b612d7770a55d" +checksum = "fb504be4a90e229ab453c7369cc8a9063acec819f3397802eea719cd0a232be1" dependencies = [ "proc-macro2", "quote", @@ -1211,9 +1210,9 @@ dependencies = [ [[package]] name = "marine-timestamp-macro" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb3037577a262360b7e2f0fb5470b7ad0aabcefcb8d2421a4871a854d0a37b2" +checksum = "5994c7db5567d21609f2a2e5a40d9d4564f86c17ca35b2d77007152619b9d7fc" dependencies = [ "chrono", "quote", @@ -1243,9 +1242,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ "autocfg", ] @@ -1506,9 +1505,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ "unicode-xid", ] @@ -1547,14 +1546,14 @@ checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41" dependencies = [ "bitflags", "cc", - "rustc_version", + "rustc_version 0.2.3", ] [[package]] name = "rayon" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg", "crossbeam-deque", @@ -1564,9 +1563,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1614,12 +1613,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -dependencies = [ - "byteorder", -] +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" @@ -1648,6 +1644,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "ryu" version = "1.0.5" @@ -1656,9 +1661,9 @@ checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "safe-transmute" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d95e7284b4bd97e24af76023904cd0157c9cc9da0310beb4139a1e88a748d47" +checksum = "98a01dab6acf992653be49205bdd549f32f17cb2803e8eacf1560bf97259aae8" [[package]] name = "same-file" @@ -1853,18 +1858,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote", @@ -1970,7 +1975,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.3", ] [[package]] @@ -2178,7 +2183,7 @@ dependencies = [ "nix", "page_size", "parking_lot 0.10.2", - "rustc_version", + "rustc_version 0.2.3", "serde", "serde-bench", "serde_bytes", @@ -2207,7 +2212,7 @@ dependencies = [ "nix", "page_size", "parking_lot 0.10.2", - "rustc_version", + "rustc_version 0.2.3", "serde", "serde-bench", "serde_bytes", diff --git a/air-interpreter/Cargo.toml b/air-interpreter/Cargo.toml index 6e8e61f9..d2a9895c 100644 --- a/air-interpreter/Cargo.toml +++ b/air-interpreter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "air-interpreter" -version = "0.9.0" +version = "0.10.0" authors = ["Fluence Labs"] edition = "2018" publish = false diff --git a/air/Cargo.toml b/air/Cargo.toml index 3b010769..0bfb1ec8 100644 --- a/air/Cargo.toml +++ b/air/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "air" -version = "0.9.0" +version = "0.10.0" authors = ["Fluence Labs"] edition = "2018" publish = false diff --git a/avm/client/package-lock.json b/avm/client/package-lock.json index 25170881..88fa4d70 100644 --- a/avm/client/package-lock.json +++ b/avm/client/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@fluencelabs/air-interpreter", + "name": "@fluencelabs/avm", "version": "0.0.0", "lockfileVersion": 1, "requires": true, diff --git a/avm/client/src/index.ts b/avm/client/src/index.ts index dc95049e..4fd7cb9b 100644 --- a/avm/client/src/index.ts +++ b/avm/client/src/index.ts @@ -46,8 +46,8 @@ type ImportObject = { './air_interpreter_client_bg.js': { // fn call_service_impl(service_id: String, fn_name: String, args: String, security_tetraplets: String) -> String; // prettier-ignore - __wbg_callserviceimpl_6ea5db923e95be46: (arg0: any, arg1: any, arg2: any, arg3: any, arg4: any, arg5: any, arg6: any, arg7: any, arg8: any, ) => void; - __wbg_getcurrentpeeridimpl_f15307711f3f0ce6: (arg0: any) => void; + __wbg_callserviceimpl_34891090e13ace2e: (arg0: any, arg1: any, arg2: any, arg3: any, arg4: any, arg5: any, arg6: any, arg7: any, arg8: any, ) => void; + __wbg_getcurrentpeeridimpl_ecf9cb0901ce08ba: (arg0: any) => void; __wbindgen_throw: (arg: any) => void; }; host: LogImport; @@ -133,7 +133,7 @@ function newImportObject( // If so, an error with a new name will be occurred after wasm initialization. './air_interpreter_client_bg.js': { // prettier-ignore - __wbg_callserviceimpl_6ea5db923e95be46: (arg0: any, arg1: any, arg2: any, arg3: any, arg4: any, arg5: any, arg6: any, arg7: any, arg8: any) => { + __wbg_callserviceimpl_34891090e13ace2e: (arg0: any, arg1: any, arg2: any, arg3: any, arg4: any, arg5: any, arg6: any, arg7: any, arg8: any) => { let wasm = cfg.exports; let serviceId = getStringFromWasm0(wasm, arg1, arg2); let fnName = getStringFromWasm0(wasm, arg3, arg4); @@ -162,7 +162,7 @@ function newImportObject( let resultStr = JSON.stringify(serviceResult); return_call_service_result(wasm, resultStr, arg0); }, - __wbg_getcurrentpeeridimpl_f15307711f3f0ce6: (arg0: any) => { + __wbg_getcurrentpeeridimpl_ecf9cb0901ce08ba: (arg0: any) => { let wasm = cfg.exports; return_current_peer_id(wasm, peerId, arg0); }, diff --git a/crates/air-parser/src/parser/lexer/air_lexer.rs b/crates/air-parser/src/parser/lexer/air_lexer.rs index bac89930..168f1c2f 100644 --- a/crates/air-parser/src/parser/lexer/air_lexer.rs +++ b/crates/air-parser/src/parser/lexer/air_lexer.rs @@ -199,8 +199,10 @@ fn parse_last_error(input: &str, start_pos: usize) -> LexerResult> { let last_error_size = LAST_ERROR.len(); let last_error_path = match &input[last_error_size..] { "" => LastErrorPath::None, - ".$.instruction" => LastErrorPath::Instruction, - ".$.msg" => LastErrorPath::Message, + // The second option with ! is needed for compatibility with flattening in "standard" json path used in AIR. + // However version without ! returns just a error, because the opposite is unsound. + ".$.instruction" | ".$.instruction!" => LastErrorPath::Instruction, + ".$.msg" | ".$.msg!" => LastErrorPath::Message, path => { return Err(LexerError::LastErrorPathError( start_pos + last_error_size,