From 44fe589f51552d68b548bfa00562aa451aaf9050 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Fri, 9 Aug 2024 17:41:11 +0300 Subject: [PATCH 1/7] fix: add tx kernel library with stubs and link it on `-l miden` --- Cargo.lock | 9 ++++++ Cargo.toml | 2 ++ midenc-session/Cargo.toml | 1 + midenc-session/src/libs.rs | 1 + midenc-tx-kernel/Cargo.toml | 18 +++++++++++ midenc-tx-kernel/masm/account.masm | 11 +++++++ midenc-tx-kernel/masm/tx.masm | 6 ++++ midenc-tx-kernel/src/lib.rs | 49 ++++++++++++++++++++++++++++++ 8 files changed, 97 insertions(+) create mode 100644 midenc-tx-kernel/Cargo.toml create mode 100644 midenc-tx-kernel/masm/account.masm create mode 100644 midenc-tx-kernel/masm/tx.masm create mode 100644 midenc-tx-kernel/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 6c5b87e20..365b8b710 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3267,6 +3267,15 @@ dependencies = [ "miden-thiserror", "midenc-hir-macros", "midenc-hir-symbol", + "midenc-tx-kernel", +] + +[[package]] +name = "midenc-tx-kernel" +version = "0.0.0" +dependencies = [ + "miden-assembly", + "miden-core", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2b73c871d..48ffb5377 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ members = [ "midenc-driver", "midenc-session", "midenc-runner", + "midenc-tx-kernel", "tools/*", "frontend-wasm", "tests/integration", @@ -94,6 +95,7 @@ midenc-compile = { version = "0.0.1", path = "midenc-compile" } midenc-driver = { version = "0.0.1", path = "midenc-driver" } midenc-runner = { version = "0.0.1", path = "midenc-runner" } midenc-session = { version = "0.0.1", path = "midenc-session" } +midenc-tx-kernel = { version = "0.0.0", path = "midenc-tx-kernel" } miden-integration-tests = { version = "0.0.0", path = "tests/integration" } wat = "1.0.69" blake3 = "1.5" diff --git a/midenc-session/Cargo.toml b/midenc-session/Cargo.toml index 521cc851e..ac0293caf 100644 --- a/midenc-session/Cargo.toml +++ b/midenc-session/Cargo.toml @@ -23,4 +23,5 @@ miden-stdlib.workspace = true miden-diagnostics.workspace = true midenc-hir-symbol.workspace = true midenc-hir-macros.workspace = true +midenc-tx-kernel.workspace = true thiserror.workspace = true diff --git a/midenc-session/src/libs.rs b/midenc-session/src/libs.rs index 3b4e2a03b..6c58375cc 100644 --- a/midenc-session/src/libs.rs +++ b/midenc-session/src/libs.rs @@ -7,6 +7,7 @@ use std::{ use miden_assembly::{Library as CompiledLibrary, LibraryNamespace}; use miden_stdlib::StdLibrary; +use midenc_tx_kernel::MidenTxKernelLibrary; use crate::{ diagnostics::{IntoDiagnostic, Report, WrapErr}, diff --git a/midenc-tx-kernel/Cargo.toml b/midenc-tx-kernel/Cargo.toml new file mode 100644 index 000000000..fdc3c5d82 --- /dev/null +++ b/midenc-tx-kernel/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "midenc-tx-kernel" +description = "Miden Tx Kernel MASM library for the Midenc compiler" +version = "0.0.0" +rust-version.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +categories.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +edition.workspace = true + +[dependencies] +miden-assembly.workspace = true +miden-core.workspace = true diff --git a/midenc-tx-kernel/masm/account.masm b/midenc-tx-kernel/masm/account.masm new file mode 100644 index 000000000..47229ce03 --- /dev/null +++ b/midenc-tx-kernel/masm/account.masm @@ -0,0 +1,11 @@ +# Stubs for miden::account tx kernel module + +export.remove_asset + push.1 + assertz +end + +export.add_asset + push.1 + assertz +end \ No newline at end of file diff --git a/midenc-tx-kernel/masm/tx.masm b/midenc-tx-kernel/masm/tx.masm new file mode 100644 index 000000000..310d6912a --- /dev/null +++ b/midenc-tx-kernel/masm/tx.masm @@ -0,0 +1,6 @@ +# Stubs for miden::tx tx kernel module + +export.create_note + push.1 + assertz +end \ No newline at end of file diff --git a/midenc-tx-kernel/src/lib.rs b/midenc-tx-kernel/src/lib.rs new file mode 100644 index 000000000..8f6485d29 --- /dev/null +++ b/midenc-tx-kernel/src/lib.rs @@ -0,0 +1,49 @@ +use std::sync::Arc; + +use miden_assembly::{ + ast::ModuleKind, library::Library as CompiledLibrary, Assembler, Compile, CompileOptions, + DefaultSourceManager, +}; + +/// Stubs for the Miden rollup tx kernel +pub struct MidenTxKernelLibrary(CompiledLibrary); + +impl AsRef for MidenTxKernelLibrary { + fn as_ref(&self) -> &CompiledLibrary { + &self.0 + } +} + +impl From for CompiledLibrary { + fn from(lib: MidenTxKernelLibrary) -> Self { + lib.0 + } +} + +impl Default for MidenTxKernelLibrary { + fn default() -> Self { + // TODO: Load compiled MASL from file + let source_manager = Arc::new(DefaultSourceManager::default()); + let assembler = Assembler::new(source_manager.clone()); + let tx_module = (include_str!("../masm/tx.masm")) + .compile_with_options( + source_manager.as_ref(), + CompileOptions { + warnings_as_errors: assembler.warnings_as_errors(), + ..CompileOptions::new(ModuleKind::Library, "miden::tx").unwrap() + }, + ) + .unwrap(); + let account_module = (include_str!("../masm/account.masm")) + .compile_with_options( + source_manager.as_ref(), + CompileOptions { + warnings_as_errors: assembler.warnings_as_errors(), + ..CompileOptions::new(ModuleKind::Library, "miden::account").unwrap() + }, + ) + .unwrap(); + let lib = assembler.assemble_library([tx_module, account_module]).unwrap(); + Self(lib) + } +} From 7874a13ac0217e13efdfc2372f753d5bcb4c0d8f Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Sat, 10 Aug 2024 08:42:11 +0300 Subject: [PATCH 2/7] fix: load tx kernel library stubs via SourceManager Remove `miden-core` dependency from `midenc-tx-kernel` crate; --- Cargo.lock | 1 - midenc-tx-kernel/Cargo.toml | 1 - midenc-tx-kernel/src/lib.rs | 12 +++++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 365b8b710..b7258ba15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3275,7 +3275,6 @@ name = "midenc-tx-kernel" version = "0.0.0" dependencies = [ "miden-assembly", - "miden-core", ] [[package]] diff --git a/midenc-tx-kernel/Cargo.toml b/midenc-tx-kernel/Cargo.toml index fdc3c5d82..7d2337512 100644 --- a/midenc-tx-kernel/Cargo.toml +++ b/midenc-tx-kernel/Cargo.toml @@ -15,4 +15,3 @@ edition.workspace = true [dependencies] miden-assembly.workspace = true -miden-core.workspace = true diff --git a/midenc-tx-kernel/src/lib.rs b/midenc-tx-kernel/src/lib.rs index 8f6485d29..6520316de 100644 --- a/midenc-tx-kernel/src/lib.rs +++ b/midenc-tx-kernel/src/lib.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use miden_assembly::{ ast::ModuleKind, library::Library as CompiledLibrary, Assembler, Compile, CompileOptions, - DefaultSourceManager, + DefaultSourceManager, SourceManager, }; /// Stubs for the Miden rollup tx kernel @@ -25,7 +25,9 @@ impl Default for MidenTxKernelLibrary { // TODO: Load compiled MASL from file let source_manager = Arc::new(DefaultSourceManager::default()); let assembler = Assembler::new(source_manager.clone()); - let tx_module = (include_str!("../masm/tx.masm")) + let tx_source = source_manager + .load("midenc-tx-kernel/masm/tx.masm", include_str!("../masm/tx.masm").into()); + let tx_module = tx_source .compile_with_options( source_manager.as_ref(), CompileOptions { @@ -34,7 +36,11 @@ impl Default for MidenTxKernelLibrary { }, ) .unwrap(); - let account_module = (include_str!("../masm/account.masm")) + let account_source = source_manager.load( + "midenc-tx-kernel/masm/account.masm", + include_str!("../masm/account.masm").into(), + ); + let account_module = account_source .compile_with_options( source_manager.as_ref(), CompileOptions { From 3151fe217c9fbc30e030f5b3c3034af8185d9d7a Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Sat, 10 Aug 2024 11:53:55 +0300 Subject: [PATCH 3/7] refactor: rename `midenc-tx-kernel` to `miden-base-sys` and move it to the `sdk` folder --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 4 ++-- midenc-session/Cargo.toml | 2 +- midenc-session/src/libs.rs | 9 ++------- {midenc-tx-kernel => sdk/base-sys}/Cargo.toml | 4 ++-- .../base-sys}/masm/account.masm | 0 {midenc-tx-kernel => sdk/base-sys}/masm/tx.masm | 0 {midenc-tx-kernel => sdk/base-sys}/src/lib.rs | 0 8 files changed, 15 insertions(+), 20 deletions(-) rename {midenc-tx-kernel => sdk/base-sys}/Cargo.toml (78%) rename {midenc-tx-kernel => sdk/base-sys}/masm/account.masm (100%) rename {midenc-tx-kernel => sdk/base-sys}/masm/tx.masm (100%) rename {midenc-tx-kernel => sdk/base-sys}/src/lib.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index b7258ba15..10427500e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2839,6 +2839,13 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "miden-base-sys" +version = "0.0.0" +dependencies = [ + "miden-assembly", +] + [[package]] name = "miden-core" version = "0.10.3" @@ -3261,20 +3268,13 @@ dependencies = [ "clap", "inventory", "miden-assembly", + "miden-base-sys", "miden-core", "miden-diagnostics", "miden-stdlib", "miden-thiserror", "midenc-hir-macros", "midenc-hir-symbol", - "midenc-tx-kernel", -] - -[[package]] -name = "midenc-tx-kernel" -version = "0.0.0" -dependencies = [ - "miden-assembly", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 48ffb5377..ac06afb5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ members = [ "midenc-driver", "midenc-session", "midenc-runner", - "midenc-tx-kernel", + "sdk/base-sys", "tools/*", "frontend-wasm", "tests/integration", @@ -95,7 +95,7 @@ midenc-compile = { version = "0.0.1", path = "midenc-compile" } midenc-driver = { version = "0.0.1", path = "midenc-driver" } midenc-runner = { version = "0.0.1", path = "midenc-runner" } midenc-session = { version = "0.0.1", path = "midenc-session" } -midenc-tx-kernel = { version = "0.0.0", path = "midenc-tx-kernel" } +miden-base-sys = { version = "0.0.0", path = "sdk/base-sys" } miden-integration-tests = { version = "0.0.0", path = "tests/integration" } wat = "1.0.69" blake3 = "1.5" diff --git a/midenc-session/Cargo.toml b/midenc-session/Cargo.toml index ac0293caf..098a63033 100644 --- a/midenc-session/Cargo.toml +++ b/midenc-session/Cargo.toml @@ -23,5 +23,5 @@ miden-stdlib.workspace = true miden-diagnostics.workspace = true midenc-hir-symbol.workspace = true midenc-hir-macros.workspace = true -midenc-tx-kernel.workspace = true +miden-base-sys.workspace = true thiserror.workspace = true diff --git a/midenc-session/src/libs.rs b/midenc-session/src/libs.rs index 6c58375cc..30029d9ee 100644 --- a/midenc-session/src/libs.rs +++ b/midenc-session/src/libs.rs @@ -6,8 +6,8 @@ use std::{ }; use miden_assembly::{Library as CompiledLibrary, LibraryNamespace}; +use miden_base_sys::MidenTxKernelLibrary; use miden_stdlib::StdLibrary; -use midenc_tx_kernel::MidenTxKernelLibrary; use crate::{ diagnostics::{IntoDiagnostic, Report, WrapErr}, @@ -63,12 +63,7 @@ impl LinkLibrary { // Handle libraries shipped with the compiler, or via Miden crates match self.name.as_ref() { "std" => return Ok(StdLibrary::default().into()), - "base" => { - // TODO(pauls): Handle properly once we have miden-base-sys - return Err(Report::msg( - "invalid link library 'base': miden-base-sys is unimplemented", - )); - } + "base" => return Ok(MidenTxKernelLibrary::default().into()), _ => (), } diff --git a/midenc-tx-kernel/Cargo.toml b/sdk/base-sys/Cargo.toml similarity index 78% rename from midenc-tx-kernel/Cargo.toml rename to sdk/base-sys/Cargo.toml index 7d2337512..8261f75ee 100644 --- a/midenc-tx-kernel/Cargo.toml +++ b/sdk/base-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "midenc-tx-kernel" -description = "Miden Tx Kernel MASM library for the Midenc compiler" +name = "miden-base-sys" +description = "Miden rollup Rust bingings and MASM library" version = "0.0.0" rust-version.workspace = true authors.workspace = true diff --git a/midenc-tx-kernel/masm/account.masm b/sdk/base-sys/masm/account.masm similarity index 100% rename from midenc-tx-kernel/masm/account.masm rename to sdk/base-sys/masm/account.masm diff --git a/midenc-tx-kernel/masm/tx.masm b/sdk/base-sys/masm/tx.masm similarity index 100% rename from midenc-tx-kernel/masm/tx.masm rename to sdk/base-sys/masm/tx.masm diff --git a/midenc-tx-kernel/src/lib.rs b/sdk/base-sys/src/lib.rs similarity index 100% rename from midenc-tx-kernel/src/lib.rs rename to sdk/base-sys/src/lib.rs From 30b4e8b5acf494d31b079c2cb7a9c069fc840721 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Sat, 10 Aug 2024 12:39:27 +0300 Subject: [PATCH 4/7] refactor: build the MASL for the tx kernel stubs in `build.rs` and load the `CompiledLibrary` from the bytes. Move the tx kernel to `masm/tx`. --- sdk/base-sys/Cargo.toml | 3 ++ sdk/base-sys/build.rs | 32 ++++++++++++++++++++ sdk/base-sys/masm/{ => tx}/account.masm | 0 sdk/base-sys/masm/{ => tx}/tx.masm | 0 sdk/base-sys/src/lib.rs | 39 +++---------------------- 5 files changed, 39 insertions(+), 35 deletions(-) create mode 100644 sdk/base-sys/build.rs rename sdk/base-sys/masm/{ => tx}/account.masm (100%) rename sdk/base-sys/masm/{ => tx}/tx.masm (100%) diff --git a/sdk/base-sys/Cargo.toml b/sdk/base-sys/Cargo.toml index 8261f75ee..3cb3b5e7a 100644 --- a/sdk/base-sys/Cargo.toml +++ b/sdk/base-sys/Cargo.toml @@ -15,3 +15,6 @@ edition.workspace = true [dependencies] miden-assembly.workspace = true + +[build-dependencies] +miden-assembly.workspace = true diff --git a/sdk/base-sys/build.rs b/sdk/base-sys/build.rs new file mode 100644 index 000000000..abb91fa51 --- /dev/null +++ b/sdk/base-sys/build.rs @@ -0,0 +1,32 @@ +use std::{env, path::Path, sync::Arc}; + +use miden_assembly::{ + ast::AstSerdeOptions, + diagnostics::{IntoDiagnostic, Result}, + library::CompiledLibrary, + LibraryNamespace, +}; + +/// Read and parse the contents from `./masm/*` and compile it to MASL. +fn main() -> Result<()> { + // re-build the `[OUT_DIR]/assets/` file iff something in the `./masm` directory + // or its builder changed: + println!("cargo:rerun-if-changed=masm"); + + let build_dir = env::var("OUT_DIR").unwrap(); + let build_dir = Path::new(&build_dir); + let manifest_dir = env!("CARGO_MANIFEST_DIR"); + let source_manager = Arc::new(miden_assembly::DefaultSourceManager::default()); + let namespace = "miden".parse::().expect("invalid base namespace"); + let options = AstSerdeOptions::new(false, false); + + let tx_asm_dir = Path::new(manifest_dir).join("masm").join("tx"); + let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, source_manager)?; + let tx_masl_path = build_dir + .join("assets") + .join("tx") + .with_extension(CompiledLibrary::LIBRARY_EXTENSION); + txlib.write_to_file(tx_masl_path, options).into_diagnostic()?; + + Ok(()) +} diff --git a/sdk/base-sys/masm/account.masm b/sdk/base-sys/masm/tx/account.masm similarity index 100% rename from sdk/base-sys/masm/account.masm rename to sdk/base-sys/masm/tx/account.masm diff --git a/sdk/base-sys/masm/tx.masm b/sdk/base-sys/masm/tx/tx.masm similarity index 100% rename from sdk/base-sys/masm/tx.masm rename to sdk/base-sys/masm/tx/tx.masm diff --git a/sdk/base-sys/src/lib.rs b/sdk/base-sys/src/lib.rs index 6520316de..1a0d90395 100644 --- a/sdk/base-sys/src/lib.rs +++ b/sdk/base-sys/src/lib.rs @@ -1,9 +1,4 @@ -use std::sync::Arc; - -use miden_assembly::{ - ast::ModuleKind, library::Library as CompiledLibrary, Assembler, Compile, CompileOptions, - DefaultSourceManager, SourceManager, -}; +use miden_assembly::{library::Library as CompiledLibrary, utils::Deserializable}; /// Stubs for the Miden rollup tx kernel pub struct MidenTxKernelLibrary(CompiledLibrary); @@ -22,34 +17,8 @@ impl From for CompiledLibrary { impl Default for MidenTxKernelLibrary { fn default() -> Self { - // TODO: Load compiled MASL from file - let source_manager = Arc::new(DefaultSourceManager::default()); - let assembler = Assembler::new(source_manager.clone()); - let tx_source = source_manager - .load("midenc-tx-kernel/masm/tx.masm", include_str!("../masm/tx.masm").into()); - let tx_module = tx_source - .compile_with_options( - source_manager.as_ref(), - CompileOptions { - warnings_as_errors: assembler.warnings_as_errors(), - ..CompileOptions::new(ModuleKind::Library, "miden::tx").unwrap() - }, - ) - .unwrap(); - let account_source = source_manager.load( - "midenc-tx-kernel/masm/account.masm", - include_str!("../masm/account.masm").into(), - ); - let account_module = account_source - .compile_with_options( - source_manager.as_ref(), - CompileOptions { - warnings_as_errors: assembler.warnings_as_errors(), - ..CompileOptions::new(ModuleKind::Library, "miden::account").unwrap() - }, - ) - .unwrap(); - let lib = assembler.assemble_library([tx_module, account_module]).unwrap(); - Self(lib) + let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/tx.masl")); + let contents = CompiledLibrary::read_from_bytes(bytes).expect("failed to read std masl!"); + Self(contents) } } From 2b7fdc4dbdefff439b8ab60e69277639b4610e1d Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Sat, 10 Aug 2024 13:33:54 +0300 Subject: [PATCH 5/7] refactor: delete `miden-tx-kernel-sys` crate and move the code to `miden-base-sys` Add `bindings` and `masm-lib` features to the `miden-base-sys` crate to separate the the user facing Rust bindings from the MASM library needed only for the compiler. --- Cargo.lock | 5 + Cargo.toml | 1 - midenc-session/Cargo.toml | 2 +- midenc-session/src/libs.rs | 2 +- sdk/Cargo.lock | 22 - sdk/Cargo.toml | 27 - sdk/base-sys/Cargo.toml | 9 + sdk/base-sys/build.rs | 6 +- sdk/base-sys/src/bindings/mod.rs | 1 + .../src/bindings/tx}/externs.rs | 2 +- .../src/bindings/tx/mod.rs} | 2 - .../src => base-sys/src/bindings/tx}/types.rs | 0 sdk/base-sys/src/lib.rs | 29 +- sdk/base-sys/src/masl/mod.rs | 1 + sdk/base-sys/src/masl/tx.rs | 24 + sdk/sdk/Cargo.toml | 2 +- sdk/sdk/src/lib.rs | 2 +- sdk/stdlib-sys/src/intrinsics/felt.rs | 18 +- sdk/tx-kernel-sys/CHANGELOG.md | 15 - sdk/tx-kernel-sys/Cargo.toml | 18 - .../miden_sdk_account_test.hir | 20 +- .../miden_sdk_account_test.wat | 40 +- .../rust_sdk_basic_wallet.hir | 12 +- .../rust_sdk_basic_wallet.wat | 24 +- .../rust-sdk/account-test/Cargo.lock | 1782 ++++++++++++++++- tools/cargo-miden/src/build.rs | 2 + 26 files changed, 1873 insertions(+), 195 deletions(-) delete mode 100644 sdk/Cargo.lock delete mode 100644 sdk/Cargo.toml create mode 100644 sdk/base-sys/src/bindings/mod.rs rename sdk/{tx-kernel-sys/src => base-sys/src/bindings/tx}/externs.rs (94%) rename sdk/{tx-kernel-sys/src/lib.rs => base-sys/src/bindings/tx/mod.rs} (99%) rename sdk/{tx-kernel-sys/src => base-sys/src/bindings/tx}/types.rs (100%) create mode 100644 sdk/base-sys/src/masl/mod.rs create mode 100644 sdk/base-sys/src/masl/tx.rs delete mode 100644 sdk/tx-kernel-sys/CHANGELOG.md delete mode 100644 sdk/tx-kernel-sys/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 10427500e..61cb19821 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2844,6 +2844,7 @@ name = "miden-base-sys" version = "0.0.0" dependencies = [ "miden-assembly", + "miden-stdlib-sys", ] [[package]] @@ -3032,6 +3033,10 @@ dependencies = [ "miden-assembly", ] +[[package]] +name = "miden-stdlib-sys" +version = "0.0.1" + [[package]] name = "miden-thiserror" version = "1.0.59" diff --git a/Cargo.toml b/Cargo.toml index ac06afb5d..310d875ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,6 @@ midenc-compile = { version = "0.0.1", path = "midenc-compile" } midenc-driver = { version = "0.0.1", path = "midenc-driver" } midenc-runner = { version = "0.0.1", path = "midenc-runner" } midenc-session = { version = "0.0.1", path = "midenc-session" } -miden-base-sys = { version = "0.0.0", path = "sdk/base-sys" } miden-integration-tests = { version = "0.0.0", path = "tests/integration" } wat = "1.0.69" blake3 = "1.5" diff --git a/midenc-session/Cargo.toml b/midenc-session/Cargo.toml index 098a63033..03eb744f9 100644 --- a/midenc-session/Cargo.toml +++ b/midenc-session/Cargo.toml @@ -23,5 +23,5 @@ miden-stdlib.workspace = true miden-diagnostics.workspace = true midenc-hir-symbol.workspace = true midenc-hir-macros.workspace = true -miden-base-sys.workspace = true +miden-base-sys = { version = "0.0.0", path = "../sdk/base-sys", features = ["masl-lib"] } thiserror.workspace = true diff --git a/midenc-session/src/libs.rs b/midenc-session/src/libs.rs index 30029d9ee..4cc590921 100644 --- a/midenc-session/src/libs.rs +++ b/midenc-session/src/libs.rs @@ -6,7 +6,7 @@ use std::{ }; use miden_assembly::{Library as CompiledLibrary, LibraryNamespace}; -use miden_base_sys::MidenTxKernelLibrary; +use miden_base_sys::masl::tx::MidenTxKernelLibrary; use miden_stdlib::StdLibrary; use crate::{ diff --git a/sdk/Cargo.lock b/sdk/Cargo.lock deleted file mode 100644 index bc8d3b5cc..000000000 --- a/sdk/Cargo.lock +++ /dev/null @@ -1,22 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "miden-sdk" -version = "0.0.1" -dependencies = [ - "miden-stdlib-sys", - "miden-tx-kernel-sys", -] - -[[package]] -name = "miden-stdlib-sys" -version = "0.0.1" - -[[package]] -name = "miden-tx-kernel-sys" -version = "0.0.1" -dependencies = [ - "miden-stdlib-sys", -] diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml deleted file mode 100644 index 1eaee8a4e..000000000 --- a/sdk/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[workspace] -resolver = "2" -members = [ - "stdlib-sys", - "tx-kernel-sys", - "sdk", -] - -[workspace.package] - -version = "0.0.0" -rust-version = "1.71" -authors = ["Miden contributors"] -repository = "https://github.com/0xPolygonMiden/compiler" -homepage = "https://github.com/0xPolygonMiden/compiler" -documentation = "https://github.com/0xPolygonMiden/compiler" -categories = ["Compilers"] -keywords = ["compiler", "miden"] -license = "MIT" -readme = "README.md" -edition = "2021" - - -[profile.release] -panic = "abort" -# optimize for size -opt-level = "z" diff --git a/sdk/base-sys/Cargo.toml b/sdk/base-sys/Cargo.toml index 3cb3b5e7a..51594b446 100644 --- a/sdk/base-sys/Cargo.toml +++ b/sdk/base-sys/Cargo.toml @@ -15,6 +15,15 @@ edition.workspace = true [dependencies] miden-assembly.workspace = true +miden-stdlib-sys = { version = "0.0.1", path = "../stdlib-sys", optional = true } [build-dependencies] miden-assembly.workspace = true + +[features] +default = [] + +# User facing Rust bindings +"bindings" = ["miden-stdlib-sys"] +# MASL library for Miden rollup (tx kernel, etc.) used by the compiler in the link phase +"masl-lib" = [] \ No newline at end of file diff --git a/sdk/base-sys/build.rs b/sdk/base-sys/build.rs index abb91fa51..477ff26e1 100644 --- a/sdk/base-sys/build.rs +++ b/sdk/base-sys/build.rs @@ -1,9 +1,8 @@ use std::{env, path::Path, sync::Arc}; use miden_assembly::{ - ast::AstSerdeOptions, diagnostics::{IntoDiagnostic, Result}, - library::CompiledLibrary, + library::Library as CompiledLibrary, LibraryNamespace, }; @@ -18,7 +17,6 @@ fn main() -> Result<()> { let manifest_dir = env!("CARGO_MANIFEST_DIR"); let source_manager = Arc::new(miden_assembly::DefaultSourceManager::default()); let namespace = "miden".parse::().expect("invalid base namespace"); - let options = AstSerdeOptions::new(false, false); let tx_asm_dir = Path::new(manifest_dir).join("masm").join("tx"); let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, source_manager)?; @@ -26,7 +24,7 @@ fn main() -> Result<()> { .join("assets") .join("tx") .with_extension(CompiledLibrary::LIBRARY_EXTENSION); - txlib.write_to_file(tx_masl_path, options).into_diagnostic()?; + txlib.write_to_file(tx_masl_path).into_diagnostic()?; Ok(()) } diff --git a/sdk/base-sys/src/bindings/mod.rs b/sdk/base-sys/src/bindings/mod.rs new file mode 100644 index 000000000..d7c32947c --- /dev/null +++ b/sdk/base-sys/src/bindings/mod.rs @@ -0,0 +1 @@ +pub mod tx; diff --git a/sdk/tx-kernel-sys/src/externs.rs b/sdk/base-sys/src/bindings/tx/externs.rs similarity index 94% rename from sdk/tx-kernel-sys/src/externs.rs rename to sdk/base-sys/src/bindings/tx/externs.rs index 412e6d7fc..85ee9c9ce 100644 --- a/sdk/tx-kernel-sys/src/externs.rs +++ b/sdk/base-sys/src/bindings/tx/externs.rs @@ -1,6 +1,6 @@ use miden_stdlib_sys::Felt; -use crate::{AccountId, CoreAsset, NoteId, NoteType, Tag}; +use crate::bindings::tx::{AccountId, CoreAsset, NoteId, NoteType, Tag}; #[link(wasm_import_module = "miden::account")] extern "C" { diff --git a/sdk/tx-kernel-sys/src/lib.rs b/sdk/base-sys/src/bindings/tx/mod.rs similarity index 99% rename from sdk/tx-kernel-sys/src/lib.rs rename to sdk/base-sys/src/bindings/tx/mod.rs index b4134653b..f70691ef8 100644 --- a/sdk/tx-kernel-sys/src/lib.rs +++ b/sdk/base-sys/src/bindings/tx/mod.rs @@ -1,5 +1,3 @@ -#![no_std] - mod externs; use externs::*; diff --git a/sdk/tx-kernel-sys/src/types.rs b/sdk/base-sys/src/bindings/tx/types.rs similarity index 100% rename from sdk/tx-kernel-sys/src/types.rs rename to sdk/base-sys/src/bindings/tx/types.rs diff --git a/sdk/base-sys/src/lib.rs b/sdk/base-sys/src/lib.rs index 1a0d90395..f088d34de 100644 --- a/sdk/base-sys/src/lib.rs +++ b/sdk/base-sys/src/lib.rs @@ -1,24 +1,7 @@ -use miden_assembly::{library::Library as CompiledLibrary, utils::Deserializable}; +// Enable no_std for the bindings module +#![cfg_attr(feature = "bindings", no_std)] -/// Stubs for the Miden rollup tx kernel -pub struct MidenTxKernelLibrary(CompiledLibrary); - -impl AsRef for MidenTxKernelLibrary { - fn as_ref(&self) -> &CompiledLibrary { - &self.0 - } -} - -impl From for CompiledLibrary { - fn from(lib: MidenTxKernelLibrary) -> Self { - lib.0 - } -} - -impl Default for MidenTxKernelLibrary { - fn default() -> Self { - let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/tx.masl")); - let contents = CompiledLibrary::read_from_bytes(bytes).expect("failed to read std masl!"); - Self(contents) - } -} +#[cfg(feature = "bindings")] +pub mod bindings; +#[cfg(feature = "masl-lib")] +pub mod masl; diff --git a/sdk/base-sys/src/masl/mod.rs b/sdk/base-sys/src/masl/mod.rs new file mode 100644 index 000000000..d7c32947c --- /dev/null +++ b/sdk/base-sys/src/masl/mod.rs @@ -0,0 +1 @@ +pub mod tx; diff --git a/sdk/base-sys/src/masl/tx.rs b/sdk/base-sys/src/masl/tx.rs new file mode 100644 index 000000000..1a0d90395 --- /dev/null +++ b/sdk/base-sys/src/masl/tx.rs @@ -0,0 +1,24 @@ +use miden_assembly::{library::Library as CompiledLibrary, utils::Deserializable}; + +/// Stubs for the Miden rollup tx kernel +pub struct MidenTxKernelLibrary(CompiledLibrary); + +impl AsRef for MidenTxKernelLibrary { + fn as_ref(&self) -> &CompiledLibrary { + &self.0 + } +} + +impl From for CompiledLibrary { + fn from(lib: MidenTxKernelLibrary) -> Self { + lib.0 + } +} + +impl Default for MidenTxKernelLibrary { + fn default() -> Self { + let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/tx.masl")); + let contents = CompiledLibrary::read_from_bytes(bytes).expect("failed to read std masl!"); + Self(contents) + } +} diff --git a/sdk/sdk/Cargo.toml b/sdk/sdk/Cargo.toml index 69f0564c2..5e17e29a1 100644 --- a/sdk/sdk/Cargo.toml +++ b/sdk/sdk/Cargo.toml @@ -16,4 +16,4 @@ crate-type = ["rlib"] [dependencies] miden-stdlib-sys = { path = "../stdlib-sys" } -miden-tx-kernel-sys = { path = "../tx-kernel-sys" } +miden-base-sys = { path = "../base-sys", features = ["bindings"] } diff --git a/sdk/sdk/src/lib.rs b/sdk/sdk/src/lib.rs index aa1d0dbf3..5905591fc 100644 --- a/sdk/sdk/src/lib.rs +++ b/sdk/sdk/src/lib.rs @@ -1,4 +1,4 @@ #![no_std] +pub use miden_base_sys::bindings::tx::*; pub use miden_stdlib_sys::*; -pub use miden_tx_kernel_sys::*; diff --git a/sdk/stdlib-sys/src/intrinsics/felt.rs b/sdk/stdlib-sys/src/intrinsics/felt.rs index ebad89b76..51fa936d0 100644 --- a/sdk/stdlib-sys/src/intrinsics/felt.rs +++ b/sdk/stdlib-sys/src/intrinsics/felt.rs @@ -308,12 +308,12 @@ pub fn assert_eq(a: Felt, b: Felt) { } } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn felt_macro_smoke_test() { - let _ = felt!(1); - } -} +// #[cfg(test)] +// mod tests { +// use super::*; + +// #[test] +// fn felt_macro_smoke_test() { +// let _ = felt!(1); +// } +// } diff --git a/sdk/tx-kernel-sys/CHANGELOG.md b/sdk/tx-kernel-sys/CHANGELOG.md deleted file mode 100644 index de21c861b..000000000 --- a/sdk/tx-kernel-sys/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [0.0.1](https://github.com/0xPolygonMiden/compiler/compare/miden-tx-kernel-sys-v0.0.0...miden-tx-kernel-sys-v0.0.1) - 2024-07-18 - -### Other -- set crates versions to 0.0.0, and `publish = false` for tests -- rename `miden-sdk-tx-kernel` to `miden-tx-kernel-sys` -- rename `miden-prelude` to `miden-stdlib-sys` in SDK -- start guides for developing in rust in the book, diff --git a/sdk/tx-kernel-sys/Cargo.toml b/sdk/tx-kernel-sys/Cargo.toml deleted file mode 100644 index 3792587dc..000000000 --- a/sdk/tx-kernel-sys/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "miden-tx-kernel-sys" -description = "Miden SDK transaction kernel" -version = "0.0.1" -rust-version.workspace = true -authors.workspace = true -repository.workspace = true -categories.workspace = true -keywords.workspace = true -license.workspace = true -readme.workspace = true -edition.workspace = true - -[lib] -crate-type = ["rlib"] - -[dependencies] -miden-stdlib-sys = { path = "../stdlib-sys" } diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir index 9af21ad44..b457b359b 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir @@ -165,7 +165,7 @@ (func (export #get_wallet_magic_number) (result felt) (block 0 (let (v1 felt) (const.felt 0)) - (let (v2 felt) (call #miden_tx_kernel_sys::get_id)) + (let (v2 felt) (call #miden_base_sys::bindings::tx::get_id)) (let (v3 i64) (const.i64 42)) (let (v4 felt) (cast v3)) (let (v5 felt) (add.unchecked v4 v2)) @@ -217,7 +217,7 @@ (store v29 v8) (let (v30 i32) (const.i32 16)) (let (v31 i32) (add.wrapping v5 v30)) - (call #miden_tx_kernel_sys::add_asset v31 v5) + (call #miden_base_sys::bindings::tx::add_asset v31 v5) (let (v32 u32) (bitcast v5)) (let (v33 u32) (add.checked v32 16)) (let (v34 u32) (mod.unchecked v33 4)) @@ -339,7 +339,7 @@ (store v7 v6) (let (v8 i64) (const.i64 0)) (let (v9 felt) (cast v8)) - (call #miden_tx_kernel_sys::get_inputs v6) + (call #miden_base_sys::bindings::tx::get_inputs v6) (let (v10 u32) (bitcast v6)) (let (v11 u32) (mod.unchecked v10 4)) (assertz 250 v11) @@ -664,7 +664,7 @@ (let (v6 i32) (sub.wrapping v4 v5)) (let (v7 (ptr i32)) (global.symbol #__stack_pointer)) (store v7 v6) - (call #miden_tx_kernel_sys::remove_asset v6 v0) + (call #miden_base_sys::bindings::tx::remove_asset v6 v0) (let (v8 u32) (bitcast v6)) (let (v9 u32) (mod.unchecked v8 4)) (assertz 250 v9) @@ -687,7 +687,7 @@ (param v1 felt) (param v2 felt) (param v3 i32) - (let (v5 felt) (call #miden_tx_kernel_sys::create_note v0 v1 v2 v3)) + (let (v5 felt) (call #miden_base_sys::bindings::tx::create_note v0 v1 v2 v3)) (br (block 1 v5))) (block 1 (param v4 felt) @@ -1601,7 +1601,7 @@ (br (block 12 v85 v87 v111 v101))) ) - (func (export #miden_tx_kernel_sys::get_id) + (func (export #miden_base_sys::bindings::tx::get_id) (result felt) (block 0 (let (v1 felt) (call (#miden::account #get_id))) @@ -1611,7 +1611,7 @@ (ret v0)) ) - (func (export #miden_tx_kernel_sys::get_inputs) + (func (export #miden_base_sys::bindings::tx::get_inputs) (param i32) (block 0 (param v0 i32) (let (v1 i32) (const.i32 0)) @@ -1688,7 +1688,7 @@ (unreachable)) ) - (func (export #miden_tx_kernel_sys::add_asset) + (func (export #miden_base_sys::bindings::tx::add_asset) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (let (v2 u32) (bitcast v1)) @@ -1733,7 +1733,7 @@ (ret)) ) - (func (export #miden_tx_kernel_sys::remove_asset) + (func (export #miden_base_sys::bindings::tx::remove_asset) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (let (v2 u32) (bitcast v1)) @@ -1778,7 +1778,7 @@ (ret)) ) - (func (export #miden_tx_kernel_sys::create_note) + (func (export #miden_base_sys::bindings::tx::create_note) (param i32) (param felt) (param felt) (param i32) (result felt) (block 0 (param v0 i32) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat index 54ef3fd07..05b2ea368 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat @@ -48,11 +48,11 @@ (import "std::crypto::hashes::blake3" "hash_1to1<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_stdlib_sys::stdlib::crypto::hashes::extern_blake3_hash_1to1 (;19;) (type 8))) (import "std::crypto::hashes::blake3" "hash_2to1<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_stdlib_sys::stdlib::crypto::hashes::extern_blake3_hash_2to1 (;20;) (type 9))) (import "std::crypto::dsa::rpo_falcon512" "rpo_falcon512_verify<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_stdlib_sys::stdlib::crypto::dsa::extern_rpo_falcon512_verify (;21;) (type 10))) - (import "miden::account" "get_id<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_account_get_id (;22;) (type 11))) - (import "miden::note" "get_inputs<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_note_get_inputs (;23;) (type 12))) - (import "miden::account" "add_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_account_add_asset (;24;) (type 13))) - (import "miden::account" "remove_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_account_remove_asset (;25;) (type 13))) - (import "miden::tx" "create_note<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_tx_create_note (;26;) (type 14))) + (import "miden::account" "get_id<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_account_get_id (;22;) (type 11))) + (import "miden::note" "get_inputs<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_note_get_inputs (;23;) (type 12))) + (import "miden::account" "add_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_account_add_asset (;24;) (type 13))) + (import "miden::account" "remove_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_account_remove_asset (;25;) (type 13))) + (import "miden::tx" "create_note<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_tx_create_note (;26;) (type 14))) (import "std::mem" "pipe_words_to_memory<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_stdlib_sys::stdlib::mem::extern_pipe_words_to_memory (;27;) (type 15))) (import "std::mem" "pipe_double_words_to_memory<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_stdlib_sys::stdlib::mem::extern_pipe_double_words_to_memory (;28;) (type 16))) (func $< as core::ops::drop::Drop>::drop::DropGuard as core::ops::drop::Drop>::drop (;29;) (type 17) (param i32) @@ -142,7 +142,7 @@ ) (func $get_wallet_magic_number (;34;) (type 11) (result f32) (local f32) - call $miden_tx_kernel_sys::get_id + call $miden_base_sys::bindings::tx::get_id local.set 0 i64.const 42 call $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked @@ -182,7 +182,7 @@ i32.const 16 i32.add local.get 0 - call $miden_tx_kernel_sys::add_asset + call $miden_base_sys::bindings::tx::add_asset local.get 0 f32.load offset=16 local.set 1 @@ -292,7 +292,7 @@ call $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked local.set 1 local.get 0 - call $miden_tx_kernel_sys::get_inputs + call $miden_base_sys::bindings::tx::get_inputs local.get 0 i32.load local.set 2 @@ -440,7 +440,7 @@ global.set $__stack_pointer local.get 1 local.get 0 - call $miden_tx_kernel_sys::remove_asset + call $miden_base_sys::bindings::tx::remove_asset local.get 1 f32.load local.set 2 @@ -455,7 +455,7 @@ local.get 1 local.get 2 local.get 3 - call $miden_tx_kernel_sys::create_note + call $miden_base_sys::bindings::tx::create_note ) (func $__rust_alloc (;45;) (type 24) (param i32 i32) (result i32) i32.const 1048576 @@ -1022,10 +1022,10 @@ i32.store end ) - (func $miden_tx_kernel_sys::get_id (;52;) (type 11) (result f32) - call $miden_tx_kernel_sys::externs::extern_account_get_id + (func $miden_base_sys::bindings::tx::get_id (;52;) (type 11) (result f32) + call $miden_base_sys::bindings::tx::externs::extern_account_get_id ) - (func $miden_tx_kernel_sys::get_inputs (;53;) (type 17) (param i32) + (func $miden_base_sys::bindings::tx::get_inputs (;53;) (type 17) (param i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -1055,7 +1055,7 @@ local.get 1 i32.load offset=12 local.tee 3 - call $miden_tx_kernel_sys::externs::extern_note_get_inputs + call $miden_base_sys::bindings::tx::externs::extern_note_get_inputs drop local.get 0 i32.const 0 @@ -1071,7 +1071,7 @@ i32.add global.set $__stack_pointer ) - (func $miden_tx_kernel_sys::add_asset (;54;) (type 20) (param i32 i32) + (func $miden_base_sys::bindings::tx::add_asset (;54;) (type 20) (param i32 i32) local.get 1 f32.load local.get 1 @@ -1081,9 +1081,9 @@ local.get 1 f32.load offset=12 local.get 0 - call $miden_tx_kernel_sys::externs::extern_account_add_asset + call $miden_base_sys::bindings::tx::externs::extern_account_add_asset ) - (func $miden_tx_kernel_sys::remove_asset (;55;) (type 20) (param i32 i32) + (func $miden_base_sys::bindings::tx::remove_asset (;55;) (type 20) (param i32 i32) local.get 1 f32.load local.get 1 @@ -1093,9 +1093,9 @@ local.get 1 f32.load offset=12 local.get 0 - call $miden_tx_kernel_sys::externs::extern_account_remove_asset + call $miden_base_sys::bindings::tx::externs::extern_account_remove_asset ) - (func $miden_tx_kernel_sys::create_note (;56;) (type 23) (param i32 f32 f32 i32) (result f32) + (func $miden_base_sys::bindings::tx::create_note (;56;) (type 23) (param i32 f32 f32 i32) (result f32) local.get 0 f32.load local.get 0 @@ -1114,7 +1114,7 @@ f32.load offset=8 local.get 3 f32.load offset=12 - call $miden_tx_kernel_sys::externs::extern_tx_create_note + call $miden_base_sys::bindings::tx::externs::extern_tx_create_note ) (func $alloc::vec::Vec::with_capacity (;57;) (type 20) (param i32 i32) (local i32 i32) diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir index 6b29b1c35..dd994dc28 100644 --- a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir @@ -19,7 +19,7 @@ (let (v4 i32) (sub.wrapping v2 v3)) (let (v5 (ptr i32)) (global.symbol #__stack_pointer)) (store v5 v4) - (call #miden_tx_kernel_sys::add_asset v4 v0) + (call #miden_base_sys::bindings::tx::add_asset v4 v0) (let (v6 i32) (const.i32 16)) (let (v7 i32) (add.wrapping v4 v6)) (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) @@ -43,8 +43,8 @@ (let (v7 i32) (sub.wrapping v5 v6)) (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) (store v8 v7) - (call #miden_tx_kernel_sys::remove_asset v7 v0) - (let (v9 felt) (call #miden_tx_kernel_sys::create_note v7 v1 v2 v3)) + (call #miden_base_sys::bindings::tx::remove_asset v7 v0) + (let (v9 felt) (call #miden_base_sys::bindings::tx::create_note v7 v1 v2 v3)) (let (v10 i32) (const.i32 16)) (let (v11 i32) (add.wrapping v7 v10)) (let (v12 (ptr i32)) (global.symbol #__stack_pointer)) @@ -55,7 +55,7 @@ (ret)) ) - (func (export #miden_tx_kernel_sys::add_asset) + (func (export #miden_base_sys::bindings::tx::add_asset) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (let (v2 u32) (bitcast v1)) @@ -100,7 +100,7 @@ (ret)) ) - (func (export #miden_tx_kernel_sys::remove_asset) + (func (export #miden_base_sys::bindings::tx::remove_asset) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (let (v2 u32) (bitcast v1)) @@ -145,7 +145,7 @@ (ret)) ) - (func (export #miden_tx_kernel_sys::create_note) + (func (export #miden_base_sys::bindings::tx::create_note) (param i32) (param felt) (param felt) (param i32) (result felt) (block 0 (param v0 i32) diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat index 46061ef14..2fa63c391 100644 --- a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat @@ -5,9 +5,9 @@ (type (;3;) (func (param i32 f32 f32 i32))) (type (;4;) (func (param i32 i32))) (type (;5;) (func (param i32 f32 f32 i32) (result f32))) - (import "miden::account" "add_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_account_add_asset (;0;) (type 0))) - (import "miden::account" "remove_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_account_remove_asset (;1;) (type 0))) - (import "miden::tx" "create_note<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_tx_create_note (;2;) (type 1))) + (import "miden::account" "add_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_account_add_asset (;0;) (type 0))) + (import "miden::account" "remove_asset<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_account_remove_asset (;1;) (type 0))) + (import "miden::tx" "create_note<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_base_sys::bindings::tx::externs::extern_tx_create_note (;2;) (type 1))) (func $receive_asset (;3;) (type 2) (param i32) (local i32) global.get $__stack_pointer @@ -17,7 +17,7 @@ global.set $__stack_pointer local.get 1 local.get 0 - call $miden_tx_kernel_sys::add_asset + call $miden_base_sys::bindings::tx::add_asset local.get 1 i32.const 16 i32.add @@ -32,19 +32,19 @@ global.set $__stack_pointer local.get 4 local.get 0 - call $miden_tx_kernel_sys::remove_asset + call $miden_base_sys::bindings::tx::remove_asset local.get 4 local.get 1 local.get 2 local.get 3 - call $miden_tx_kernel_sys::create_note + call $miden_base_sys::bindings::tx::create_note drop local.get 4 i32.const 16 i32.add global.set $__stack_pointer ) - (func $miden_tx_kernel_sys::add_asset (;5;) (type 4) (param i32 i32) + (func $miden_base_sys::bindings::tx::add_asset (;5;) (type 4) (param i32 i32) local.get 1 f32.load local.get 1 @@ -54,9 +54,9 @@ local.get 1 f32.load offset=12 local.get 0 - call $miden_tx_kernel_sys::externs::extern_account_add_asset + call $miden_base_sys::bindings::tx::externs::extern_account_add_asset ) - (func $miden_tx_kernel_sys::remove_asset (;6;) (type 4) (param i32 i32) + (func $miden_base_sys::bindings::tx::remove_asset (;6;) (type 4) (param i32 i32) local.get 1 f32.load local.get 1 @@ -66,9 +66,9 @@ local.get 1 f32.load offset=12 local.get 0 - call $miden_tx_kernel_sys::externs::extern_account_remove_asset + call $miden_base_sys::bindings::tx::externs::extern_account_remove_asset ) - (func $miden_tx_kernel_sys::create_note (;7;) (type 5) (param i32 f32 f32 i32) (result f32) + (func $miden_base_sys::bindings::tx::create_note (;7;) (type 5) (param i32 f32 f32 i32) (result f32) local.get 0 f32.load local.get 0 @@ -87,7 +87,7 @@ f32.load offset=8 local.get 3 f32.load offset=12 - call $miden_tx_kernel_sys::externs::extern_tx_create_note + call $miden_base_sys::bindings::tx::externs::extern_tx_create_note ) (table (;0;) 1 1 funcref) (memory (;0;) 16) diff --git a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock index 076215714..25d763638 100644 --- a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock +++ b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock @@ -2,58 +2,1520 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "arrayref" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "blake3" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" +dependencies = [ + "jobserver", + "libc", +] + [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dissimilar" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generator" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "979f00864edc7516466d6b3157706e06c032f22715700ddd878228a91d02bc56" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "rustversion", + "windows", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lalrpop" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +dependencies = [ + "ascii-canvas", + "bit-set", + "ena", + "itertools", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.8.4", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", + "walkdir", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if 1.0.0", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "miden-assembly" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013ba230b6ed8a20126e48553e25418bcc3cf8b3960fa5c4df371e2efb381a7" +dependencies = [ + "aho-corasick", + "lalrpop", + "lalrpop-util", + "miden-core", + "miden-miette", + "miden-thiserror", + "rustc_version 0.4.0", + "smallvec", + "tracing", + "unicode-width", +] + +[[package]] +name = "miden-base-sys" +version = "0.0.0" +dependencies = [ + "miden-assembly", + "miden-stdlib-sys", +] + +[[package]] +name = "miden-core" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e46df4105dc2ec15aa14182ce6de299720991bfb83a9b6aa9293c6ee2b12b18" +dependencies = [ + "lock_api", + "loom", + "memchr", + "miden-crypto", + "miden-formatting", + "miden-miette", + "miden-thiserror", + "num-derive", + "num-traits", + "parking_lot", + "winter-math", + "winter-utils", +] + +[[package]] +name = "miden-crypto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6fad06fc3af260ed3c4235821daa2132813d993f96d446856036ae97e9606dd" +dependencies = [ + "blake3", + "cc", + "glob", + "num", + "num-complex", + "rand", + "rand_core", + "sha3", + "winter-crypto", + "winter-math", + "winter-utils", +] + +[[package]] +name = "miden-formatting" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e392e0a8c34b32671012b439de35fa8987bf14f0f8aac279b97f8b8cc6e263b" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "miden-miette" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c532250422d933f15b148fb81e4522a5d649c178ab420d0d596c86228da35570" +dependencies = [ + "backtrace", + "backtrace-ext", + "cfg-if 1.0.0", + "futures", + "indenter", + "lazy_static", + "miden-miette-derive", + "miden-thiserror", + "owo-colors", + "regex", + "rustc_version 0.2.3", + "rustversion", + "serde_json", + "spin", + "strip-ansi-escapes", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "syn", + "terminal_size", + "textwrap", + "trybuild", + "unicode-width", +] + +[[package]] +name = "miden-miette-derive" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc759f0a2947acae217a2f32f722105cacc57d17d5f93bc16362142943a4edd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "miden-sdk" +version = "0.0.1" +dependencies = [ + "miden-base-sys", + "miden-stdlib-sys", +] + +[[package]] +name = "miden-sdk-account-test" +version = "0.0.0" +dependencies = [ + "miden-sdk", + "wee_alloc", +] + +[[package]] +name = "miden-stdlib-sys" +version = "0.0.1" + +[[package]] +name = "miden-thiserror" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183ff8de338956ecfde3a38573241eb7a6f3d44d73866c210e5629c07fa00253" +dependencies = [ + "miden-thiserror-impl", +] + +[[package]] +name = "miden-thiserror-impl" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee4176a0f2e7d29d2a8ee7e60b6deb14ce67a20e94c3e2c7275cdb8804e1862" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "object" +version = "0.36.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.23", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.205" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.205" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" +dependencies = [ + "vte", +] + +[[package]] +name = "supports-color" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] [[package]] -name = "libc" -version = "0.2.153" +name = "termcolor" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] [[package]] -name = "memory_units" -version = "0.4.0" +name = "terminal_size" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] [[package]] -name = "miden-sdk" -version = "0.0.1" +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ - "miden-stdlib-sys", - "miden-tx-kernel-sys", + "smawk", + "unicode-linebreak", + "unicode-width", ] [[package]] -name = "miden-sdk-account-test" -version = "0.0.0" +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "miden-sdk", - "wee_alloc", + "thiserror-impl", ] [[package]] -name = "miden-stdlib-sys" -version = "0.0.1" +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "miden-tx-kernel-sys" -version = "0.0.1" +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "miden-stdlib-sys", + "cfg-if 1.0.0", + "once_cell", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "trybuild" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" +dependencies = [ + "dissimilar", + "glob", + "serde", + "serde_derive", + "serde_json", + "termcolor", + "toml", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vte" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" +dependencies = [ + "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", ] +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wee_alloc" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "memory_units", "winapi", @@ -75,8 +1537,286 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "winter-crypto" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00fbb724d2d9fbfd3aa16ea27f5e461d4fe1d74b0c9e0ed1bf79e9e2a955f4d5" +dependencies = [ + "blake3", + "sha3", + "winter-math", + "winter-utils", +] + +[[package]] +name = "winter-math" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "004f85bb051ce986ec0b9a2bd90aaf81b83e3c67464becfdf7db31f14c1019ba" +dependencies = [ + "winter-utils", +] + +[[package]] +name = "winter-utils" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0568612a95bcae3c94fb14da2686f8279ca77723dbdf1e97cf3673798faf6485" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/tools/cargo-miden/src/build.rs b/tools/cargo-miden/src/build.rs index 0d4047652..2af2a737c 100644 --- a/tools/cargo-miden/src/build.rs +++ b/tools/cargo-miden/src/build.rs @@ -39,6 +39,8 @@ pub fn build_masm( output_file.as_os_str(), project_type.as_ref(), "--verbose".as_ref(), + "--target".as_ref(), + "rollup".as_ref(), ]; let session = Rc::new(Compiler::new_session([input], None, args)); midenc_compile::compile(session.clone())?; From fb80d834e4d13f2b2f61ee5b5833091387865577 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Tue, 13 Aug 2024 12:47:04 +0300 Subject: [PATCH 6/7] fix clippy warnings --- sdk/stdlib-sys/src/intrinsics/felt.rs | 8 +++++--- sdk/stdlib-sys/src/stdlib/crypto/hashes.rs | 4 ++-- sdk/stdlib-sys/src/stdlib/mem.rs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sdk/stdlib-sys/src/intrinsics/felt.rs b/sdk/stdlib-sys/src/intrinsics/felt.rs index 51fa936d0..632eec144 100644 --- a/sdk/stdlib-sys/src/intrinsics/felt.rs +++ b/sdk/stdlib-sys/src/intrinsics/felt.rs @@ -1,3 +1,5 @@ +#![allow(clippy::transmute_int_to_float)] + use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; #[link(wasm_import_module = "miden:stdlib/intrinsics_felt")] @@ -139,19 +141,19 @@ impl From for u64 { impl From for Felt { fn from(value: u32) -> Self { - Self(unsafe { core::mem::transmute(value) }) + Self(unsafe { core::mem::transmute::(value) }) } } impl From for Felt { fn from(value: u16) -> Self { - Self(unsafe { core::mem::transmute(value as u32) }) + Self(unsafe { core::mem::transmute::(value as u32) }) } } impl From for Felt { fn from(value: u8) -> Self { - Self(unsafe { core::mem::transmute(value as u32) }) + Self(unsafe { core::mem::transmute::(value as u32) }) } } diff --git a/sdk/stdlib-sys/src/stdlib/crypto/hashes.rs b/sdk/stdlib-sys/src/stdlib/crypto/hashes.rs index 3f257335e..e223a62c5 100644 --- a/sdk/stdlib-sys/src/stdlib/crypto/hashes.rs +++ b/sdk/stdlib-sys/src/stdlib/crypto/hashes.rs @@ -102,7 +102,7 @@ fn hash_1to1( input: [u8; 32], extern_hash_1to1: unsafe extern "C" fn(u32, u32, u32, u32, u32, u32, u32, u32, *mut u8), ) -> [u8; 32] { - let input = unsafe { core::mem::transmute::<_, [u32; 8]>(input) }; + let input = unsafe { core::mem::transmute::<[u8; 32], [u32; 8]>(input) }; unsafe { let mut ret_area = ::core::mem::MaybeUninit::<[u8; 32]>::uninit(); let ptr = ret_area.as_mut_ptr() as *mut u8; @@ -137,7 +137,7 @@ fn hash_2to1( *mut u8, ), ) -> [u8; 32] { - let input = unsafe { core::mem::transmute::<_, [u32; 16]>(input) }; + let input = unsafe { core::mem::transmute::<[u8; 64], [u32; 16]>(input) }; unsafe { let mut ret_area = ::core::mem::MaybeUninit::<[u8; 32]>::uninit(); let ptr = ret_area.as_mut_ptr() as *mut u8; diff --git a/sdk/stdlib-sys/src/stdlib/mem.rs b/sdk/stdlib-sys/src/stdlib/mem.rs index b4fd44cdc..aedb437b7 100644 --- a/sdk/stdlib-sys/src/stdlib/mem.rs +++ b/sdk/stdlib-sys/src/stdlib/mem.rs @@ -91,7 +91,7 @@ pub fn pipe_double_words_to_memory(num_words: Felt) -> (Word, Vec) { } let num_words_in_felts = num_words.as_u64() as usize * 4; - let mut buf: Vec = Vec::with_capacity(num_words_in_felts as usize); + let mut buf: Vec = Vec::with_capacity(num_words_in_felts); let write_ptr = buf.as_mut_ptr(); let end_ptr = unsafe { write_ptr.add(num_words_in_felts) }; // Place for returned C, B, A, write_ptr From b9de0b508f4c6601c1a534abd716c431eb08ad59 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Wed, 14 Aug 2024 13:37:54 +0300 Subject: [PATCH 7/7] fix the build after VM v0.10.3 update --- sdk/base-sys/build.rs | 6 +++--- sdk/base-sys/src/masl/tx.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/base-sys/build.rs b/sdk/base-sys/build.rs index 477ff26e1..8f9dcaad8 100644 --- a/sdk/base-sys/build.rs +++ b/sdk/base-sys/build.rs @@ -2,8 +2,7 @@ use std::{env, path::Path, sync::Arc}; use miden_assembly::{ diagnostics::{IntoDiagnostic, Result}, - library::Library as CompiledLibrary, - LibraryNamespace, + Assembler, Library as CompiledLibrary, LibraryNamespace, }; /// Read and parse the contents from `./masm/*` and compile it to MASL. @@ -19,7 +18,8 @@ fn main() -> Result<()> { let namespace = "miden".parse::().expect("invalid base namespace"); let tx_asm_dir = Path::new(manifest_dir).join("masm").join("tx"); - let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, source_manager)?; + let asm = Assembler::new(source_manager); + let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, asm)?; let tx_masl_path = build_dir .join("assets") .join("tx") diff --git a/sdk/base-sys/src/masl/tx.rs b/sdk/base-sys/src/masl/tx.rs index 1a0d90395..080087da7 100644 --- a/sdk/base-sys/src/masl/tx.rs +++ b/sdk/base-sys/src/masl/tx.rs @@ -1,4 +1,4 @@ -use miden_assembly::{library::Library as CompiledLibrary, utils::Deserializable}; +use miden_assembly::{utils::Deserializable, Library as CompiledLibrary}; /// Stubs for the Miden rollup tx kernel pub struct MidenTxKernelLibrary(CompiledLibrary);