diff --git a/Cargo.lock b/Cargo.lock index 1103ce33616..e2cc44359a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -985,9 +985,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c99d16b88c92aef47e58dadd53e87b4bd234c29934947a6cec8b466300f99b" +checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" dependencies = [ "darling_core", "darling_macro", @@ -995,9 +995,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ea05d2fcb27b53f7a98faddaf5f2914760330ab7703adfc9df13332b42189f9" +checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" dependencies = [ "fnv", "ident_case", @@ -1009,9 +1009,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfb82b62b1b8a2a9808fb4caf844ede819a76cfc23b2827d7f94eefb49551eb" +checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core", "quote 1.0.26", @@ -2366,23 +2366,26 @@ dependencies = [ [[package]] name = "massa-sc-runtime" version = "0.10.0" -source = "git+https://github.com/massalabs/massa-sc-runtime?branch=testnet_22#aff4455ec2ceedf19c95381a8f3ebf4f27873b45" +source = "git+https://github.com/massalabs/massa-sc-runtime?branch=bilboquet/issue235_language_agnostic_smartcontract#885f16e4be57762dda9cdf9761496ebb397320c1" dependencies = [ "anyhow", "as-ffi-bindings", - "base64 0.13.1", + "base64 0.21.0", "chrono", "displaydoc", "function_name", "loupe", "massa_hash 0.1.0 (git+https://github.com/massalabs/massa.git)", "more-asserts 0.3.1", + "num_enum", "parking_lot", + "prost", + "prost-build", "rand 0.8.5", "regex", "serde", "serde_json", - "serial_test 0.8.0", + "serial_test 1.0.0", "sha2 0.10.6", "thiserror", "tracing", @@ -2632,7 +2635,7 @@ dependencies = [ "rand 0.8.5", "rand_xoshiro", "serde_json", - "serial_test 0.10.0", + "serial_test 1.0.0", "sha2 0.10.6", "tempfile", "tokio", @@ -3712,9 +3715,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plotters" @@ -4553,33 +4556,6 @@ dependencies = [ "syn 2.0.15", ] -[[package]] -name = "serial_test" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eec42e7232e5ca56aa59d63af3c7f991fe71ee6a3ddd2d3480834cf3902b007" -dependencies = [ - "futures", - "lazy_static", - "log", - "parking_lot", - "serial_test_derive 0.8.0", -] - -[[package]] -name = "serial_test" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c789ec87f4687d022a2405cf46e0cd6284889f1839de292cadeb6c6019506f2" -dependencies = [ - "dashmap", - "futures", - "lazy_static", - "log", - "parking_lot", - "serial_test_derive 0.10.0", -] - [[package]] name = "serial_test" version = "1.0.0" @@ -4608,30 +4584,6 @@ dependencies = [ "serial_test_derive 2.0.0", ] -[[package]] -name = "serial_test_derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b95bb2f4f624565e8fe8140c789af7e2082c0e0561b5a82a1b678baa9703dc" -dependencies = [ - "proc-macro-error", - "proc-macro2 1.0.56", - "quote 1.0.26", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "serial_test_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64f9e531ce97c88b4778aad0ceee079216071cffec6ac9b904277f8f92e7fe3" -dependencies = [ - "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", -] - [[package]] name = "serial_test_derive" version = "1.0.0" @@ -6056,9 +6008,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69af645a61644c6dd379ade8b77cc87efb5393c988707bad12d3c8e00c50f669" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" dependencies = [ "memchr", ] diff --git a/massa-execution-exports/Cargo.toml b/massa-execution-exports/Cargo.toml index 1f291b1d071..14a67adbd44 100644 --- a/massa-execution-exports/Cargo.toml +++ b/massa-execution-exports/Cargo.toml @@ -22,7 +22,7 @@ massa_storage = { path = "../massa-storage" } massa_final_state = { path = "../massa-final-state" } massa_ledger_exports = { path = "../massa-ledger-exports", optional = true } massa_module_cache = { path = "../massa-module-cache" } -massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "testnet_22" } +massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch="bilboquet/issue235_language_agnostic_smartcontract" } # for more information on what are the following features used for, see the cargo.toml at workspace level diff --git a/massa-execution-worker/Cargo.toml b/massa-execution-worker/Cargo.toml index e94bdbf63b4..f9d201661d6 100644 --- a/massa-execution-worker/Cargo.toml +++ b/massa-execution-worker/Cargo.toml @@ -27,7 +27,7 @@ massa_execution_exports = { path = "../massa-execution-exports" } massa_models = { path = "../massa-models" } massa_storage = { path = "../massa-storage" } massa_hash = { path = "../massa-hash" } -massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "testnet_22" } +massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "bilboquet/issue235_language_agnostic_smartcontract" } massa_module_cache = { path = "../massa-module-cache" } massa_signature = { path = "../massa-signature" } massa_time = { path = "../massa-time" } @@ -40,7 +40,7 @@ massa_versioning_worker = { path = "../massa-versioning-worker" } tokio = { version = "1.23", features = ["sync"] } massa_pos_worker = { path = "../massa-pos-worker" } massa_ledger_worker = { path = "../massa-ledger-worker" } -serial_test = "0.10" +serial_test = "1.0.0" tempfile = "3.2" hex-literal = "0.3.4" # custom modules with testing enabled diff --git a/massa-execution-worker/src/execution.rs b/massa-execution-worker/src/execution.rs index 8761eb611f9..9fb06e58a28 100644 --- a/massa-execution-worker/src/execution.rs +++ b/massa-execution-worker/src/execution.rs @@ -840,10 +840,11 @@ impl ExecutionState { self.config.gas_costs.clone(), ); match response { - Ok(Response { init_cost, .. }) | Err(VMError::ExecutionError { init_cost, .. }) => { + Ok(Response { init_gas_cost, .. }) + | Err(VMError::ExecutionError { init_gas_cost, .. }) => { self.module_cache .write() - .set_init_cost(&bytecode, init_cost); + .set_init_cost(&bytecode, init_gas_cost); } _ => (), } @@ -938,17 +939,17 @@ impl ExecutionState { self.config.gas_costs.clone(), ); match response { - Ok(Response { init_cost, .. }) => { + Ok(Response { init_gas_cost, .. }) => { self.module_cache .write() - .set_init_cost(&bytecode, init_cost); + .set_init_cost(&bytecode, init_gas_cost); Ok(()) } Err(error) => { - if let VMError::ExecutionError { init_cost, .. } = error { + if let VMError::ExecutionError { init_gas_cost, .. } = error { self.module_cache .write() - .set_init_cost(&bytecode, init_cost); + .set_init_cost(&bytecode, init_gas_cost); } // execution failed: reset context to snapshot and reimburse sender let err = ExecutionError::VMError { @@ -1408,11 +1409,11 @@ impl ExecutionState { self.config.gas_costs.clone(), ); match response { - Ok(Response { init_cost, .. }) - | Err(VMError::ExecutionError { init_cost, .. }) => { + Ok(Response { init_gas_cost, .. }) + | Err(VMError::ExecutionError { init_gas_cost, .. }) => { self.module_cache .write() - .set_init_cost(&bytecode, init_cost); + .set_init_cost(&bytecode, init_gas_cost); } _ => (), } diff --git a/massa-module-cache/Cargo.toml b/massa-module-cache/Cargo.toml index 1bb2084e96a..5a9fbdd5924 100644 --- a/massa-module-cache/Cargo.toml +++ b/massa-module-cache/Cargo.toml @@ -18,7 +18,7 @@ tracing = "0.1" massa_hash = { path = "../massa-hash" } massa_models = { path = "../massa-models" } massa_serialization = { path = "../massa-serialization" } -massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "testnet_22", features = [ +massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", branch = "bilboquet/issue235_language_agnostic_smartcontract", features = [ "testing", ] }