diff --git a/codegen/masm/src/artifact.rs b/codegen/masm/src/artifact.rs index df59b9ef3..9ce7dfa7b 100644 --- a/codegen/masm/src/artifact.rs +++ b/codegen/masm/src/artifact.rs @@ -128,15 +128,6 @@ impl fmt::Display for MasmComponent { use crate::intrinsics::INTRINSICS_MODULE_NAMES; for module in self.modules.iter() { - // Don't print empty modules - // - // NOTE(pauls): This is a temporary workaround for the fact that component init - // functions require a module, and we are not yet emitting component init functions, - // so the generated module is empty. - if module.exported_procedures().next().is_none() { - continue; - } - // Skip printing the standard library modules and intrinsics // modules to focus on the user-defined modules and avoid the // stack overflow error when printing large programs diff --git a/codegen/masm/src/lower/component.rs b/codegen/masm/src/lower/component.rs index 597219571..7d87e693f 100644 --- a/codegen/masm/src/lower/component.rs +++ b/codegen/masm/src/lower/component.rs @@ -217,7 +217,7 @@ impl MasmComponentBuilder<'_> { let init_body = core::mem::take(&mut self.init_body); let init = masm::Procedure::new( Default::default(), - masm::Visibility::Public, + masm::Visibility::Private, init_name, 0, masm::Block::new(component.span(), init_body), diff --git a/examples/auth-component-no-auth/.gitignore b/examples/auth-component-no-auth/.gitignore new file mode 100644 index 000000000..c41cc9e35 --- /dev/null +++ b/examples/auth-component-no-auth/.gitignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/examples/auth-component-no-auth/Cargo.lock b/examples/auth-component-no-auth/Cargo.lock new file mode 100644 index 000000000..625bfbdd8 --- /dev/null +++ b/examples/auth-component-no-auth/Cargo.lock @@ -0,0 +1,1892 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "auth-component-no-auth" +version = "0.1.0" +dependencies = [ + "miden", + "wit-bindgen-rt", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[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.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "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 = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "cc" +version = "1.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5252b3d2648e5eedbc1a6f501e3c795e07025c1e93bbf8bbdd6eef7f447a6d54" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[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", + "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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "find-msvc-tools" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" + +[[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.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generator" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2" +dependencies = [ + "cc", + "cfg-if", + "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.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasi 0.14.4+wasi-0.2.4", + "wasm-bindgen", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" + +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + +[[package]] +name = "indexmap" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[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", + "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.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miden" +version = "0.5.0" +dependencies = [ + "miden-base", + "miden-base-sys", + "miden-sdk-alloc", + "miden-stdlib-sys", +] + +[[package]] +name = "miden-air" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af5e74b13a68f17c5a52d10adbce489faba95d2bd43d4d48014e4af818f109f8" +dependencies = [ + "miden-core", + "thiserror 2.0.16", + "winter-air", + "winter-prover", +] + +[[package]] +name = "miden-assembly" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c69a8a783df2730abfc3ae93df4b0232a93e409388d1fd6778768b1567417ac" +dependencies = [ + "aho-corasick", + "lalrpop", + "lalrpop-util", + "miden-core", + "miden-miette", + "rustc_version 0.4.1", + "smallvec", + "thiserror 2.0.16", + "tracing", + "unicode-width 0.2.1", +] + +[[package]] +name = "miden-base" +version = "0.5.0" +dependencies = [ + "miden-base-macros", + "miden-base-sys", + "miden-stdlib-sys", +] + +[[package]] +name = "miden-base-macros" +version = "0.5.0" +dependencies = [ + "miden-objects", + "proc-macro2", + "quote", + "semver 1.0.26", + "syn", + "toml 0.8.23", +] + +[[package]] +name = "miden-base-sys" +version = "0.5.0" +dependencies = [ + "miden-stdlib-sys", +] + +[[package]] +name = "miden-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520ff9eb4a4d0c7ade20a8a381136f4183857e8539d640277a539d59672a3c95" +dependencies = [ + "lock_api", + "loom", + "memchr", + "miden-crypto", + "miden-formatting", + "miden-miette", + "num-derive", + "num-traits", + "thiserror 2.0.16", + "winter-math", + "winter-utils", +] + +[[package]] +name = "miden-crypto" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd5fee625e5024c1e47c2914ae2f9bcf36055afe47a680314b4613709bdbdf4" +dependencies = [ + "blake3", + "glob", + "num", + "num-complex", + "rand", + "rand_core", + "sha3", + "thiserror 2.0.16", + "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 0.1.14", +] + +[[package]] +name = "miden-miette" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef536978f24a179d94fa2a41e4f92b28e7d8aab14b8d23df28ad2a3d7098b20" +dependencies = [ + "cfg-if", + "futures", + "indenter", + "lazy_static", + "miden-miette-derive", + "owo-colors", + "regex", + "rustc_version 0.2.3", + "rustversion", + "serde_json", + "spin", + "strip-ansi-escapes", + "syn", + "textwrap", + "thiserror 2.0.16", + "trybuild", + "unicode-width 0.1.14", +] + +[[package]] +name = "miden-miette-derive" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86a905f3ea65634dd4d1041a4f0fd0a3e77aa4118341d265af1a94339182222f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "miden-objects" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06388ea1e20ffdfc36773e5ed1dfae53ef4dffd713a426b0caf975b3b9ddd848" +dependencies = [ + "bech32", + "getrandom 0.3.3", + "miden-assembly", + "miden-core", + "miden-crypto", + "miden-processor", + "miden-verifier", + "semver 1.0.26", + "thiserror 2.0.16", +] + +[[package]] +name = "miden-processor" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "024c8118fbbd61dd58d764e9a714cad6c89d8b9b58bfaecfa0a30657f92b0fc9" +dependencies = [ + "miden-air", + "miden-core", + "miden-miette", + "thiserror 2.0.16", + "tracing", + "winter-prover", +] + +[[package]] +name = "miden-sdk-alloc" +version = "0.5.0" + +[[package]] +name = "miden-stdlib-sys" +version = "0.5.0" + +[[package]] +name = "miden-verifier" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0043e6fe42c3f349d333e85793d07e3984a05d28a73620b3ff76940cfa74f8" +dependencies = [ + "miden-air", + "miden-core", + "thiserror 2.0.16", + "tracing", + "winter-verifier", +] + +[[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.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[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 = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[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.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[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.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + +[[package]] +name = "redox_syscall" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[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.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] + +[[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.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.143" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +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 = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-triple" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac9aa371f599d22256307c24a9d748c041e548cbf599f35d890f9d365361790" + +[[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 = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +dependencies = [ + "thiserror-impl 2.0.16", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[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.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "indexmap", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_edit", +] + +[[package]] +name = "toml" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" +dependencies = [ + "indexmap", + "serde", + "serde_spanned 1.0.0", + "toml_datetime 0.7.0", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "toml_writer" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +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.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "trybuild" +version = "1.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e257d7246e7a9fd015fb0b28b330a8d4142151a33f03e6a497754f4b1f6a8e" +dependencies = [ + "dissimilar", + "glob", + "serde", + "serde_derive", + "serde_json", + "target-triple", + "termcolor", + "toml 0.9.5", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[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.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[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.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[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.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.4+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a5f4a424faf49c3c2c344f166f0662341d470ea185e939657aaff130f0ec4a" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.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.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +dependencies = [ + "windows-link 0.2.0", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[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.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "winter-air" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48a9ee4b14f192be4b0f253d6cc6241844664d6d6684819b6d9b074f4b85af14" +dependencies = [ + "libm", + "winter-crypto", + "winter-fri", + "winter-math", + "winter-utils", +] + +[[package]] +name = "winter-crypto" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32247cde9f43e5bbd05362caa7274608790ea69b14f7c81cd509aae7127c5ff2" +dependencies = [ + "blake3", + "sha3", + "winter-math", + "winter-utils", +] + +[[package]] +name = "winter-fri" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b346b0eea2292986a1193bfc70dd2dbcdbb6adb3e5110b71d18c6f1077df10" +dependencies = [ + "winter-crypto", + "winter-math", + "winter-utils", +] + +[[package]] +name = "winter-math" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "326dfe4bfa4072b7c909133a88f8807820d3e49e5dfd246f67981771f74a0ed3" +dependencies = [ + "winter-utils", +] + +[[package]] +name = "winter-maybe-async" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaa132be74e602b707f1dab5a69c38496445e54ee940e7c281c02b15007241bd" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "winter-prover" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e1ad2747c0f67f3aab25c2753cb7ee321e06722dd1f011344faeee7e2828a4" +dependencies = [ + "tracing", + "winter-air", + "winter-crypto", + "winter-fri", + "winter-math", + "winter-maybe-async", + "winter-utils", +] + +[[package]] +name = "winter-utils" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d47518e6931955dcac73a584cacb04550b82ab2f45c72880cbbbdbe13adb63c" + +[[package]] +name = "winter-verifier" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a980cd314dddc2f4c9cdbc77127e6390238bb8b7541b6f627541ca35223f8ff" +dependencies = [ + "winter-air", + "winter-crypto", + "winter-fri", + "winter-math", + "winter-utils", +] + +[[package]] +name = "wit-bindgen" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36" + +[[package]] +name = "wit-bindgen-rt" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a37bd9274cb2d4754b915d624447ec0dce9105d174361841c0826efc79ceb9" diff --git a/examples/auth-component-no-auth/Cargo.toml b/examples/auth-component-no-auth/Cargo.toml new file mode 100644 index 000000000..e1a99e988 --- /dev/null +++ b/examples/auth-component-no-auth/Cargo.toml @@ -0,0 +1,32 @@ +cargo-features = ["trim-paths"] + +[package] +name = "auth-component-no-auth" +version = "0.1.0" +edition = "2021" + +[lib] +# Build this crate as a self-contained, C-style dynamic library +# This is required to emit the proper Wasm module type +crate-type = ["cdylib"] + +[dependencies] +# Miden SDK consists of a stdlib (intrinsic functions for VM ops, stdlib functions and types) +# and transaction kernel API for the Miden rollup +miden = { path = "../../sdk/sdk" } +wit-bindgen-rt = "0.28" + +[package.metadata.component] +package = "miden:auth-component-no-auth" + +[package.metadata.miden] +project-kind = "authentication-component" + +[package.metadata.component.target.dependencies] +"miden:base" = { path = "../../sdk/base/wit/miden.wit" } + +[profile.release] +trim-paths = ["diagnostics", "object"] + +[profile.dev] +trim-paths = ["diagnostics", "object"] diff --git a/examples/auth-component-no-auth/rust-toolchain.toml b/examples/auth-component-no-auth/rust-toolchain.toml new file mode 100644 index 000000000..dd49b3008 --- /dev/null +++ b/examples/auth-component-no-auth/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "nightly-2025-07-20" +components = ["rustfmt", "rust-src", "clippy"] +targets = ["wasm32-wasip2"] +profile = "minimal" diff --git a/examples/auth-component-no-auth/src/lib.rs b/examples/auth-component-no-auth/src/lib.rs new file mode 100644 index 000000000..3b5af095d --- /dev/null +++ b/examples/auth-component-no-auth/src/lib.rs @@ -0,0 +1,43 @@ +// Do not link against libstd (i.e. anything defined in `std::`) +#![no_std] + +// However, we could still use some standard library types while +// remaining no-std compatible, if we uncommented the following lines: +// +// +// extern crate alloc; +// use alloc::vec::Vec; + +// Global allocator to use heap memory in no-std environment +#[global_allocator] +static ALLOC: miden::BumpAlloc = miden::BumpAlloc::new(); + +// Required for no-std crates +#[cfg(not(test))] +#[panic_handler] +fn my_panic(_info: &core::panic::PanicInfo) -> ! { + loop {} +} + +bindings::export!(AuthComponent with_types_in bindings); + +mod bindings; + +use bindings::exports::miden::base::authentication_component::Guest; +use miden::{account, *}; + +struct AuthComponent; + +impl Guest for AuthComponent { + fn auth_procedure(_arg: Word) { + // translated from MASM at + // https://github.com/0xMiden/miden-base/blob/e4912663276ab8eebb24b84d318417cb4ea0bba3/crates/miden-lib/asm/account_components/no_auth.masm?plain=1 + let init_comm = account::get_initial_commitment(); + let curr_comm = account::compute_current_commitment(); + // check if the account state has changed by comparing initial and final commitments + if curr_comm != init_comm { + // if the account has been updated, increment the nonce + account::incr_nonce(); + } + } +} diff --git a/examples/auth-component-no-auth/wit/interface.wit b/examples/auth-component-no-auth/wit/interface.wit new file mode 100644 index 000000000..6022bbc99 --- /dev/null +++ b/examples/auth-component-no-auth/wit/interface.wit @@ -0,0 +1,5 @@ +package miden:auth-component-no-auth@1.0.0; + +world auth-component-no-auth-world { + export miden:base/authentication-component@1.0.0; +} diff --git a/frontend/wasm/src/component/lift_exports.rs b/frontend/wasm/src/component/lift_exports.rs index 7c096eaf2..fdfe20c70 100644 --- a/frontend/wasm/src/component/lift_exports.rs +++ b/frontend/wasm/src/component/lift_exports.rs @@ -5,9 +5,8 @@ use midenc_dialect_cf::ControlFlowOpBuilder; use midenc_dialect_hir::HirOpBuilder; use midenc_hir::{ dialects::builtin::{BuiltinOpBuilder, ComponentBuilder, ModuleBuilder}, - interner::Symbol, CallConv, FunctionType, Ident, Op, Signature, SmallVec, SourceSpan, SymbolPath, ValueRange, - ValueRef, + ValueRef, Visibility, }; use midenc_session::{diagnostics::Severity, DiagnosticsHandler}; @@ -38,18 +37,38 @@ pub fn generate_export_lifting_function( diagnostics.diagnostic(Severity::Error).with_message(message).into_report() })?; - let export_func_ident = - Ident::new(Symbol::intern(export_func_name.to_string()), SourceSpan::default()); + // Miden Base expects the authentication component to export a single + // procedure whose name matches `auth_*` (underscore). The base WIT + // defines this function as `auth-procedure` (kebab-case). Until + // https://github.com/0xMiden/miden-base/issues/1861 lands, we map the + // authentication procedure name from `auth-procedure` to + // `auth__procedure` (double underscore) to match the current miden-base + // expectation. + // + // IMPORTANT: Restrict this rename to the authentication interface only. + // We do this by matching the exact WIT name `auth-procedure` instead of + // rewriting arbitrary names that merely start with `auth-`. + let export_func_ident = if export_func_name == "auth-procedure" { + Ident::new("auth__procedure".into(), SourceSpan::default()) + } else { + Ident::new(export_func_name.to_string().into(), SourceSpan::default()) + }; let core_export_module_path = core_export_func_path.without_leaf(); let core_module_ref = component_builder .resolve_module(&core_export_module_path) .expect("failed to find the core module"); - let core_module_builder = ModuleBuilder::new(core_module_ref); + let mut core_module_builder = ModuleBuilder::new(core_module_ref); let core_export_func_ref = core_module_builder .get_function(core_export_func_path.name().as_str()) - .expect("failed to find the core module function"); + .expect("failed to find the core module export function"); + // Make the lowered core WASM export private so only the lifted wrapper is + // publicly exported from the component. This prevents double-exports and + // ensures all external callers go through the Canonical ABI–correct + // wrapper generated here. + core_module_builder + .set_function_visibility(core_export_func_path.name().as_str(), Visibility::Private); let core_export_func_sig = core_export_func_ref.borrow().signature().clone(); if needs_transformation(&cross_ctx_export_sig_flat) { diff --git a/frontend/wasm/src/miden_abi/transform.rs b/frontend/wasm/src/miden_abi/transform.rs index 0d19df126..1370865b1 100644 --- a/frontend/wasm/src/miden_abi/transform.rs +++ b/frontend/wasm/src/miden_abi/transform.rs @@ -76,6 +76,8 @@ fn get_transform_strategy(path: &SymbolPath) -> Option { tx_kernel::account::ADD_ASSET | tx_kernel::account::GET_ID | tx_kernel::account::REMOVE_ASSET + | tx_kernel::account::GET_INITIAL_COMMITMENT + | tx_kernel::account::COMPUTE_CURRENT_COMMITMENT | tx_kernel::account::GET_STORAGE_ITEM | tx_kernel::account::SET_STORAGE_ITEM | tx_kernel::account::GET_STORAGE_MAP_ITEM diff --git a/frontend/wasm/src/miden_abi/tx_kernel/account.rs b/frontend/wasm/src/miden_abi/tx_kernel/account.rs index cbd84b9dc..1df546720 100644 --- a/frontend/wasm/src/miden_abi/tx_kernel/account.rs +++ b/frontend/wasm/src/miden_abi/tx_kernel/account.rs @@ -16,6 +16,8 @@ pub(crate) const MODULE_PREFIX: &[SymbolNameComponent] = &[ pub const ADD_ASSET: &str = "add_asset"; pub const REMOVE_ASSET: &str = "remove_asset"; pub const GET_ID: &str = "get_id"; +pub const GET_INITIAL_COMMITMENT: &str = "get_initial_commitment"; +pub const COMPUTE_CURRENT_COMMITMENT: &str = "compute_current_commitment"; pub const GET_STORAGE_ITEM: &str = "get_item"; pub const SET_STORAGE_ITEM: &str = "set_item"; pub const GET_STORAGE_MAP_ITEM: &str = "get_map_item"; @@ -34,6 +36,14 @@ pub(crate) fn signatures() -> ModuleFunctionTypeMap { FunctionType::new(CallConv::Wasm, [Felt, Felt, Felt, Felt], [Felt, Felt, Felt, Felt]), ); account.insert(Symbol::from(GET_ID), FunctionType::new(CallConv::Wasm, [], [Felt, Felt])); + account.insert( + Symbol::from(GET_INITIAL_COMMITMENT), + FunctionType::new(CallConv::Wasm, [], [Felt, Felt, Felt, Felt]), + ); + account.insert( + Symbol::from(COMPUTE_CURRENT_COMMITMENT), + FunctionType::new(CallConv::Wasm, [], [Felt, Felt, Felt, Felt]), + ); account.insert( Symbol::from(GET_STORAGE_ITEM), FunctionType::new(CallConv::Wasm, [Felt], [Felt, Felt, Felt, Felt]), @@ -58,7 +68,7 @@ pub(crate) fn signatures() -> ModuleFunctionTypeMap { [Felt, Felt, Felt, Felt, Felt, Felt, Felt, Felt], ), ); - account.insert(Symbol::from(INCR_NONCE), FunctionType::new(CallConv::Wasm, [I32], [])); + account.insert(Symbol::from(INCR_NONCE), FunctionType::new(CallConv::Wasm, [], [Felt])); m.insert(SymbolPath::from_iter(MODULE_PREFIX.iter().copied()), account); m } diff --git a/hir/src/dialects/builtin/builders/module.rs b/hir/src/dialects/builtin/builders/module.rs index 7612fde94..f6de35541 100644 --- a/hir/src/dialects/builtin/builders/module.rs +++ b/hir/src/dialects/builtin/builders/module.rs @@ -93,6 +93,24 @@ impl ModuleBuilder { } } + pub fn set_function_visibility(&mut self, name: &str, visibility: Visibility) { + let symbol = SymbolName::intern(name); + match self.module.borrow_mut().get(symbol) { + Some(mut symbol_ref) => { + let mut op = symbol_ref.borrow_mut(); + match op.as_symbol_operation_mut().downcast_mut::() { + Some(function) => { + function.signature_mut().visibility = visibility; + } + None => panic!("expected {name} to be a function"), + } + } + None => { + panic!("failed to find function {name} in module {}", self.module.borrow().name()) + } + } + } + pub fn get_global_var(&self, name: SymbolName) -> Option { self.module.borrow().get(name).and_then(|gv_symbol| { let op_ref = gv_symbol.borrow().as_operation_ref(); diff --git a/midenc-session/src/lib.rs b/midenc-session/src/lib.rs index 01f558307..1fb1742cc 100644 --- a/midenc-session/src/lib.rs +++ b/midenc-session/src/lib.rs @@ -469,6 +469,9 @@ impl FromStr for TargetEnv { "rollup:transaction-script" => Ok(Self::Rollup { target: RollupTarget::TransactionScript, }), + "rollup:authentication-component" => Ok(Self::Rollup { + target: RollupTarget::AuthComponent, + }), _ => Err(anyhow::anyhow!("invalid target environment: {}", s)), } } @@ -481,6 +484,10 @@ pub enum RollupTarget { Account, NoteScript, TransactionScript, + /// Authentication `AccountComponent` that has exactly one procedure named `auth__*` that + /// accepts a `Word` (authentication arguments) and throws an error in case of a failed + /// authentication + AuthComponent, } impl fmt::Display for RollupTarget { @@ -489,6 +496,7 @@ impl fmt::Display for RollupTarget { Self::Account => f.write_str("account"), Self::NoteScript => f.write_str("note-script"), Self::TransactionScript => f.write_str("transaction-script"), + Self::AuthComponent => f.write_str("authentication-component"), } } } diff --git a/sdk/base-sys/src/bindings/account.rs b/sdk/base-sys/src/bindings/account.rs index a31dd37c0..2bac93e9a 100644 --- a/sdk/base-sys/src/bindings/account.rs +++ b/sdk/base-sys/src/bindings/account.rs @@ -1,4 +1,4 @@ -use miden_stdlib_sys::Felt; +use miden_stdlib_sys::{Felt, Word}; use super::types::{AccountId, Asset}; @@ -9,7 +9,11 @@ extern "C" { #[link_name = "miden::account::remove_asset"] pub fn extern_account_remove_asset(_: Felt, _: Felt, _: Felt, _: Felt, ptr: *mut Asset); #[link_name = "miden::account::incr_nonce"] - pub fn extern_account_incr_nonce(value: i32); + pub fn extern_account_incr_nonce() -> Felt; + #[link_name = "miden::account::get_initial_commitment"] + pub fn extern_account_get_initial_commitment(ptr: *mut Word); + #[link_name = "miden::account::compute_current_commitment"] + pub fn extern_account_compute_current_commitment(ptr: *mut Word); // Resolved via stub rlib at core Wasm link time #[link_name = "miden::account::add_asset"] pub fn extern_account_add_asset(_: Felt, _: Felt, _: Felt, _: Felt, ptr: *mut Asset); @@ -72,12 +76,27 @@ pub fn remove_asset(asset: Asset) -> Asset { } } -/// Increments the account nonce by the provided value. -/// -/// Panics: -/// - If the underlying kernel procedure panics. -pub fn incr_nonce(value: u32) { +/// Increments the account nonce by one and returns the new nonce. +pub fn incr_nonce() -> Felt { + unsafe { extern_account_incr_nonce() } +} + +/// Returns the native account commitment at the beginning of the transaction. +#[inline] +pub fn get_initial_commitment() -> Word { + unsafe { + let mut ret_area = ::core::mem::MaybeUninit::::uninit(); + extern_account_get_initial_commitment(ret_area.as_mut_ptr()); + ret_area.assume_init().reverse() + } +} + +/// Computes and returns the commitment of the current account data. +#[inline] +pub fn compute_current_commitment() -> Word { unsafe { - extern_account_incr_nonce(value as i32); + let mut ret_area = ::core::mem::MaybeUninit::::uninit(); + extern_account_compute_current_commitment(ret_area.as_mut_ptr()); + ret_area.assume_init().reverse() } } diff --git a/sdk/base-sys/stubs/account.rs b/sdk/base-sys/stubs/account.rs index 30f42ec5d..76b061cfb 100644 --- a/sdk/base-sys/stubs/account.rs +++ b/sdk/base-sys/stubs/account.rs @@ -10,13 +10,7 @@ pub extern "C" fn add_asset_plain(_a0: f32, _a1: f32, _a2: f32, _a3: f32, _out: } #[export_name = "miden::account::remove_asset"] -pub extern "C" fn remove_asset_plain( - _a0: f32, - _a1: f32, - _a2: f32, - _a3: f32, - _out: *mut c_void, -) { +pub extern "C" fn remove_asset_plain(_a0: f32, _a1: f32, _a2: f32, _a3: f32, _out: *mut c_void) { unsafe { core::hint::unreachable_unchecked() } } @@ -25,6 +19,16 @@ pub extern "C" fn account_get_id_plain(_out: *mut c_void) { unsafe { core::hint::unreachable_unchecked() } } +#[export_name = "miden::account::get_initial_commitment"] +pub extern "C" fn account_get_initial_commitment_plain(_out: *mut c_void) { + unsafe { core::hint::unreachable_unchecked() } +} + +#[export_name = "miden::account::compute_current_commitment"] +pub extern "C" fn account_compute_current_commitment_plain(_out: *mut c_void) { + unsafe { core::hint::unreachable_unchecked() } +} + #[export_name = "miden::account::get_item"] pub extern "C" fn account_get_item_plain(_index: f32, _out: *mut c_void) { unsafe { core::hint::unreachable_unchecked() } @@ -71,7 +75,6 @@ pub extern "C" fn account_set_map_item_plain( } #[export_name = "miden::account::incr_nonce"] -pub extern "C" fn account_incr_nonce_plain(_value: i32) { +pub extern "C" fn account_incr_nonce_plain() -> f32 { unsafe { core::hint::unreachable_unchecked() } } - diff --git a/sdk/base/wit/miden.wit b/sdk/base/wit/miden.wit index bd00c2c49..11786d5e5 100644 --- a/sdk/base/wit/miden.wit +++ b/sdk/base/wit/miden.wit @@ -160,6 +160,14 @@ interface transaction-script { run: func(arg: word); } +/// The authentication component interface that is expected to export exactly one `auth__*` +/// function +interface authentication-component { + use core-types.{word}; + + auth-procedure: func(arg: word); +} + world base-world { export core-types; export note-script; diff --git a/tests/integration-node/src/node_tests/counter_contract_no_auth.rs b/tests/integration-node/src/node_tests/counter_contract_no_auth.rs new file mode 100644 index 000000000..4ae699951 --- /dev/null +++ b/tests/integration-node/src/node_tests/counter_contract_no_auth.rs @@ -0,0 +1,171 @@ +//! Counter contract test with no-auth authentication component + +use miden_client::{ + account::StorageMap, + transaction::{OutputNote, TransactionRequestBuilder}, + Word, +}; +use miden_core::{Felt, FieldElement}; + +use super::helpers::*; +use crate::local_node::ensure_shared_node; + +fn assert_counter_storage( + counter_account_storage: &miden_client::account::AccountStorage, + expected: u64, +) { + // according to `examples/counter-contract` for inner (slot, key) values + let counter_contract_storage_key = Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::ONE]); + + // With no-auth auth component (no storage), the counter component occupies slot 0 + let word = counter_account_storage + .get_map_item(0, counter_contract_storage_key) + .expect("Failed to get counter value from storage slot 1"); + + let val = word.last().unwrap(); + assert_eq!( + val.as_int(), + expected, + "Counter value mismatch. Expected: {}, Got: {}", + expected, + val.as_int() + ); +} + +/// Tests the counter contract with a "no-auth" authentication component. +/// +/// Flow: +/// - Build counter account using `examples/auth-component-no-auth` as the auth component +/// - Build a separate sender account (basic wallet) +/// - Sender issues a counter note to the network +/// - Counter account consumes the note without requiring authentication/signature +#[test] +pub fn test_counter_contract_no_auth_local() { + // Compile the contracts first (before creating any runtime) + let contract_package = compile_rust_package("../../examples/counter-contract", true); + let note_package = compile_rust_package("../../examples/counter-note", true); + let no_auth_auth_component = + compile_rust_package("../../examples/auth-component-no-auth", true); + + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let temp_dir = temp_dir::TempDir::with_prefix("test_counter_contract_no_auth_") + .expect("Failed to create temp directory"); + let node_handle = ensure_shared_node().await.expect("Failed to get shared node"); + + let TestSetup { + mut client, + keystore, + } = setup_test_infrastructure(&temp_dir, &node_handle) + .await + .expect("Failed to setup test infrastructure"); + + let sync_summary = client.sync_state().await.unwrap(); + eprintln!("Latest block: {}", sync_summary.block_num); + + // Create the counter account with initial storage and no-auth auth component + let key = Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::ONE]); + let value = Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::ONE]); + let counter_cfg = AccountCreationConfig { + storage_slots: vec![miden_client::account::StorageSlot::Map( + StorageMap::with_entries([(key.into(), value)]).unwrap(), + )], + ..Default::default() + }; + + let counter_account = create_account_with_component_and_auth_package( + &mut client, + contract_package.clone(), + no_auth_auth_component.clone(), + counter_cfg, + ) + .await + .unwrap(); + eprintln!("Counter account (no-auth) ID: {:?}", counter_account.id().to_hex()); + + assert_counter_storage( + client + .get_account(counter_account.id()) + .await + .unwrap() + .unwrap() + .account() + .storage(), + 1, + ); + + // Create a separate sender account using only the BasicWallet component + let sender_cfg = AccountCreationConfig::default(); + let sender_account = create_basic_wallet_account(&mut client, keystore.clone(), sender_cfg) + .await + .unwrap(); + eprintln!("Sender account ID: {:?}", sender_account.id().to_hex()); + + // Sender creates the counter note (note script increments counter's storage on consumption) + let counter_note = create_note_from_package( + &mut client, + note_package.clone(), + sender_account.id(), + NoteCreationConfig::default(), + ); + eprintln!("Counter note hash: {:?}", counter_note.id().to_hex()); + + // Submit transaction to create the note from the sender account + let note_request = TransactionRequestBuilder::new() + .own_output_notes(vec![OutputNote::Full(counter_note.clone())]) + .build() + .unwrap(); + + let tx_result = client + .new_transaction(sender_account.id(), note_request) + .await + .map_err(|e| { + eprintln!("Transaction creation error: {e}"); + e + }) + .unwrap(); + let executed_transaction = tx_result.executed_transaction(); + assert_eq!(executed_transaction.output_notes().num_notes(), 1); + let executed_tx_output_note = executed_transaction.output_notes().get_note(0); + assert_eq!(executed_tx_output_note.id(), counter_note.id()); + let create_note_tx_id = executed_transaction.id(); + client.submit_transaction(tx_result).await.unwrap(); + eprintln!("Created counter note tx: {create_note_tx_id:?}"); + + // Consume the note with the counter account + let consume_request = TransactionRequestBuilder::new() + .unauthenticated_input_notes([(counter_note, None)]) + .build() + .unwrap(); + + let tx_result = client + .new_transaction(counter_account.id(), consume_request) + .await + .map_err(|e| { + eprintln!("Note consumption transaction error: {e}"); + e + }) + .unwrap(); + eprintln!( + "Consumed counter note tx: https://testnet.midenscan.com/tx/{:?}", + &tx_result.executed_transaction().id() + ); + + client.submit_transaction(tx_result).await.unwrap(); + + let sync_result = client.sync_state().await.unwrap(); + eprintln!("Synced to block: {}", sync_result.block_num); + + // The counter contract storage value should be 2 after the note is consumed + assert_counter_storage( + client + .get_account(counter_account.id()) + .await + .unwrap() + .unwrap() + .account() + .storage(), + 2, + ); + }); +} diff --git a/tests/integration-node/src/node_tests/helpers.rs b/tests/integration-node/src/node_tests/helpers.rs index bdb111fe3..5f72283a4 100644 --- a/tests/integration-node/src/node_tests/helpers.rs +++ b/tests/integration-node/src/node_tests/helpers.rs @@ -137,6 +137,38 @@ pub async fn create_account_with_component( builder = builder.with_component(account_component); + let (account, seed) = builder.build().unwrap_or_else(|e| { + eprintln!("failed to build account with custom auth component: {e}"); + panic!("failed to build account with custom auth component") + }); + client.add_account(&account, Some(seed), false).await?; + keystore.add_key(&AuthSecretKey::RpoFalcon512(key_pair)).unwrap(); + + Ok(account) +} + +/// Create a basic wallet account with standard RpoFalcon512 auth. +/// +/// This helper does not require a component package and always adds the `BasicWallet` component. +pub async fn create_basic_wallet_account( + client: &mut Client, + keystore: Arc>, + config: AccountCreationConfig, +) -> Result { + let mut init_seed = [0_u8; 32]; + client.rng().fill_bytes(&mut init_seed); + + let key_pair = SecretKey::with_rng(client.rng()); + + // Sync client state to get latest block info + let _sync_summary = client.sync_state().await.unwrap(); + + let builder = AccountBuilder::new(init_seed) + .account_type(config.account_type) + .storage_mode(config.storage_mode) + .with_auth_component(RpoFalcon512::new(key_pair.public_key())) + .with_component(BasicWallet); + let (account, seed) = builder.build().unwrap(); client.add_account(&account, Some(seed), false).await?; keystore.add_key(&AuthSecretKey::RpoFalcon512(key_pair)).unwrap(); @@ -144,6 +176,76 @@ pub async fn create_account_with_component( Ok(account) } +/// Helper to create an account with a custom component and a custom authentication component +pub async fn create_account_with_component_and_auth_package( + client: &mut Client, + component_package: Arc, + auth_component_package: Arc, + config: AccountCreationConfig, +) -> Result { + // Build the main account component from its template metadata + let account_component = match component_package.account_component_metadata_bytes.as_deref() { + None => panic!("no account component metadata present"), + Some(bytes) => { + let metadata = AccountComponentMetadata::read_from_bytes(bytes).unwrap(); + let template = AccountComponentTemplate::new( + metadata, + component_package.unwrap_library().as_ref().clone(), + ); + + let component = + AccountComponent::new(template.library().clone(), config.storage_slots.clone()) + .unwrap(); + + // Use supported types from config if provided, otherwise default to RegularAccountUpdatableCode + let supported_types = if let Some(types) = &config.supported_types { + BTreeSet::from_iter(types.iter().cloned()) + } else { + BTreeSet::from_iter([AccountType::RegularAccountUpdatableCode]) + }; + + component.with_supported_types(supported_types) + } + }; + + // Build the authentication component from the compiled library (no storage) + let mut auth_component = + AccountComponent::new(auth_component_package.unwrap_library().as_ref().clone(), vec![]) + .unwrap(); + + // Ensure auth component supports the intended account type + if let Some(types) = &config.supported_types { + auth_component = + auth_component.with_supported_types(BTreeSet::from_iter(types.iter().cloned())); + } else { + auth_component = auth_component + .with_supported_types(BTreeSet::from_iter([AccountType::RegularAccountUpdatableCode])); + } + + let mut init_seed = [0_u8; 32]; + client.rng().fill_bytes(&mut init_seed); + + // Sync client state to get latest block info + let _sync_summary = client.sync_state().await.unwrap(); + + let mut builder = AccountBuilder::new(init_seed) + .account_type(config.account_type) + .storage_mode(config.storage_mode) + .with_auth_component(auth_component); + + if config.with_basic_wallet { + builder = builder.with_component(BasicWallet); + } + + builder = builder.with_component(account_component); + + let (account, seed) = builder.build().unwrap(); + client.add_account(&account, Some(seed), false).await?; + // No keystore key needed for no-auth auth component + + Ok(account) +} + pub async fn create_fungible_faucet_account( client: &mut Client, keystore: Arc>, diff --git a/tests/integration-node/src/node_tests/mod.rs b/tests/integration-node/src/node_tests/mod.rs index 6a779e0e1..b28967961 100644 --- a/tests/integration-node/src/node_tests/mod.rs +++ b/tests/integration-node/src/node_tests/mod.rs @@ -2,4 +2,5 @@ pub mod basic_wallet; pub mod counter_contract; +pub mod counter_contract_no_auth; pub mod helpers; diff --git a/tests/integration/expected/abi_transform_stdlib_blake3_hash.masm b/tests/integration/expected/abi_transform_stdlib_blake3_hash.masm index ef3dd6f25..85e52ec90 100644 --- a/tests/integration/expected/abi_transform_stdlib_blake3_hash.masm +++ b/tests/integration/expected/abi_transform_stdlib_blake3_hash.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm index 9e5b66d7c..0257cfd83 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_felt.masm b/tests/integration/expected/add_felt.masm index 0886c55c3..10c6974b8 100644 --- a/tests/integration/expected/add_felt.masm +++ b/tests/integration/expected/add_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_i128.masm b/tests/integration/expected/add_i128.masm index c658a10b4..776fd5f31 100644 --- a/tests/integration/expected/add_i128.masm +++ b/tests/integration/expected/add_i128.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_i16.masm b/tests/integration/expected/add_i16.masm index 83b47f538..e79bfdcba 100644 --- a/tests/integration/expected/add_i16.masm +++ b/tests/integration/expected/add_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_i32.masm b/tests/integration/expected/add_i32.masm index e8f04824c..77c61bb48 100644 --- a/tests/integration/expected/add_i32.masm +++ b/tests/integration/expected/add_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_i64.masm b/tests/integration/expected/add_i64.masm index 907df6131..f7b1eecd1 100644 --- a/tests/integration/expected/add_i64.masm +++ b/tests/integration/expected/add_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_i8.masm b/tests/integration/expected/add_i8.masm index 3cc75863c..ae2ceaa39 100644 --- a/tests/integration/expected/add_i8.masm +++ b/tests/integration/expected/add_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_u128.masm b/tests/integration/expected/add_u128.masm index df065c0b6..a7d91d07d 100644 --- a/tests/integration/expected/add_u128.masm +++ b/tests/integration/expected/add_u128.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_u16.masm b/tests/integration/expected/add_u16.masm index 96457d3b7..7a775f444 100644 --- a/tests/integration/expected/add_u16.masm +++ b/tests/integration/expected/add_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_u32.masm b/tests/integration/expected/add_u32.masm index f19399e3e..ff020eee0 100644 --- a/tests/integration/expected/add_u32.masm +++ b/tests/integration/expected/add_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_u64.masm b/tests/integration/expected/add_u64.masm index 06abe5561..143ad5e58 100644 --- a/tests/integration/expected/add_u64.masm +++ b/tests/integration/expected/add_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/add_u8.masm b/tests/integration/expected/add_u8.masm index fec65929d..bae354e9a 100644 --- a/tests/integration/expected/add_u8.masm +++ b/tests/integration/expected/add_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/adv_load_preimage.masm b/tests/integration/expected/adv_load_preimage.masm index e370314cd..cd86a7dca 100644 --- a/tests/integration/expected/adv_load_preimage.masm +++ b/tests/integration/expected/adv_load_preimage.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/and_bool.masm b/tests/integration/expected/and_bool.masm index 097e78bcf..1c574e596 100644 --- a/tests/integration/expected/and_bool.masm +++ b/tests/integration/expected/and_bool.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_i16.masm b/tests/integration/expected/band_i16.masm index b976d0b52..a9dcd7af5 100644 --- a/tests/integration/expected/band_i16.masm +++ b/tests/integration/expected/band_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_i32.masm b/tests/integration/expected/band_i32.masm index 95b12691e..98af1e079 100644 --- a/tests/integration/expected/band_i32.masm +++ b/tests/integration/expected/band_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_i64.masm b/tests/integration/expected/band_i64.masm index f458ad478..c9ea01c35 100644 --- a/tests/integration/expected/band_i64.masm +++ b/tests/integration/expected/band_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_i8.masm b/tests/integration/expected/band_i8.masm index 504245b4d..93e2ae29c 100644 --- a/tests/integration/expected/band_i8.masm +++ b/tests/integration/expected/band_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_u16.masm b/tests/integration/expected/band_u16.masm index dab889490..8fdd30a02 100644 --- a/tests/integration/expected/band_u16.masm +++ b/tests/integration/expected/band_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_u32.masm b/tests/integration/expected/band_u32.masm index 4ab183f2c..b678ce1cb 100644 --- a/tests/integration/expected/band_u32.masm +++ b/tests/integration/expected/band_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_u64.masm b/tests/integration/expected/band_u64.masm index bca6fb4ea..4e0777c7d 100644 --- a/tests/integration/expected/band_u64.masm +++ b/tests/integration/expected/band_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/band_u8.masm b/tests/integration/expected/band_u8.masm index 6a337acec..859b3560b 100644 --- a/tests/integration/expected/band_u8.masm +++ b/tests/integration/expected/band_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_bool.masm b/tests/integration/expected/bnot_bool.masm index ae44b8b30..b0358e3e4 100644 --- a/tests/integration/expected/bnot_bool.masm +++ b/tests/integration/expected/bnot_bool.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_i16.masm b/tests/integration/expected/bnot_i16.masm index 5d468b46a..7e7d36549 100644 --- a/tests/integration/expected/bnot_i16.masm +++ b/tests/integration/expected/bnot_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_i32.masm b/tests/integration/expected/bnot_i32.masm index a3ad35ea1..dfdfc233a 100644 --- a/tests/integration/expected/bnot_i32.masm +++ b/tests/integration/expected/bnot_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_i64.masm b/tests/integration/expected/bnot_i64.masm index 5bcf33f91..1d848322d 100644 --- a/tests/integration/expected/bnot_i64.masm +++ b/tests/integration/expected/bnot_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_i8.masm b/tests/integration/expected/bnot_i8.masm index f89651d78..1d9ba18f3 100644 --- a/tests/integration/expected/bnot_i8.masm +++ b/tests/integration/expected/bnot_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_u16.masm b/tests/integration/expected/bnot_u16.masm index 6b0b3d735..ab891ead8 100644 --- a/tests/integration/expected/bnot_u16.masm +++ b/tests/integration/expected/bnot_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_u32.masm b/tests/integration/expected/bnot_u32.masm index 5313c0256..feae5fa98 100644 --- a/tests/integration/expected/bnot_u32.masm +++ b/tests/integration/expected/bnot_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_u64.masm b/tests/integration/expected/bnot_u64.masm index e8d8e9503..82079d84f 100644 --- a/tests/integration/expected/bnot_u64.masm +++ b/tests/integration/expected/bnot_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bnot_u8.masm b/tests/integration/expected/bnot_u8.masm index 53a0bbf9c..6dcd87b8f 100644 --- a/tests/integration/expected/bnot_u8.masm +++ b/tests/integration/expected/bnot_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_i16.masm b/tests/integration/expected/bor_i16.masm index fb5513ef0..a2ea47f9e 100644 --- a/tests/integration/expected/bor_i16.masm +++ b/tests/integration/expected/bor_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_i32.masm b/tests/integration/expected/bor_i32.masm index 798707a02..533074be7 100644 --- a/tests/integration/expected/bor_i32.masm +++ b/tests/integration/expected/bor_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_i64.masm b/tests/integration/expected/bor_i64.masm index 83ff0d44e..2d1eca6c1 100644 --- a/tests/integration/expected/bor_i64.masm +++ b/tests/integration/expected/bor_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_i8.masm b/tests/integration/expected/bor_i8.masm index 46239050c..eacd6f757 100644 --- a/tests/integration/expected/bor_i8.masm +++ b/tests/integration/expected/bor_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_u16.masm b/tests/integration/expected/bor_u16.masm index 7a0910d39..cb0dfae2f 100644 --- a/tests/integration/expected/bor_u16.masm +++ b/tests/integration/expected/bor_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_u32.masm b/tests/integration/expected/bor_u32.masm index 167da45e5..d5ee7afa7 100644 --- a/tests/integration/expected/bor_u32.masm +++ b/tests/integration/expected/bor_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_u64.masm b/tests/integration/expected/bor_u64.masm index 7b32cc0d2..6351632b2 100644 --- a/tests/integration/expected/bor_u64.masm +++ b/tests/integration/expected/bor_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bor_u8.masm b/tests/integration/expected/bor_u8.masm index d4b0fcee0..6ceaa3dd0 100644 --- a/tests/integration/expected/bor_u8.masm +++ b/tests/integration/expected/bor_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_i16.masm b/tests/integration/expected/bxor_i16.masm index e2052c141..77a83dd45 100644 --- a/tests/integration/expected/bxor_i16.masm +++ b/tests/integration/expected/bxor_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_i32.masm b/tests/integration/expected/bxor_i32.masm index df5361f57..9e98ce9a7 100644 --- a/tests/integration/expected/bxor_i32.masm +++ b/tests/integration/expected/bxor_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_i64.masm b/tests/integration/expected/bxor_i64.masm index 4f241f5fb..f5033bf81 100644 --- a/tests/integration/expected/bxor_i64.masm +++ b/tests/integration/expected/bxor_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_i8.masm b/tests/integration/expected/bxor_i8.masm index 9c757f959..74b1bb60f 100644 --- a/tests/integration/expected/bxor_i8.masm +++ b/tests/integration/expected/bxor_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_u16.masm b/tests/integration/expected/bxor_u16.masm index 6671262b0..108cc0247 100644 --- a/tests/integration/expected/bxor_u16.masm +++ b/tests/integration/expected/bxor_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_u32.masm b/tests/integration/expected/bxor_u32.masm index a33a62e0a..fd09b382b 100644 --- a/tests/integration/expected/bxor_u32.masm +++ b/tests/integration/expected/bxor_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_u64.masm b/tests/integration/expected/bxor_u64.masm index b9a2c4ac0..3142d4a30 100644 --- a/tests/integration/expected/bxor_u64.masm +++ b/tests/integration/expected/bxor_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/bxor_u8.masm b/tests/integration/expected/bxor_u8.masm index bde99959a..ba2825b6c 100644 --- a/tests/integration/expected/bxor_u8.masm +++ b/tests/integration/expected/bxor_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/collatz.masm b/tests/integration/expected/collatz.masm index 332059314..cc8ce2b93 100644 --- a/tests/integration/expected/collatz.masm +++ b/tests/integration/expected/collatz.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/core::cmp::max_u8_u8.masm b/tests/integration/expected/core::cmp::max_u8_u8.masm index 61f81a1a0..de4849e10 100644 --- a/tests/integration/expected/core::cmp::max_u8_u8.masm +++ b/tests/integration/expected/core::cmp::max_u8_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/core::cmp::min_i32_i32.masm b/tests/integration/expected/core::cmp::min_i32_i32.masm index acd77e09a..9f53d02c4 100644 --- a/tests/integration/expected/core::cmp::min_i32_i32.masm +++ b/tests/integration/expected/core::cmp::min_i32_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/core::cmp::min_u32_u32.masm b/tests/integration/expected/core::cmp::min_u32_u32.masm index c403c1b25..47d889167 100644 --- a/tests/integration/expected/core::cmp::min_u32_u32.masm +++ b/tests/integration/expected/core::cmp::min_u32_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/core::cmp::min_u8_u8.masm b/tests/integration/expected/core::cmp::min_u8_u8.masm index 218c91085..70074d8b3 100644 --- a/tests/integration/expected/core::cmp::min_u8_u8.masm +++ b/tests/integration/expected/core::cmp::min_u8_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/div_felt.masm b/tests/integration/expected/div_felt.masm index bfcdf8837..a3712e043 100644 --- a/tests/integration/expected/div_felt.masm +++ b/tests/integration/expected/div_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_felt.masm b/tests/integration/expected/eq_felt.masm index 16f9f7401..74b2aa969 100644 --- a/tests/integration/expected/eq_felt.masm +++ b/tests/integration/expected/eq_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_i16.masm b/tests/integration/expected/eq_i16.masm index 6e76c6f4d..70d3b8a1a 100644 --- a/tests/integration/expected/eq_i16.masm +++ b/tests/integration/expected/eq_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_i32.masm b/tests/integration/expected/eq_i32.masm index 2f3b60de6..fa5b90ea7 100644 --- a/tests/integration/expected/eq_i32.masm +++ b/tests/integration/expected/eq_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_i64.masm b/tests/integration/expected/eq_i64.masm index 83f335f5f..a76ad3882 100644 --- a/tests/integration/expected/eq_i64.masm +++ b/tests/integration/expected/eq_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_i8.masm b/tests/integration/expected/eq_i8.masm index 891feb8ad..b3547e844 100644 --- a/tests/integration/expected/eq_i8.masm +++ b/tests/integration/expected/eq_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_u16.masm b/tests/integration/expected/eq_u16.masm index 479887ff2..9deed334a 100644 --- a/tests/integration/expected/eq_u16.masm +++ b/tests/integration/expected/eq_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_u32.masm b/tests/integration/expected/eq_u32.masm index 3713758be..396d8ea31 100644 --- a/tests/integration/expected/eq_u32.masm +++ b/tests/integration/expected/eq_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_u64.masm b/tests/integration/expected/eq_u64.masm index aeebbd34a..f8aa123b9 100644 --- a/tests/integration/expected/eq_u64.masm +++ b/tests/integration/expected/eq_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/eq_u8.masm b/tests/integration/expected/eq_u8.masm index 07fde61bf..63b7b38a9 100644 --- a/tests/integration/expected/eq_u8.masm +++ b/tests/integration/expected/eq_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/examples/auth_component_no_auth.hir b/tests/integration/expected/examples/auth_component_no_auth.hir new file mode 100644 index 000000000..661f4cc08 --- /dev/null +++ b/tests/integration/expected/examples/auth_component_no_auth.hir @@ -0,0 +1,482 @@ +builtin.component miden:base/authentication-component@1.0.0 { + builtin.module public @auth_component_no_auth { + private builtin.function @__wasm_call_ctors() { + ^block5: + builtin.ret ; + }; + + private builtin.function @auth_component_no_auth::bindings::__link_custom_section_describing_imports() { + ^block7: + builtin.ret ; + }; + + private builtin.function @miden:base/authentication-component@1.0.0#auth-procedure(v0: felt, v1: felt, v2: felt, v3: felt) { + ^block9(v0: felt, v1: felt, v2: felt, v3: felt): + v5 = builtin.global_symbol @miden:base/authentication-component@1.0.0/auth_component_no_auth/__stack_pointer : ptr + v6 = hir.bitcast v5 : ptr; + v7 = hir.load v6 : i32; + v8 = arith.constant 64 : i32; + v9 = arith.sub v7, v8 : i32 #[overflow = wrapping]; + v10 = builtin.global_symbol @miden:base/authentication-component@1.0.0/auth_component_no_auth/__stack_pointer : ptr + v11 = hir.bitcast v10 : ptr; + hir.store v11, v9; + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/wit_bindgen_rt::run_ctors_once() + v12 = arith.constant 32 : i32; + v13 = arith.add v9, v12 : i32 #[overflow = wrapping]; + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden::account::get_initial_commitment(v13) + v15 = arith.constant 40 : u32; + v14 = hir.bitcast v9 : u32; + v16 = arith.add v14, v15 : u32 #[overflow = checked]; + v17 = arith.constant 8 : u32; + v18 = arith.mod v16, v17 : u32; + hir.assertz v18 #[code = 250]; + v19 = hir.int_to_ptr v16 : ptr; + v20 = hir.load v19 : i64; + v22 = arith.constant 56 : u32; + v21 = hir.bitcast v9 : u32; + v23 = arith.add v21, v22 : u32 #[overflow = checked]; + v386 = arith.constant 8 : u32; + v25 = arith.mod v23, v386 : u32; + hir.assertz v25 #[code = 250]; + v26 = hir.int_to_ptr v23 : ptr; + hir.store v26, v20; + v28 = arith.constant 32 : u32; + v27 = hir.bitcast v9 : u32; + v29 = arith.add v27, v28 : u32 #[overflow = checked]; + v385 = arith.constant 8 : u32; + v31 = arith.mod v29, v385 : u32; + hir.assertz v31 #[code = 250]; + v32 = hir.int_to_ptr v29 : ptr; + v33 = hir.load v32 : i64; + v35 = arith.constant 48 : u32; + v34 = hir.bitcast v9 : u32; + v36 = arith.add v34, v35 : u32 #[overflow = checked]; + v384 = arith.constant 8 : u32; + v38 = arith.mod v36, v384 : u32; + hir.assertz v38 #[code = 250]; + v39 = hir.int_to_ptr v36 : ptr; + hir.store v39, v33; + v40 = arith.constant 48 : i32; + v41 = arith.add v9, v40 : i32 #[overflow = wrapping]; + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden_stdlib_sys::intrinsics::word::Word::reverse(v9, v41) + v383 = arith.constant 32 : i32; + v43 = arith.add v9, v383 : i32 #[overflow = wrapping]; + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden::account::compute_current_commitment(v43) + v382 = arith.constant 40 : u32; + v44 = hir.bitcast v9 : u32; + v46 = arith.add v44, v382 : u32 #[overflow = checked]; + v381 = arith.constant 8 : u32; + v48 = arith.mod v46, v381 : u32; + hir.assertz v48 #[code = 250]; + v49 = hir.int_to_ptr v46 : ptr; + v50 = hir.load v49 : i64; + v380 = arith.constant 56 : u32; + v51 = hir.bitcast v9 : u32; + v53 = arith.add v51, v380 : u32 #[overflow = checked]; + v379 = arith.constant 8 : u32; + v55 = arith.mod v53, v379 : u32; + hir.assertz v55 #[code = 250]; + v56 = hir.int_to_ptr v53 : ptr; + hir.store v56, v50; + v378 = arith.constant 32 : u32; + v57 = hir.bitcast v9 : u32; + v59 = arith.add v57, v378 : u32 #[overflow = checked]; + v377 = arith.constant 8 : u32; + v61 = arith.mod v59, v377 : u32; + hir.assertz v61 #[code = 250]; + v62 = hir.int_to_ptr v59 : ptr; + v63 = hir.load v62 : i64; + v376 = arith.constant 48 : u32; + v64 = hir.bitcast v9 : u32; + v66 = arith.add v64, v376 : u32 #[overflow = checked]; + v375 = arith.constant 8 : u32; + v68 = arith.mod v66, v375 : u32; + hir.assertz v68 #[code = 250]; + v69 = hir.int_to_ptr v66 : ptr; + hir.store v69, v63; + v374 = arith.constant 48 : i32; + v73 = arith.add v9, v374 : i32 #[overflow = wrapping]; + v70 = arith.constant 16 : i32; + v71 = arith.add v9, v70 : i32 #[overflow = wrapping]; + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden_stdlib_sys::intrinsics::word::Word::reverse(v71, v73) + v75 = arith.constant 16 : u32; + v74 = hir.bitcast v9 : u32; + v76 = arith.add v74, v75 : u32 #[overflow = checked]; + v77 = arith.constant 4 : u32; + v78 = arith.mod v76, v77 : u32; + hir.assertz v78 #[code = 250]; + v79 = hir.int_to_ptr v76 : ptr; + v80 = hir.load v79 : felt; + v81 = hir.bitcast v9 : u32; + v373 = arith.constant 4 : u32; + v83 = arith.mod v81, v373 : u32; + hir.assertz v83 #[code = 250]; + v84 = hir.int_to_ptr v81 : ptr; + v85 = hir.load v84 : felt; + v86 = hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/intrinsics::felt::eq(v80, v85) : i32 + v4 = arith.constant 0 : i32; + v87 = arith.constant 1 : i32; + v88 = arith.neq v86, v87 : i1; + v89 = arith.zext v88 : u32; + v90 = hir.bitcast v89 : i32; + v92 = arith.neq v90, v4 : i1; + v329, v330, v331 = scf.if v92 : i32, i32, u32 { + ^block44: + v320 = arith.constant 0 : u32; + v324 = ub.poison i32 : i32; + scf.yield v9, v324, v320; + } else { + ^block13: + v94 = arith.constant 20 : u32; + v93 = hir.bitcast v9 : u32; + v95 = arith.add v93, v94 : u32 #[overflow = checked]; + v372 = arith.constant 4 : u32; + v97 = arith.mod v95, v372 : u32; + hir.assertz v97 #[code = 250]; + v98 = hir.int_to_ptr v95 : ptr; + v99 = hir.load v98 : felt; + v371 = arith.constant 4 : u32; + v100 = hir.bitcast v9 : u32; + v102 = arith.add v100, v371 : u32 #[overflow = checked]; + v370 = arith.constant 4 : u32; + v104 = arith.mod v102, v370 : u32; + hir.assertz v104 #[code = 250]; + v105 = hir.int_to_ptr v102 : ptr; + v106 = hir.load v105 : felt; + v107 = hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/intrinsics::felt::eq(v99, v106) : i32 + v368 = arith.constant 0 : i32; + v369 = arith.constant 1 : i32; + v109 = arith.neq v107, v369 : i1; + v110 = arith.zext v109 : u32; + v111 = hir.bitcast v110 : i32; + v113 = arith.neq v111, v368 : i1; + v336, v337, v338 = scf.if v113 : i32, i32, u32 { + ^block43: + v366 = arith.constant 0 : u32; + v367 = ub.poison i32 : i32; + scf.yield v9, v367, v366; + } else { + ^block14: + v115 = arith.constant 24 : u32; + v114 = hir.bitcast v9 : u32; + v116 = arith.add v114, v115 : u32 #[overflow = checked]; + v365 = arith.constant 4 : u32; + v118 = arith.mod v116, v365 : u32; + hir.assertz v118 #[code = 250]; + v119 = hir.int_to_ptr v116 : ptr; + v120 = hir.load v119 : felt; + v364 = arith.constant 8 : u32; + v121 = hir.bitcast v9 : u32; + v123 = arith.add v121, v364 : u32 #[overflow = checked]; + v363 = arith.constant 4 : u32; + v125 = arith.mod v123, v363 : u32; + hir.assertz v125 #[code = 250]; + v126 = hir.int_to_ptr v123 : ptr; + v127 = hir.load v126 : felt; + v128 = hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/intrinsics::felt::eq(v120, v127) : i32 + v361 = arith.constant 0 : i32; + v362 = arith.constant 1 : i32; + v130 = arith.neq v128, v362 : i1; + v131 = arith.zext v130 : u32; + v132 = hir.bitcast v131 : i32; + v134 = arith.neq v132, v361 : i1; + v342, v343, v344 = scf.if v134 : i32, i32, u32 { + ^block42: + v359 = arith.constant 0 : u32; + v360 = ub.poison i32 : i32; + scf.yield v9, v360, v359; + } else { + ^block15: + v136 = arith.constant 28 : u32; + v135 = hir.bitcast v9 : u32; + v137 = arith.add v135, v136 : u32 #[overflow = checked]; + v358 = arith.constant 4 : u32; + v139 = arith.mod v137, v358 : u32; + hir.assertz v139 #[code = 250]; + v140 = hir.int_to_ptr v137 : ptr; + v141 = hir.load v140 : felt; + v143 = arith.constant 12 : u32; + v142 = hir.bitcast v9 : u32; + v144 = arith.add v142, v143 : u32 #[overflow = checked]; + v357 = arith.constant 4 : u32; + v146 = arith.mod v144, v357 : u32; + hir.assertz v146 #[code = 250]; + v147 = hir.int_to_ptr v144 : ptr; + v148 = hir.load v147 : felt; + v149 = hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/intrinsics::felt::eq(v141, v148) : i32 + v355 = arith.constant 0 : i32; + v356 = arith.constant 1 : i32; + v151 = arith.eq v149, v356 : i1; + v152 = arith.zext v151 : u32; + v153 = hir.bitcast v152 : i32; + v155 = arith.neq v153, v355 : i1; + v352 = arith.constant 0 : u32; + v325 = arith.constant 1 : u32; + v350 = cf.select v155, v325, v352 : u32; + v353 = ub.poison i32 : i32; + v349 = cf.select v155, v9, v353 : i32; + v354 = ub.poison i32 : i32; + v348 = cf.select v155, v354, v9 : i32; + scf.yield v348, v349, v350; + }; + scf.yield v342, v343, v344; + }; + scf.yield v336, v337, v338; + }; + v332 = scf.index_switch v331 : i32 + case 0 { + ^block12: + v156 = hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden_base_sys::bindings::account::incr_nonce() : felt + scf.yield v329; + } + default { + ^block48: + scf.yield v330; + }; + v351 = arith.constant 64 : i32; + v160 = arith.add v332, v351 : i32 #[overflow = wrapping]; + v161 = builtin.global_symbol @miden:base/authentication-component@1.0.0/auth_component_no_auth/__stack_pointer : ptr + v162 = hir.bitcast v161 : ptr; + hir.store v162, v160; + builtin.ret ; + }; + + private builtin.function @wit_bindgen_rt::run_ctors_once() { + ^block17: + v164 = builtin.global_symbol @miden:base/authentication-component@1.0.0/auth_component_no_auth/GOT.data.internal.__memory_base : ptr + v165 = hir.bitcast v164 : ptr; + v166 = hir.load v165 : i32; + v167 = arith.constant 1048584 : i32; + v168 = arith.add v166, v167 : i32 #[overflow = wrapping]; + v169 = hir.bitcast v168 : u32; + v170 = hir.int_to_ptr v169 : ptr; + v171 = hir.load v170 : u8; + v163 = arith.constant 0 : i32; + v172 = arith.zext v171 : u32; + v173 = hir.bitcast v172 : i32; + v175 = arith.neq v173, v163 : i1; + scf.if v175{ + ^block19: + scf.yield ; + } else { + ^block20: + v176 = builtin.global_symbol @miden:base/authentication-component@1.0.0/auth_component_no_auth/GOT.data.internal.__memory_base : ptr + v177 = hir.bitcast v176 : ptr; + v178 = hir.load v177 : i32; + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/__wasm_call_ctors() + v388 = arith.constant 1 : u8; + v390 = arith.constant 1048584 : i32; + v180 = arith.add v178, v390 : i32 #[overflow = wrapping]; + v184 = hir.bitcast v180 : u32; + v185 = hir.int_to_ptr v184 : ptr; + hir.store v185, v388; + scf.yield ; + }; + builtin.ret ; + }; + + private builtin.function @miden_base_sys::bindings::account::incr_nonce() -> felt { + ^block21: + v187 = hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden::account::incr_nonce() : felt + builtin.ret v187; + }; + + private builtin.function @miden::account::get_initial_commitment(v188: i32) { + ^block23(v188: i32): + v189, v190, v191, v192 = hir.exec @miden/account/get_initial_commitment() : felt, felt, felt, felt + v193 = hir.bitcast v188 : u32; + v194 = hir.int_to_ptr v193 : ptr; + hir.store v194, v189; + v195 = arith.constant 4 : u32; + v196 = arith.add v193, v195 : u32 #[overflow = checked]; + v197 = hir.int_to_ptr v196 : ptr; + hir.store v197, v190; + v198 = arith.constant 8 : u32; + v199 = arith.add v193, v198 : u32 #[overflow = checked]; + v200 = hir.int_to_ptr v199 : ptr; + hir.store v200, v191; + v201 = arith.constant 12 : u32; + v202 = arith.add v193, v201 : u32 #[overflow = checked]; + v203 = hir.int_to_ptr v202 : ptr; + hir.store v203, v192; + builtin.ret ; + }; + + private builtin.function @miden::account::compute_current_commitment(v204: i32) { + ^block27(v204: i32): + v205, v206, v207, v208 = hir.exec @miden/account/compute_current_commitment() : felt, felt, felt, felt + v209 = hir.bitcast v204 : u32; + v210 = hir.int_to_ptr v209 : ptr; + hir.store v210, v205; + v211 = arith.constant 4 : u32; + v212 = arith.add v209, v211 : u32 #[overflow = checked]; + v213 = hir.int_to_ptr v212 : ptr; + hir.store v213, v206; + v214 = arith.constant 8 : u32; + v215 = arith.add v209, v214 : u32 #[overflow = checked]; + v216 = hir.int_to_ptr v215 : ptr; + hir.store v216, v207; + v217 = arith.constant 12 : u32; + v218 = arith.add v209, v217 : u32 #[overflow = checked]; + v219 = hir.int_to_ptr v218 : ptr; + hir.store v219, v208; + builtin.ret ; + }; + + private builtin.function @miden::account::incr_nonce() -> felt { + ^block29: + v220 = hir.exec @miden/account/incr_nonce() : felt + builtin.ret v220; + }; + + private builtin.function @miden_stdlib_sys::intrinsics::word::Word::reverse(v222: i32, v223: i32) { + ^block31(v222: i32, v223: i32): + v226 = builtin.global_symbol @miden:base/authentication-component@1.0.0/auth_component_no_auth/__stack_pointer : ptr + v227 = hir.bitcast v226 : ptr; + v228 = hir.load v227 : i32; + v229 = arith.constant 16 : i32; + v230 = arith.sub v228, v229 : i32 #[overflow = wrapping]; + v232 = arith.constant 8 : u32; + v231 = hir.bitcast v223 : u32; + v233 = arith.add v231, v232 : u32 #[overflow = checked]; + v477 = arith.constant 8 : u32; + v235 = arith.mod v233, v477 : u32; + hir.assertz v235 #[code = 250]; + v236 = hir.int_to_ptr v233 : ptr; + v237 = hir.load v236 : i64; + v476 = arith.constant 8 : u32; + v238 = hir.bitcast v230 : u32; + v240 = arith.add v238, v476 : u32 #[overflow = checked]; + v241 = arith.constant 4 : u32; + v242 = arith.mod v240, v241 : u32; + hir.assertz v242 #[code = 250]; + v243 = hir.int_to_ptr v240 : ptr; + hir.store v243, v237; + v244 = hir.bitcast v223 : u32; + v475 = arith.constant 8 : u32; + v246 = arith.mod v244, v475 : u32; + hir.assertz v246 #[code = 250]; + v247 = hir.int_to_ptr v244 : ptr; + v248 = hir.load v247 : i64; + v249 = hir.bitcast v230 : u32; + v474 = arith.constant 4 : u32; + v251 = arith.mod v249, v474 : u32; + hir.assertz v251 #[code = 250]; + v252 = hir.int_to_ptr v249 : ptr; + hir.store v252, v248; + v253 = arith.constant 12 : i32; + v254 = arith.add v230, v253 : i32 #[overflow = wrapping]; + v224 = arith.constant 0 : i32; + v445, v446, v447, v448, v449, v450 = scf.while v224, v230, v254, v222 : i32, i32, i32, i32, i32, i32 { + ^block59(v451: i32, v452: i32, v453: i32, v454: i32): + v473 = arith.constant 0 : i32; + v257 = arith.constant 8 : i32; + v258 = arith.eq v451, v257 : i1; + v259 = arith.zext v258 : u32; + v260 = hir.bitcast v259 : i32; + v262 = arith.neq v260, v473 : i1; + v439, v440 = scf.if v262 : i32, i32 { + ^block58: + v399 = ub.poison i32 : i32; + scf.yield v399, v399; + } else { + ^block36: + v264 = arith.add v452, v451 : i32 #[overflow = wrapping]; + v265 = hir.bitcast v264 : u32; + v472 = arith.constant 4 : u32; + v267 = arith.mod v265, v472 : u32; + hir.assertz v267 #[code = 250]; + v268 = hir.int_to_ptr v265 : ptr; + v269 = hir.load v268 : felt; + v271 = hir.bitcast v453 : u32; + v471 = arith.constant 4 : u32; + v273 = arith.mod v271, v471 : u32; + hir.assertz v273 #[code = 250]; + v274 = hir.int_to_ptr v271 : ptr; + v275 = hir.load v274 : i32; + v276 = hir.bitcast v264 : u32; + v470 = arith.constant 4 : u32; + v278 = arith.mod v276, v470 : u32; + hir.assertz v278 #[code = 250]; + v279 = hir.int_to_ptr v276 : ptr; + hir.store v279, v275; + v280 = hir.bitcast v453 : u32; + v469 = arith.constant 4 : u32; + v282 = arith.mod v280, v469 : u32; + hir.assertz v282 #[code = 250]; + v283 = hir.int_to_ptr v280 : ptr; + hir.store v283, v269; + v286 = arith.constant -4 : i32; + v287 = arith.add v453, v286 : i32 #[overflow = wrapping]; + v284 = arith.constant 4 : i32; + v285 = arith.add v451, v284 : i32 #[overflow = wrapping]; + scf.yield v285, v287; + }; + v467 = ub.poison i32 : i32; + v442 = cf.select v262, v467, v454 : i32; + v468 = ub.poison i32 : i32; + v441 = cf.select v262, v468, v452 : i32; + v398 = arith.constant 1 : u32; + v391 = arith.constant 0 : u32; + v444 = cf.select v262, v391, v398 : u32; + v432 = arith.trunc v444 : i1; + scf.condition v432, v439, v441, v440, v442, v452, v454; + } do { + ^block60(v455: i32, v456: i32, v457: i32, v458: i32, v459: i32, v460: i32): + scf.yield v455, v456, v457, v458; + }; + v466 = arith.constant 8 : u32; + v289 = hir.bitcast v449 : u32; + v291 = arith.add v289, v466 : u32 #[overflow = checked]; + v465 = arith.constant 4 : u32; + v293 = arith.mod v291, v465 : u32; + hir.assertz v293 #[code = 250]; + v294 = hir.int_to_ptr v291 : ptr; + v295 = hir.load v294 : i64; + v464 = arith.constant 8 : u32; + v296 = hir.bitcast v450 : u32; + v298 = arith.add v296, v464 : u32 #[overflow = checked]; + v463 = arith.constant 8 : u32; + v300 = arith.mod v298, v463 : u32; + hir.assertz v300 #[code = 250]; + v301 = hir.int_to_ptr v298 : ptr; + hir.store v301, v295; + v302 = hir.bitcast v449 : u32; + v462 = arith.constant 4 : u32; + v304 = arith.mod v302, v462 : u32; + hir.assertz v304 #[code = 250]; + v305 = hir.int_to_ptr v302 : ptr; + v306 = hir.load v305 : i64; + v307 = hir.bitcast v450 : u32; + v461 = arith.constant 8 : u32; + v309 = arith.mod v307, v461 : u32; + hir.assertz v309 #[code = 250]; + v310 = hir.int_to_ptr v307 : ptr; + hir.store v310, v306; + builtin.ret ; + }; + + private builtin.function @intrinsics::felt::eq(v311: felt, v312: felt) -> i32 { + ^block37(v311: felt, v312: felt): + v313 = arith.eq v311, v312 : i1; + v314 = hir.cast v313 : i32; + builtin.ret v314; + }; + + builtin.global_variable private @#__stack_pointer : i32 { + builtin.ret_imm 1048576; + }; + + builtin.global_variable private @#GOT.data.internal.__memory_base : i32 { + builtin.ret_imm 0; + }; + + builtin.segment @1048576 = 0x00000000000000000000000100000001; + }; + + public builtin.function @auth__procedure(v316: felt, v317: felt, v318: felt, v319: felt) { + ^block39(v316: felt, v317: felt, v318: felt, v319: felt): + hir.exec @miden:base/authentication-component@1.0.0/auth_component_no_auth/miden:base/authentication-component@1.0.0#auth-procedure(v316, v317, v318, v319) + builtin.ret ; + }; +}; \ No newline at end of file diff --git a/tests/integration/expected/examples/auth_component_no_auth.masm b/tests/integration/expected/examples/auth_component_no_auth.masm new file mode 100644 index 000000000..ebe50767a --- /dev/null +++ b/tests/integration/expected/examples/auth_component_no_auth.masm @@ -0,0 +1,968 @@ +# mod miden:base/authentication-component@1.0.0 + +export.auth__procedure + exec.::miden:base/authentication-component@1.0.0::init + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden:base/authentication-component@1.0.0#auth-procedure + trace.252 + nop + exec.::std::sys::truncate_stack +end + +proc.init + push.1179648 + trace.240 + exec.::intrinsics::mem::heap_init + trace.252 + push.7028007876379170725 + push.18060021366771303825 + push.13412364500725888848 + push.14178532912296021363 + adv.push_mapval + push.262144 + push.1 + trace.240 + exec.::std::mem::pipe_preimage_to_memory + trace.252 + drop + push.1048576 + u32assert + mem_store.278536 + push.0 + u32assert + mem_store.278537 +end + +# mod miden:base/authentication-component@1.0.0::auth_component_no_auth + +proc.__wasm_call_ctors + nop +end + +proc.auth_component_no_auth::bindings::__link_custom_section_describing_imports + nop +end + +proc.miden:base/authentication-component@1.0.0#auth-procedure + drop + drop + drop + drop + push.1114144 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_sw + trace.252 + nop + push.64 + u32wrapping_sub + push.1114144 + dup.1 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_sw + trace.252 + nop + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::wit_bindgen_rt::run_ctors_once + trace.252 + nop + push.32 + dup.1 + swap.1 + u32wrapping_add + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden::account::get_initial_commitment + trace.252 + nop + push.40 + dup.1 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + push.56 + dup.3 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + push.32 + dup.1 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + push.48 + dup.3 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + push.48 + dup.1 + swap.1 + u32wrapping_add + dup.1 + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden_stdlib_sys::intrinsics::word::Word::reverse + trace.252 + nop + push.32 + dup.1 + swap.1 + u32wrapping_add + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden::account::compute_current_commitment + trace.252 + nop + push.40 + dup.1 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + push.56 + dup.3 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + push.32 + dup.1 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + push.48 + dup.3 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + push.48 + dup.1 + swap.1 + u32wrapping_add + push.16 + dup.2 + swap.1 + u32wrapping_add + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden_stdlib_sys::intrinsics::word::Word::reverse + trace.252 + nop + push.16 + dup.1 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + dup.1 + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + swap.1 + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::intrinsics::felt::eq + trace.252 + nop + push.0 + push.1 + movup.2 + swap.1 + neq + neq + if.true + push.0 + push.3735929054 + movup.2 + else + push.20 + dup.1 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + push.4 + dup.2 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + swap.1 + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::intrinsics::felt::eq + trace.252 + nop + push.0 + push.1 + movup.2 + swap.1 + neq + neq + if.true + push.0 + push.3735929054 + movup.2 + else + push.24 + dup.1 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + push.8 + dup.2 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + swap.1 + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::intrinsics::felt::eq + trace.252 + nop + push.0 + push.1 + movup.2 + swap.1 + neq + neq + if.true + push.0 + push.3735929054 + movup.2 + else + push.28 + dup.1 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + push.12 + dup.2 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + swap.1 + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::intrinsics::felt::eq + trace.252 + nop + push.0 + push.1 + movup.2 + swap.1 + eq + neq + push.0 + push.1 + dup.2 + cdrop + push.3735929054 + dup.2 + dup.4 + swap.1 + cdrop + push.3735929054 + movup.2 + swap.4 + movdn.2 + swap.1 + swap.3 + cdrop + end + end + end + movup.2 + eq.0 + if.true + swap.1 + drop + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden_base_sys::bindings::account::incr_nonce + trace.252 + nop + drop + else + drop + end + push.64 + u32wrapping_add + push.1114144 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_sw + trace.252 + nop +end + +proc.wit_bindgen_rt::run_ctors_once + push.1114148 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_sw + trace.252 + nop + push.1048584 + u32wrapping_add + u32divmod.4 + swap.1 + swap.1 + dup.1 + mem_load + swap.1 + push.8 + u32wrapping_mul + u32shr + swap.1 + drop + push.255 + u32and + push.0 + swap.1 + neq + if.true + nop + else + push.1114148 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_sw + trace.252 + nop + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::__wasm_call_ctors + trace.252 + nop + push.1 + push.1048584 + movup.2 + swap.1 + u32wrapping_add + u32divmod.4 + swap.1 + dup.0 + mem_load + dup.2 + push.8 + u32wrapping_mul + push.255 + swap.1 + u32shl + u32not + swap.1 + u32and + movup.3 + movup.3 + push.8 + u32wrapping_mul + u32shl + u32or + swap.1 + mem_store + end +end + +proc.miden_base_sys::bindings::account::incr_nonce + trace.240 + nop + exec.::miden:base/authentication-component@1.0.0::auth_component_no_auth::miden::account::incr_nonce + trace.252 + nop +end + +proc.miden::account::get_initial_commitment + trace.240 + nop + exec.::miden::account::get_initial_commitment + trace.252 + nop + movup.4 + dup.0 + movup.2 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.4 + dup.1 + swap.1 + add + u32assert + movup.2 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.8 + dup.1 + swap.1 + add + u32assert + movup.2 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.12 + add + u32assert + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop +end + +proc.miden::account::compute_current_commitment + trace.240 + nop + exec.::miden::account::compute_current_commitment + trace.252 + nop + movup.4 + dup.0 + movup.2 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.4 + dup.1 + swap.1 + add + u32assert + movup.2 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.8 + dup.1 + swap.1 + add + u32assert + movup.2 + swap.1 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.12 + add + u32assert + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop +end + +proc.miden::account::incr_nonce + trace.240 + nop + exec.::miden::account::incr_nonce + trace.252 + nop +end + +proc.miden_stdlib_sys::intrinsics::word::Word::reverse + push.1114144 + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_sw + trace.252 + nop + push.16 + u32wrapping_sub + push.8 + dup.3 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + push.8 + dup.3 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + movup.2 + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + dup.2 + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + push.12 + dup.1 + swap.1 + u32wrapping_add + push.0 + movup.2 + swap.1 + push.1 + while.true + push.0 + push.8 + dup.2 + swap.1 + eq + neq + dup.0 + if.true + swap.3 + swap.1 + drop + drop + push.3735929054 + dup.0 + else + dup.2 + dup.2 + u32wrapping_add + dup.0 + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_felt + trace.252 + nop + dup.5 + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_sw + trace.252 + nop + movup.2 + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_sw + trace.252 + nop + dup.4 + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_felt + trace.252 + nop + push.4294967292 + movup.4 + swap.1 + u32wrapping_add + push.4 + movup.3 + swap.1 + u32wrapping_add + movup.2 + swap.3 + movdn.2 + end + push.3735929054 + dup.4 + dup.6 + swap.2 + swap.1 + cdrop + push.3735929054 + dup.5 + dup.5 + swap.2 + swap.1 + cdrop + push.1 + push.0 + movup.7 + cdrop + push.1 + u32and + swap.1 + swap.2 + swap.4 + swap.3 + swap.1 + if.true + movup.4 + drop + movup.4 + drop + push.1 + else + push.0 + end + end + drop + drop + drop + drop + push.8 + dup.1 + add + u32assert + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + push.8 + dup.4 + add + u32assert + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop + push.4 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::load_dw + trace.252 + nop + movup.2 + push.8 + dup.1 + swap.1 + u32mod + u32assert + assertz + u32divmod.4 + swap.1 + trace.240 + nop + exec.::intrinsics::mem::store_dw + trace.252 + nop +end + +proc.intrinsics::felt::eq + eq +end + diff --git a/tests/integration/expected/examples/auth_component_no_auth.wat b/tests/integration/expected/examples/auth_component_no_auth.wat new file mode 100644 index 000000000..0f994f292 --- /dev/null +++ b/tests/integration/expected/examples/auth_component_no_auth.wat @@ -0,0 +1,237 @@ +(component + (type (;0;) + (instance + (type (;0;) (record (field "inner" f32))) + (export (;1;) "felt" (type (eq 0))) + (type (;2;) (tuple 1 1 1 1)) + (type (;3;) (record (field "inner" 2))) + (export (;4;) "word" (type (eq 3))) + ) + ) + (import "miden:base/core-types@1.0.0" (instance (;0;) (type 0))) + (core module (;0;) + (type (;0;) (func)) + (type (;1;) (func (param f32 f32 f32 f32))) + (type (;2;) (func (result f32))) + (type (;3;) (func (param i32))) + (type (;4;) (func (param i32 i32))) + (type (;5;) (func (param f32 f32) (result i32))) + (table (;0;) 2 2 funcref) + (memory (;0;) 17) + (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) + (global $GOT.data.internal.__memory_base (;1;) i32 i32.const 0) + (export "memory" (memory 0)) + (export "miden:base/authentication-component@1.0.0#auth-procedure" (func $miden:base/authentication-component@1.0.0#auth-procedure)) + (elem (;0;) (i32.const 1) func $auth_component_no_auth::bindings::__link_custom_section_describing_imports) + (func $__wasm_call_ctors (;0;) (type 0)) + (func $auth_component_no_auth::bindings::__link_custom_section_describing_imports (;1;) (type 0)) + (func $miden:base/authentication-component@1.0.0#auth-procedure (;2;) (type 1) (param f32 f32 f32 f32) + (local i32) + global.get $__stack_pointer + i32.const 64 + i32.sub + local.tee 4 + global.set $__stack_pointer + call $wit_bindgen_rt::run_ctors_once + local.get 4 + i32.const 32 + i32.add + call $miden::account::get_initial_commitment + local.get 4 + local.get 4 + i64.load offset=40 + i64.store offset=56 + local.get 4 + local.get 4 + i64.load offset=32 + i64.store offset=48 + local.get 4 + local.get 4 + i32.const 48 + i32.add + call $miden_stdlib_sys::intrinsics::word::Word::reverse + local.get 4 + i32.const 32 + i32.add + call $miden::account::compute_current_commitment + local.get 4 + local.get 4 + i64.load offset=40 + i64.store offset=56 + local.get 4 + local.get 4 + i64.load offset=32 + i64.store offset=48 + local.get 4 + i32.const 16 + i32.add + local.get 4 + i32.const 48 + i32.add + call $miden_stdlib_sys::intrinsics::word::Word::reverse + block ;; label = @1 + block ;; label = @2 + local.get 4 + f32.load offset=16 + local.get 4 + f32.load + call $intrinsics::felt::eq + i32.const 1 + i32.ne + br_if 0 (;@2;) + local.get 4 + f32.load offset=20 + local.get 4 + f32.load offset=4 + call $intrinsics::felt::eq + i32.const 1 + i32.ne + br_if 0 (;@2;) + local.get 4 + f32.load offset=24 + local.get 4 + f32.load offset=8 + call $intrinsics::felt::eq + i32.const 1 + i32.ne + br_if 0 (;@2;) + local.get 4 + f32.load offset=28 + local.get 4 + f32.load offset=12 + call $intrinsics::felt::eq + i32.const 1 + i32.eq + br_if 1 (;@1;) + end + call $miden_base_sys::bindings::account::incr_nonce + drop + end + local.get 4 + i32.const 64 + i32.add + global.set $__stack_pointer + ) + (func $wit_bindgen_rt::run_ctors_once (;3;) (type 0) + (local i32) + block ;; label = @1 + global.get $GOT.data.internal.__memory_base + i32.const 1048584 + i32.add + i32.load8_u + br_if 0 (;@1;) + global.get $GOT.data.internal.__memory_base + local.set 0 + call $__wasm_call_ctors + local.get 0 + i32.const 1048584 + i32.add + i32.const 1 + i32.store8 + end + ) + (func $miden_base_sys::bindings::account::incr_nonce (;4;) (type 2) (result f32) + call $miden::account::incr_nonce + ) + (func $miden::account::get_initial_commitment (;5;) (type 3) (param i32) + unreachable + ) + (func $miden::account::compute_current_commitment (;6;) (type 3) (param i32) + unreachable + ) + (func $miden::account::incr_nonce (;7;) (type 2) (result f32) + unreachable + ) + (func $miden_stdlib_sys::intrinsics::word::Word::reverse (;8;) (type 4) (param i32 i32) + (local i32 i32 i32 f32) + global.get $__stack_pointer + i32.const 16 + i32.sub + local.tee 2 + local.get 1 + i64.load offset=8 + i64.store offset=8 align=4 + local.get 2 + local.get 1 + i64.load + i64.store align=4 + local.get 2 + i32.const 12 + i32.add + local.set 3 + i32.const 0 + local.set 1 + block ;; label = @1 + loop ;; label = @2 + local.get 1 + i32.const 8 + i32.eq + br_if 1 (;@1;) + local.get 2 + local.get 1 + i32.add + local.tee 4 + f32.load + local.set 5 + local.get 4 + local.get 3 + i32.load + i32.store + local.get 3 + local.get 5 + f32.store + local.get 1 + i32.const 4 + i32.add + local.set 1 + local.get 3 + i32.const -4 + i32.add + local.set 3 + br 0 (;@2;) + end + end + local.get 0 + local.get 2 + i64.load offset=8 align=4 + i64.store offset=8 + local.get 0 + local.get 2 + i64.load align=4 + i64.store + ) + (func $intrinsics::felt::eq (;9;) (type 5) (param f32 f32) (result i32) + unreachable + ) + (data $.data (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00") + ) + (alias export 0 "word" (type (;1;))) + (core instance (;0;) (instantiate 0)) + (alias core export 0 "memory" (core memory (;0;))) + (type (;2;) (func (param "arg" 1))) + (alias core export 0 "miden:base/authentication-component@1.0.0#auth-procedure" (core func (;0;))) + (func (;0;) (type 2) (canon lift (core func 0))) + (alias export 0 "felt" (type (;3;))) + (alias export 0 "word" (type (;4;))) + (component (;0;) + (type (;0;) (record (field "inner" f32))) + (import "import-type-felt" (type (;1;) (eq 0))) + (type (;2;) (tuple 1 1 1 1)) + (type (;3;) (record (field "inner" 2))) + (import "import-type-word" (type (;4;) (eq 3))) + (import "import-type-word0" (type (;5;) (eq 4))) + (type (;6;) (func (param "arg" 5))) + (import "import-func-auth-procedure" (func (;0;) (type 6))) + (export (;7;) "word" (type 4)) + (type (;8;) (func (param "arg" 7))) + (export (;1;) "auth-procedure" (func 0) (func (type 8))) + ) + (instance (;1;) (instantiate 0 + (with "import-func-auth-procedure" (func 0)) + (with "import-type-felt" (type 3)) + (with "import-type-word" (type 4)) + (with "import-type-word0" (type 1)) + ) + ) + (export (;2;) "miden:base/authentication-component@1.0.0" (instance 1)) +) diff --git a/tests/integration/expected/examples/basic_wallet.hir b/tests/integration/expected/examples/basic_wallet.hir index b99be9cbb..231e61df1 100644 --- a/tests/integration/expected/examples/basic_wallet.hir +++ b/tests/integration/expected/examples/basic_wallet.hir @@ -10,7 +10,7 @@ builtin.component miden:basic-wallet/basic-wallet@1.0.0 { builtin.ret ; }; - public builtin.function @miden:basic-wallet/basic-wallet@1.0.0#receive-asset(v0: felt, v1: felt, v2: felt, v3: felt) { + private builtin.function @miden:basic-wallet/basic-wallet@1.0.0#receive-asset(v0: felt, v1: felt, v2: felt, v3: felt) { ^block9(v0: felt, v1: felt, v2: felt, v3: felt): v5 = builtin.global_symbol @miden:basic-wallet/basic-wallet@1.0.0/basic_wallet/__stack_pointer : ptr v6 = hir.bitcast v5 : ptr; @@ -62,7 +62,7 @@ builtin.component miden:basic-wallet/basic-wallet@1.0.0 { builtin.ret ; }; - public builtin.function @miden:basic-wallet/basic-wallet@1.0.0#move-asset-to-note(v40: felt, v41: felt, v42: felt, v43: felt, v44: felt) { + private builtin.function @miden:basic-wallet/basic-wallet@1.0.0#move-asset-to-note(v40: felt, v41: felt, v42: felt, v43: felt, v44: felt) { ^block11(v40: felt, v41: felt, v42: felt, v43: felt, v44: felt): v46 = builtin.global_symbol @miden:basic-wallet/basic-wallet@1.0.0/basic_wallet/__stack_pointer : ptr v47 = hir.bitcast v46 : ptr; diff --git a/tests/integration/expected/examples/basic_wallet.masm b/tests/integration/expected/examples/basic_wallet.masm index 3d8c3d321..786fd13dc 100644 --- a/tests/integration/expected/examples/basic_wallet.masm +++ b/tests/integration/expected/examples/basic_wallet.masm @@ -20,7 +20,7 @@ export.move-asset-to-note exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -54,7 +54,7 @@ proc.basic_wallet::bindings::__link_custom_section_describing_imports nop end -export.miden:basic-wallet/basic-wallet@1.0.0#receive-asset +proc.miden:basic-wallet/basic-wallet@1.0.0#receive-asset push.1114144 u32divmod.4 swap.1 @@ -176,7 +176,7 @@ export.miden:basic-wallet/basic-wallet@1.0.0#receive-asset nop end -export.miden:basic-wallet/basic-wallet@1.0.0#move-asset-to-note +proc.miden:basic-wallet/basic-wallet@1.0.0#move-asset-to-note push.1114144 u32divmod.4 swap.1 diff --git a/tests/integration/expected/examples/basic_wallet_tx_script.hir b/tests/integration/expected/examples/basic_wallet_tx_script.hir index df5e86ce7..3b5ec0c22 100644 --- a/tests/integration/expected/examples/basic_wallet_tx_script.hir +++ b/tests/integration/expected/examples/basic_wallet_tx_script.hir @@ -131,7 +131,7 @@ builtin.component miden:base/transaction-script@1.0.0 { builtin.ret v70; }; - public builtin.function @miden:base/transaction-script@1.0.0#run(v89: felt, v90: felt, v91: felt, v92: felt) { + private builtin.function @miden:base/transaction-script@1.0.0#run(v89: felt, v90: felt, v91: felt, v92: felt) { ^block27(v89: felt, v90: felt, v91: felt, v92: felt): v97 = builtin.global_symbol @miden:base/transaction-script@1.0.0/basic_wallet_tx_script/__stack_pointer : ptr v98 = hir.bitcast v97 : ptr; diff --git a/tests/integration/expected/examples/basic_wallet_tx_script.masm b/tests/integration/expected/examples/basic_wallet_tx_script.masm index be7a77e72..b508110fb 100644 --- a/tests/integration/expected/examples/basic_wallet_tx_script.masm +++ b/tests/integration/expected/examples/basic_wallet_tx_script.masm @@ -10,7 +10,7 @@ export.run exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -279,7 +279,7 @@ proc.__rustc::__rust_alloc_zeroed end end -export.miden:base/transaction-script@1.0.0#run +proc.miden:base/transaction-script@1.0.0#run push.1114240 u32divmod.4 swap.1 diff --git a/tests/integration/expected/examples/counter.hir b/tests/integration/expected/examples/counter.hir index 19c8cd194..192da066a 100644 --- a/tests/integration/expected/examples/counter.hir +++ b/tests/integration/expected/examples/counter.hir @@ -94,7 +94,7 @@ builtin.component miden:counter-contract/counter@0.1.0 { builtin.ret ; }; - public builtin.function @miden:counter-contract/counter@0.1.0#get-count() -> felt { + private builtin.function @miden:counter-contract/counter@0.1.0#get-count() -> felt { ^block11: v71 = builtin.global_symbol @miden:counter-contract/counter@0.1.0/counter_contract/__stack_pointer : ptr v72 = hir.bitcast v71 : ptr; @@ -162,7 +162,7 @@ builtin.component miden:counter-contract/counter@0.1.0 { builtin.ret v116; }; - public builtin.function @miden:counter-contract/counter@0.1.0#increment-count() -> felt { + private builtin.function @miden:counter-contract/counter@0.1.0#increment-count() -> felt { ^block13: v124 = builtin.global_symbol @miden:counter-contract/counter@0.1.0/counter_contract/__stack_pointer : ptr v125 = hir.bitcast v124 : ptr; diff --git a/tests/integration/expected/examples/counter.masm b/tests/integration/expected/examples/counter.masm index 403e68bb5..cbd20d0c5 100644 --- a/tests/integration/expected/examples/counter.masm +++ b/tests/integration/expected/examples/counter.masm @@ -20,7 +20,7 @@ export.increment-count exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -246,7 +246,7 @@ proc.counter_contract::bindings::__link_custom_section_describing_imports nop end -export.miden:counter-contract/counter@0.1.0#get-count +proc.miden:counter-contract/counter@0.1.0#get-count push.1114144 u32divmod.4 swap.1 @@ -403,7 +403,7 @@ export.miden:counter-contract/counter@0.1.0#get-count nop end -export.miden:counter-contract/counter@0.1.0#increment-count +proc.miden:counter-contract/counter@0.1.0#increment-count push.1114144 u32divmod.4 swap.1 diff --git a/tests/integration/expected/examples/counter_note.hir b/tests/integration/expected/examples/counter_note.hir index 812a30312..4610e2684 100644 --- a/tests/integration/expected/examples/counter_note.hir +++ b/tests/integration/expected/examples/counter_note.hir @@ -22,7 +22,7 @@ builtin.component miden:base/note-script@1.0.0 { builtin.ret ; }; - public builtin.function @miden:base/note-script@1.0.0#run(v2: felt, v3: felt, v4: felt, v5: felt) { + private builtin.function @miden:base/note-script@1.0.0#run(v2: felt, v3: felt, v4: felt, v5: felt) { ^block14(v2: felt, v3: felt, v4: felt, v5: felt): hir.exec @miden:base/note-script@1.0.0/counter_note/wit_bindgen_rt::run_ctors_once() v7 = hir.exec @miden:base/note-script@1.0.0/counter_note/counter_note::bindings::miden::counter_contract::counter::get_count::wit_import0() : felt diff --git a/tests/integration/expected/examples/counter_note.masm b/tests/integration/expected/examples/counter_note.masm index 9d0563553..2b46fd3a9 100644 --- a/tests/integration/expected/examples/counter_note.masm +++ b/tests/integration/expected/examples/counter_note.masm @@ -10,7 +10,7 @@ export.run exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -60,7 +60,7 @@ proc.counter_note::bindings::__link_custom_section_describing_imports nop end -export.miden:base/note-script@1.0.0#run +proc.miden:base/note-script@1.0.0#run drop drop drop diff --git a/tests/integration/expected/examples/fib.masm b/tests/integration/expected/examples/fib.masm index ae5e105bd..41219b5c8 100644 --- a/tests/integration/expected/examples/fib.masm +++ b/tests/integration/expected/examples/fib.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/examples/p2id.hir b/tests/integration/expected/examples/p2id.hir index 9a3f6c6a8..dc18b6857 100644 --- a/tests/integration/expected/examples/p2id.hir +++ b/tests/integration/expected/examples/p2id.hir @@ -74,7 +74,7 @@ builtin.component miden:base/note-script@1.0.0 { builtin.ret v24; }; - public builtin.function @miden:base/note-script@1.0.0#run(v43: felt, v44: felt, v45: felt, v46: felt) { + private builtin.function @miden:base/note-script@1.0.0#run(v43: felt, v44: felt, v45: felt, v46: felt) { ^block21(v43: felt, v44: felt, v45: felt, v46: felt): v50 = builtin.global_symbol @miden:base/note-script@1.0.0/p2id/__stack_pointer : ptr v51 = hir.bitcast v50 : ptr; diff --git a/tests/integration/expected/examples/p2id.masm b/tests/integration/expected/examples/p2id.masm index 2bf8dbda6..e250536a7 100644 --- a/tests/integration/expected/examples/p2id.masm +++ b/tests/integration/expected/examples/p2id.masm @@ -10,7 +10,7 @@ export.run exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -164,7 +164,7 @@ proc.__rustc::__rust_alloc_zeroed end end -export.miden:base/note-script@1.0.0#run +proc.miden:base/note-script@1.0.0#run drop drop drop diff --git a/tests/integration/expected/examples/storage_example.hir b/tests/integration/expected/examples/storage_example.hir index ac34666c4..d16b3a0cd 100644 --- a/tests/integration/expected/examples/storage_example.hir +++ b/tests/integration/expected/examples/storage_example.hir @@ -10,7 +10,7 @@ builtin.component miden:storage-example/foo@1.0.0 { builtin.ret ; }; - public builtin.function @miden:storage-example/foo@1.0.0#set-asset-qty(v0: felt, v1: felt, v2: felt, v3: felt, v4: felt, v5: felt, v6: felt, v7: felt, v8: felt) { + private builtin.function @miden:storage-example/foo@1.0.0#set-asset-qty(v0: felt, v1: felt, v2: felt, v3: felt, v4: felt, v5: felt, v6: felt, v7: felt, v8: felt) { ^block9(v0: felt, v1: felt, v2: felt, v3: felt, v4: felt, v5: felt, v6: felt, v7: felt, v8: felt): v11 = builtin.global_symbol @miden:storage-example/foo@1.0.0/storage_example/__stack_pointer : ptr v12 = hir.bitcast v11 : ptr; @@ -267,7 +267,7 @@ builtin.component miden:storage-example/foo@1.0.0 { builtin.ret ; }; - public builtin.function @miden:storage-example/foo@1.0.0#get-asset-qty(v201: felt, v202: felt, v203: felt, v204: felt) -> felt { + private builtin.function @miden:storage-example/foo@1.0.0#get-asset-qty(v201: felt, v202: felt, v203: felt, v204: felt) -> felt { ^block16(v201: felt, v202: felt, v203: felt, v204: felt): v207 = builtin.global_symbol @miden:storage-example/foo@1.0.0/storage_example/__stack_pointer : ptr v208 = hir.bitcast v207 : ptr; diff --git a/tests/integration/expected/examples/storage_example.masm b/tests/integration/expected/examples/storage_example.masm index 5e59eaf24..1fd5bc67b 100644 --- a/tests/integration/expected/examples/storage_example.masm +++ b/tests/integration/expected/examples/storage_example.masm @@ -20,7 +20,7 @@ export.get-asset-qty exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -54,7 +54,7 @@ proc.storage_example::bindings::__link_custom_section_describing_imports nop end -export.miden:storage-example/foo@1.0.0#set-asset-qty +proc.miden:storage-example/foo@1.0.0#set-asset-qty push.1114144 u32divmod.4 swap.1 @@ -598,7 +598,7 @@ export.miden:storage-example/foo@1.0.0#set-asset-qty nop end -export.miden:storage-example/foo@1.0.0#get-asset-qty +proc.miden:storage-example/foo@1.0.0#get-asset-qty push.1114144 u32divmod.4 swap.1 diff --git a/tests/integration/expected/func_arg_same.masm b/tests/integration/expected/func_arg_same.masm index 7ffedcb9c..a52d0bf49 100644 --- a/tests/integration/expected/func_arg_same.masm +++ b/tests/integration/expected/func_arg_same.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_felt.masm b/tests/integration/expected/ge_felt.masm index 110d2dfbd..d5462380b 100644 --- a/tests/integration/expected/ge_felt.masm +++ b/tests/integration/expected/ge_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_i32.masm b/tests/integration/expected/ge_i32.masm index b1f640daa..6f6e80941 100644 --- a/tests/integration/expected/ge_i32.masm +++ b/tests/integration/expected/ge_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_i64.masm b/tests/integration/expected/ge_i64.masm index b9ef0e26f..1f66cf70c 100644 --- a/tests/integration/expected/ge_i64.masm +++ b/tests/integration/expected/ge_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_u16.masm b/tests/integration/expected/ge_u16.masm index ad7e694dc..9256b0c94 100644 --- a/tests/integration/expected/ge_u16.masm +++ b/tests/integration/expected/ge_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_u32.masm b/tests/integration/expected/ge_u32.masm index 14d8cff05..e740e594f 100644 --- a/tests/integration/expected/ge_u32.masm +++ b/tests/integration/expected/ge_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_u64.masm b/tests/integration/expected/ge_u64.masm index 8668f2425..cd643deb3 100644 --- a/tests/integration/expected/ge_u64.masm +++ b/tests/integration/expected/ge_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/ge_u8.masm b/tests/integration/expected/ge_u8.masm index 808ae7c1e..983f1ba1c 100644 --- a/tests/integration/expected/ge_u8.masm +++ b/tests/integration/expected/ge_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_felt.masm b/tests/integration/expected/gt_felt.masm index eec6b0c47..2c30c07b2 100644 --- a/tests/integration/expected/gt_felt.masm +++ b/tests/integration/expected/gt_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_i32.masm b/tests/integration/expected/gt_i32.masm index aaebb5238..520c7b25d 100644 --- a/tests/integration/expected/gt_i32.masm +++ b/tests/integration/expected/gt_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_i64.masm b/tests/integration/expected/gt_i64.masm index d76fe500e..8ad8e748d 100644 --- a/tests/integration/expected/gt_i64.masm +++ b/tests/integration/expected/gt_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_u16.masm b/tests/integration/expected/gt_u16.masm index aff96bbe1..599f813ce 100644 --- a/tests/integration/expected/gt_u16.masm +++ b/tests/integration/expected/gt_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_u32.masm b/tests/integration/expected/gt_u32.masm index 4640f3368..5bd2610b2 100644 --- a/tests/integration/expected/gt_u32.masm +++ b/tests/integration/expected/gt_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_u64.masm b/tests/integration/expected/gt_u64.masm index c6d9f4379..10bc982b9 100644 --- a/tests/integration/expected/gt_u64.masm +++ b/tests/integration/expected/gt_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/gt_u8.masm b/tests/integration/expected/gt_u8.masm index 81f4c2a8b..af8700fb3 100644 --- a/tests/integration/expected/gt_u8.masm +++ b/tests/integration/expected/gt_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/hash_elements.masm b/tests/integration/expected/hash_elements.masm index c56d947c7..d70ff35ed 100644 --- a/tests/integration/expected/hash_elements.masm +++ b/tests/integration/expected/hash_elements.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/hmerge.masm b/tests/integration/expected/hmerge.masm index 9bb34ae95..06b3f734c 100644 --- a/tests/integration/expected/hmerge.masm +++ b/tests/integration/expected/hmerge.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/is_prime.masm b/tests/integration/expected/is_prime.masm index 484576bc7..e065ca7fd 100644 --- a/tests/integration/expected/is_prime.masm +++ b/tests/integration/expected/is_prime.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_felt.masm b/tests/integration/expected/le_felt.masm index bff3ed60e..b03d5ebca 100644 --- a/tests/integration/expected/le_felt.masm +++ b/tests/integration/expected/le_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_i32.masm b/tests/integration/expected/le_i32.masm index 1c37bd655..51dfb239c 100644 --- a/tests/integration/expected/le_i32.masm +++ b/tests/integration/expected/le_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_i64.masm b/tests/integration/expected/le_i64.masm index 08f516832..339b0856c 100644 --- a/tests/integration/expected/le_i64.masm +++ b/tests/integration/expected/le_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_u16.masm b/tests/integration/expected/le_u16.masm index ee0073226..e26c33f88 100644 --- a/tests/integration/expected/le_u16.masm +++ b/tests/integration/expected/le_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_u32.masm b/tests/integration/expected/le_u32.masm index 219ef58e0..08ab3e34b 100644 --- a/tests/integration/expected/le_u32.masm +++ b/tests/integration/expected/le_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_u64.masm b/tests/integration/expected/le_u64.masm index a087e0424..355cfea5d 100644 --- a/tests/integration/expected/le_u64.masm +++ b/tests/integration/expected/le_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/le_u8.masm b/tests/integration/expected/le_u8.masm index f0ac8f1ff..86dbd9d92 100644 --- a/tests/integration/expected/le_u8.masm +++ b/tests/integration/expected/le_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_felt.masm b/tests/integration/expected/lt_felt.masm index 37da8a13c..8c60af6d6 100644 --- a/tests/integration/expected/lt_felt.masm +++ b/tests/integration/expected/lt_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_i32.masm b/tests/integration/expected/lt_i32.masm index 2a51d2865..2bdc787b1 100644 --- a/tests/integration/expected/lt_i32.masm +++ b/tests/integration/expected/lt_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_i64.masm b/tests/integration/expected/lt_i64.masm index 3537f9a9c..3dc3a1649 100644 --- a/tests/integration/expected/lt_i64.masm +++ b/tests/integration/expected/lt_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_u16.masm b/tests/integration/expected/lt_u16.masm index 306ef46bb..d8c285783 100644 --- a/tests/integration/expected/lt_u16.masm +++ b/tests/integration/expected/lt_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_u32.masm b/tests/integration/expected/lt_u32.masm index 3b388291f..0540350e6 100644 --- a/tests/integration/expected/lt_u32.masm +++ b/tests/integration/expected/lt_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_u64.masm b/tests/integration/expected/lt_u64.masm index 2ae0f652b..9be51afcf 100644 --- a/tests/integration/expected/lt_u64.masm +++ b/tests/integration/expected/lt_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/lt_u8.masm b/tests/integration/expected/lt_u8.masm index 0650873e7..3e225630b 100644 --- a/tests/integration/expected/lt_u8.masm +++ b/tests/integration/expected/lt_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_felt.masm b/tests/integration/expected/mul_felt.masm index 9b7c1a24e..81c2b1ae3 100644 --- a/tests/integration/expected/mul_felt.masm +++ b/tests/integration/expected/mul_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_i128.masm b/tests/integration/expected/mul_i128.masm index 7672acdd3..d43765115 100644 --- a/tests/integration/expected/mul_i128.masm +++ b/tests/integration/expected/mul_i128.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_i32.masm b/tests/integration/expected/mul_i32.masm index 71cbbbe1f..1bcbdf0fd 100644 --- a/tests/integration/expected/mul_i32.masm +++ b/tests/integration/expected/mul_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_i64.masm b/tests/integration/expected/mul_i64.masm index 23ba6b120..eabbd9360 100644 --- a/tests/integration/expected/mul_i64.masm +++ b/tests/integration/expected/mul_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_u128.masm b/tests/integration/expected/mul_u128.masm index f19dba961..4b6a103a0 100644 --- a/tests/integration/expected/mul_u128.masm +++ b/tests/integration/expected/mul_u128.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_u16.masm b/tests/integration/expected/mul_u16.masm index b5bc7b4f6..0a4497cfe 100644 --- a/tests/integration/expected/mul_u16.masm +++ b/tests/integration/expected/mul_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_u32.masm b/tests/integration/expected/mul_u32.masm index 9b77b95d4..292731b08 100644 --- a/tests/integration/expected/mul_u32.masm +++ b/tests/integration/expected/mul_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_u64.masm b/tests/integration/expected/mul_u64.masm index efc797201..d627223a6 100644 --- a/tests/integration/expected/mul_u64.masm +++ b/tests/integration/expected/mul_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/mul_u8.masm b/tests/integration/expected/mul_u8.masm index 02270b483..0b859c974 100644 --- a/tests/integration/expected/mul_u8.masm +++ b/tests/integration/expected/mul_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/neg_felt.masm b/tests/integration/expected/neg_felt.masm index 7654ada3f..ea8d3b6b3 100644 --- a/tests/integration/expected/neg_felt.masm +++ b/tests/integration/expected/neg_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/neg_i16.masm b/tests/integration/expected/neg_i16.masm index 0a70c964e..6f760a5e2 100644 --- a/tests/integration/expected/neg_i16.masm +++ b/tests/integration/expected/neg_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/neg_i32.masm b/tests/integration/expected/neg_i32.masm index e7b9b368f..ad558543c 100644 --- a/tests/integration/expected/neg_i32.masm +++ b/tests/integration/expected/neg_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/neg_i64.masm b/tests/integration/expected/neg_i64.masm index 60a2c073f..a28f394b0 100644 --- a/tests/integration/expected/neg_i64.masm +++ b/tests/integration/expected/neg_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/neg_i8.masm b/tests/integration/expected/neg_i8.masm index 03aff361f..906193217 100644 --- a/tests/integration/expected/neg_i8.masm +++ b/tests/integration/expected/neg_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/or_bool.masm b/tests/integration/expected/or_bool.masm index fbbca7d8a..e42849ab6 100644 --- a/tests/integration/expected/or_bool.masm +++ b/tests/integration/expected/or_bool.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/rust_sdk/cross_ctx_account.hir b/tests/integration/expected/rust_sdk/cross_ctx_account.hir index 8f8cdf762..a3829798d 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_account.hir +++ b/tests/integration/expected/rust_sdk/cross_ctx_account.hir @@ -10,7 +10,7 @@ builtin.component miden:cross-ctx-account/foo@1.0.0 { builtin.ret ; }; - public builtin.function @miden:cross-ctx-account/foo@1.0.0#process-felt(v0: felt) -> felt { + private builtin.function @miden:cross-ctx-account/foo@1.0.0#process-felt(v0: felt) -> felt { ^block9(v0: felt): v3 = builtin.global_symbol @miden:cross-ctx-account/foo@1.0.0/cross_ctx_account/GOT.data.internal.__memory_base : ptr v4 = hir.bitcast v3 : ptr; diff --git a/tests/integration/expected/rust_sdk/cross_ctx_account.masm b/tests/integration/expected/rust_sdk/cross_ctx_account.masm index e2754779f..2ac827340 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_account.masm +++ b/tests/integration/expected/rust_sdk/cross_ctx_account.masm @@ -10,7 +10,7 @@ export.process-felt exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -44,7 +44,7 @@ proc.cross_ctx_account::bindings::__link_custom_section_describing_imports nop end -export.miden:cross-ctx-account/foo@1.0.0#process-felt +proc.miden:cross-ctx-account/foo@1.0.0#process-felt push.1114148 u32divmod.4 swap.1 diff --git a/tests/integration/expected/rust_sdk/cross_ctx_account_word.hir b/tests/integration/expected/rust_sdk/cross_ctx_account_word.hir index a9fdcd947..77e0a9776 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_account_word.hir +++ b/tests/integration/expected/rust_sdk/cross_ctx_account_word.hir @@ -10,7 +10,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret ; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-word(v0: felt, v1: felt, v2: felt, v3: felt) -> i32 { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-word(v0: felt, v1: felt, v2: felt, v3: felt) -> i32 { ^block9(v0: felt, v1: felt, v2: felt, v3: felt): v6 = builtin.global_symbol @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/GOT.data.internal.__memory_base : ptr v7 = hir.bitcast v6 : ptr; @@ -63,7 +63,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret v19; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-another-word(v45: felt, v46: felt, v47: felt, v48: felt) -> i32 { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-another-word(v45: felt, v46: felt, v47: felt, v48: felt) -> i32 { ^block11(v45: felt, v46: felt, v47: felt, v48: felt): v51 = builtin.global_symbol @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/GOT.data.internal.__memory_base : ptr v52 = hir.bitcast v51 : ptr; @@ -116,7 +116,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret v64; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-felt(v90: felt) -> felt { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-felt(v90: felt) -> felt { ^block13(v90: felt): hir.exec @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/wit_bindgen_rt::run_ctors_once() v92 = arith.constant 3 : i32; @@ -125,7 +125,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret v94; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-pair(v95: felt, v96: felt) -> i32 { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-pair(v95: felt, v96: felt) -> i32 { ^block15(v95: felt, v96: felt): v99 = builtin.global_symbol @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/GOT.data.internal.__memory_base : ptr v100 = hir.bitcast v99 : ptr; @@ -156,7 +156,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret v106; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-triple(v120: felt, v121: felt, v122: felt) -> i32 { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-triple(v120: felt, v121: felt, v122: felt) -> i32 { ^block17(v120: felt, v121: felt, v122: felt): v125 = builtin.global_symbol @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/GOT.data.internal.__memory_base : ptr v126 = hir.bitcast v125 : ptr; @@ -198,7 +198,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret v135; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-mixed(v155: i64, v156: felt, v157: i32, v158: felt, v159: i32, v160: i32, v161: i32) -> i32 { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-mixed(v155: i64, v156: felt, v157: i32, v158: felt, v159: i32, v160: i32, v161: i32) -> i32 { ^block19(v155: i64, v156: felt, v157: i32, v158: felt, v159: i32, v160: i32, v161: i32): v164 = builtin.global_symbol @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/GOT.data.internal.__memory_base : ptr v165 = hir.bitcast v164 : ptr; @@ -283,7 +283,7 @@ builtin.component miden:cross-ctx-account-word/foo@1.0.0 { builtin.ret v174; }; - public builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-nested(v231: felt, v232: felt, v233: felt) -> i32 { + private builtin.function @miden:cross-ctx-account-word/foo@1.0.0#process-nested(v231: felt, v232: felt, v233: felt) -> i32 { ^block21(v231: felt, v232: felt, v233: felt): v236 = builtin.global_symbol @miden:cross-ctx-account-word/foo@1.0.0/cross_ctx_account_word/GOT.data.internal.__memory_base : ptr v237 = hir.bitcast v236 : ptr; diff --git a/tests/integration/expected/rust_sdk/cross_ctx_account_word.masm b/tests/integration/expected/rust_sdk/cross_ctx_account_word.masm index f81ef2b53..f211501da 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_account_word.masm +++ b/tests/integration/expected/rust_sdk/cross_ctx_account_word.masm @@ -401,7 +401,7 @@ export.process-nested exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -435,7 +435,7 @@ proc.cross_ctx_account_word::bindings::__link_custom_section_describing_imports nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-word +proc.miden:cross-ctx-account-word/foo@1.0.0#process-word push.1114148 u32divmod.4 swap.1 @@ -574,7 +574,7 @@ export.miden:cross-ctx-account-word/foo@1.0.0#process-word nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-another-word +proc.miden:cross-ctx-account-word/foo@1.0.0#process-another-word push.1114148 u32divmod.4 swap.1 @@ -713,7 +713,7 @@ export.miden:cross-ctx-account-word/foo@1.0.0#process-another-word nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-felt +proc.miden:cross-ctx-account-word/foo@1.0.0#process-felt trace.240 nop exec.::miden:cross-ctx-account-word/foo@1.0.0::cross_ctx_account_word::wit_bindgen_rt::run_ctors_once @@ -733,7 +733,7 @@ export.miden:cross-ctx-account-word/foo@1.0.0#process-felt nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-pair +proc.miden:cross-ctx-account-word/foo@1.0.0#process-pair push.1114148 u32divmod.4 swap.1 @@ -810,7 +810,7 @@ export.miden:cross-ctx-account-word/foo@1.0.0#process-pair nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-triple +proc.miden:cross-ctx-account-word/foo@1.0.0#process-triple push.1114148 u32divmod.4 swap.1 @@ -918,7 +918,7 @@ export.miden:cross-ctx-account-word/foo@1.0.0#process-triple nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-mixed +proc.miden:cross-ctx-account-word/foo@1.0.0#process-mixed push.1114148 u32divmod.4 swap.1 @@ -1150,7 +1150,7 @@ export.miden:cross-ctx-account-word/foo@1.0.0#process-mixed nop end -export.miden:cross-ctx-account-word/foo@1.0.0#process-nested +proc.miden:cross-ctx-account-word/foo@1.0.0#process-nested push.1114148 u32divmod.4 swap.1 diff --git a/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.hir b/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.hir index a57e0a26d..509590f9d 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.hir +++ b/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.hir @@ -10,7 +10,7 @@ builtin.component miden:cross-ctx-account-word-arg/foo@1.0.0 { builtin.ret ; }; - public builtin.function @miden:cross-ctx-account-word-arg/foo@1.0.0#process-word(v0: felt, v1: felt, v2: felt, v3: felt, v4: felt, v5: felt, v6: felt, v7: felt, v8: felt, v9: felt, v10: felt, v11: felt, v12: felt, v13: felt, v14: felt, v15: felt) -> felt { + private builtin.function @miden:cross-ctx-account-word-arg/foo@1.0.0#process-word(v0: felt, v1: felt, v2: felt, v3: felt, v4: felt, v5: felt, v6: felt, v7: felt, v8: felt, v9: felt, v10: felt, v11: felt, v12: felt, v13: felt, v14: felt, v15: felt) -> felt { ^block9(v0: felt, v1: felt, v2: felt, v3: felt, v4: felt, v5: felt, v6: felt, v7: felt, v8: felt, v9: felt, v10: felt, v11: felt, v12: felt, v13: felt, v14: felt, v15: felt): hir.exec @miden:cross-ctx-account-word-arg/foo@1.0.0/cross_ctx_account_word_arg/wit_bindgen_rt::run_ctors_once() hir.store_local v15 #[local = lv0]; diff --git a/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.masm b/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.masm index 03443e74d..3c7d2e929 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.masm +++ b/tests/integration/expected/rust_sdk/cross_ctx_account_word_arg.masm @@ -10,7 +10,7 @@ export.process-word exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -44,7 +44,7 @@ proc.cross_ctx_account_word_arg::bindings::__link_custom_section_describing_impo nop end -export.miden:cross-ctx-account-word-arg/foo@1.0.0#process-word.1 +proc.miden:cross-ctx-account-word-arg/foo@1.0.0#process-word.1 trace.240 nop exec.::miden:cross-ctx-account-word-arg/foo@1.0.0::cross_ctx_account_word_arg::wit_bindgen_rt::run_ctors_once diff --git a/tests/integration/expected/rust_sdk/cross_ctx_note.hir b/tests/integration/expected/rust_sdk/cross_ctx_note.hir index 10d5ce8af..397fca5ea 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_note.hir +++ b/tests/integration/expected/rust_sdk/cross_ctx_note.hir @@ -16,7 +16,7 @@ builtin.component miden:base/note-script@1.0.0 { builtin.ret ; }; - public builtin.function @miden:base/note-script@1.0.0#run(v2: felt, v3: felt, v4: felt, v5: felt) { + private builtin.function @miden:base/note-script@1.0.0#run(v2: felt, v3: felt, v4: felt, v5: felt) { ^block12(v2: felt, v3: felt, v4: felt, v5: felt): v8 = builtin.global_symbol @miden:base/note-script@1.0.0/cross_ctx_note/GOT.data.internal.__memory_base : ptr v9 = hir.bitcast v8 : ptr; diff --git a/tests/integration/expected/rust_sdk/cross_ctx_note.masm b/tests/integration/expected/rust_sdk/cross_ctx_note.masm index 3bd00b4af..2e7936d75 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_note.masm +++ b/tests/integration/expected/rust_sdk/cross_ctx_note.masm @@ -10,7 +10,7 @@ export.run exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -52,7 +52,7 @@ proc.cross_ctx_note::bindings::__link_custom_section_describing_imports nop end -export.miden:base/note-script@1.0.0#run +proc.miden:base/note-script@1.0.0#run drop drop drop diff --git a/tests/integration/expected/rust_sdk/cross_ctx_note_word.hir b/tests/integration/expected/rust_sdk/cross_ctx_note_word.hir index c5701fa93..b0d7cf0bd 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_note_word.hir +++ b/tests/integration/expected/rust_sdk/cross_ctx_note_word.hir @@ -191,7 +191,7 @@ builtin.component miden:base/note-script@1.0.0 { builtin.ret ; }; - public builtin.function @miden:base/note-script@1.0.0#run(v170: felt, v171: felt, v172: felt, v173: felt) { + private builtin.function @miden:base/note-script@1.0.0#run(v170: felt, v171: felt, v172: felt, v173: felt) { ^block24(v170: felt, v171: felt, v172: felt, v173: felt): v177 = builtin.global_symbol @miden:base/note-script@1.0.0/cross_ctx_note_word/__stack_pointer : ptr v178 = hir.bitcast v177 : ptr; diff --git a/tests/integration/expected/rust_sdk/cross_ctx_note_word.masm b/tests/integration/expected/rust_sdk/cross_ctx_note_word.masm index afee39748..1977a05d5 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_note_word.masm +++ b/tests/integration/expected/rust_sdk/cross_ctx_note_word.masm @@ -10,7 +10,7 @@ export.run exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -457,7 +457,7 @@ proc.cross_ctx_note_word::bindings::__link_custom_section_describing_imports nop end -export.miden:base/note-script@1.0.0#run +proc.miden:base/note-script@1.0.0#run drop drop drop diff --git a/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.hir b/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.hir index ff63605b4..1770a675e 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.hir +++ b/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.hir @@ -16,7 +16,7 @@ builtin.component miden:base/note-script@1.0.0 { builtin.ret ; }; - public builtin.function @miden:base/note-script@1.0.0#run(v17: felt, v18: felt, v19: felt, v20: felt) { + private builtin.function @miden:base/note-script@1.0.0#run(v17: felt, v18: felt, v19: felt, v20: felt) { ^block12(v17: felt, v18: felt, v19: felt, v20: felt): hir.exec @miden:base/note-script@1.0.0/cross_ctx_note_word_arg/wit_bindgen_rt::run_ctors_once() v21 = arith.constant 1 : i32; diff --git a/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.masm b/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.masm index 5397ee635..83be937d2 100644 --- a/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.masm +++ b/tests/integration/expected/rust_sdk/cross_ctx_note_word_arg.masm @@ -10,7 +10,7 @@ export.run exec.::std::sys::truncate_stack end -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init @@ -52,7 +52,7 @@ proc.cross_ctx_note_word_arg::bindings::__link_custom_section_describing_imports nop end -export.miden:base/note-script@1.0.0#run +proc.miden:base/note-script@1.0.0#run drop drop drop diff --git a/tests/integration/expected/shl_i16.masm b/tests/integration/expected/shl_i16.masm index d3e236fda..741038a7f 100644 --- a/tests/integration/expected/shl_i16.masm +++ b/tests/integration/expected/shl_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_i32.masm b/tests/integration/expected/shl_i32.masm index 3399d26ed..d123fe5c4 100644 --- a/tests/integration/expected/shl_i32.masm +++ b/tests/integration/expected/shl_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_i64.masm b/tests/integration/expected/shl_i64.masm index 6a32ca98a..e6161e350 100644 --- a/tests/integration/expected/shl_i64.masm +++ b/tests/integration/expected/shl_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_i8.masm b/tests/integration/expected/shl_i8.masm index a1f8a8103..29bd08821 100644 --- a/tests/integration/expected/shl_i8.masm +++ b/tests/integration/expected/shl_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_u16.masm b/tests/integration/expected/shl_u16.masm index 94b8354d1..3ee801585 100644 --- a/tests/integration/expected/shl_u16.masm +++ b/tests/integration/expected/shl_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_u32.masm b/tests/integration/expected/shl_u32.masm index 8743fbe3e..2a868cf42 100644 --- a/tests/integration/expected/shl_u32.masm +++ b/tests/integration/expected/shl_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_u64.masm b/tests/integration/expected/shl_u64.masm index 546628f57..20c62fc2b 100644 --- a/tests/integration/expected/shl_u64.masm +++ b/tests/integration/expected/shl_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shl_u8.masm b/tests/integration/expected/shl_u8.masm index 9808c8a31..6f0d3db34 100644 --- a/tests/integration/expected/shl_u8.masm +++ b/tests/integration/expected/shl_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shr_i64.masm b/tests/integration/expected/shr_i64.masm index 9a8050a84..afd089696 100644 --- a/tests/integration/expected/shr_i64.masm +++ b/tests/integration/expected/shr_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shr_u16.masm b/tests/integration/expected/shr_u16.masm index bae6f35a9..69cd0984b 100644 --- a/tests/integration/expected/shr_u16.masm +++ b/tests/integration/expected/shr_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shr_u32.masm b/tests/integration/expected/shr_u32.masm index 177ccac49..d7803cd6b 100644 --- a/tests/integration/expected/shr_u32.masm +++ b/tests/integration/expected/shr_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shr_u64.masm b/tests/integration/expected/shr_u64.masm index b7b99c883..f19ea2a42 100644 --- a/tests/integration/expected/shr_u64.masm +++ b/tests/integration/expected/shr_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/shr_u8.masm b/tests/integration/expected/shr_u8.masm index e5a9467b7..9b9a92a36 100644 --- a/tests/integration/expected/shr_u8.masm +++ b/tests/integration/expected/shr_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_felt.masm b/tests/integration/expected/sub_felt.masm index ecdcfbcff..c2ae54ef3 100644 --- a/tests/integration/expected/sub_felt.masm +++ b/tests/integration/expected/sub_felt.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_i128.masm b/tests/integration/expected/sub_i128.masm index 967da41c5..371cf817a 100644 --- a/tests/integration/expected/sub_i128.masm +++ b/tests/integration/expected/sub_i128.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_i16.masm b/tests/integration/expected/sub_i16.masm index fde5592be..522432b71 100644 --- a/tests/integration/expected/sub_i16.masm +++ b/tests/integration/expected/sub_i16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_i32.masm b/tests/integration/expected/sub_i32.masm index cf924c1b9..43d10bdeb 100644 --- a/tests/integration/expected/sub_i32.masm +++ b/tests/integration/expected/sub_i32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_i64.masm b/tests/integration/expected/sub_i64.masm index 520ab1f8f..632794135 100644 --- a/tests/integration/expected/sub_i64.masm +++ b/tests/integration/expected/sub_i64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_i8.masm b/tests/integration/expected/sub_i8.masm index 1222b6917..31181496b 100644 --- a/tests/integration/expected/sub_i8.masm +++ b/tests/integration/expected/sub_i8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_u128.masm b/tests/integration/expected/sub_u128.masm index 68121c006..33ef2f9a6 100644 --- a/tests/integration/expected/sub_u128.masm +++ b/tests/integration/expected/sub_u128.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_u16.masm b/tests/integration/expected/sub_u16.masm index a9e7f6af7..77b7e586c 100644 --- a/tests/integration/expected/sub_u16.masm +++ b/tests/integration/expected/sub_u16.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_u32.masm b/tests/integration/expected/sub_u32.masm index 1a7617cc4..b130e3214 100644 --- a/tests/integration/expected/sub_u32.masm +++ b/tests/integration/expected/sub_u32.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_u64.masm b/tests/integration/expected/sub_u64.masm index 13467451d..a027064f2 100644 --- a/tests/integration/expected/sub_u64.masm +++ b/tests/integration/expected/sub_u64.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/sub_u8.masm b/tests/integration/expected/sub_u8.masm index be4cdd90e..a6fa80721 100644 --- a/tests/integration/expected/sub_u8.masm +++ b/tests/integration/expected/sub_u8.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/types/array.masm b/tests/integration/expected/types/array.masm index 58e2090f5..4e1d5daf1 100644 --- a/tests/integration/expected/types/array.masm +++ b/tests/integration/expected/types/array.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/types/static_mut.masm b/tests/integration/expected/types/static_mut.masm index 163a8e38a..9616e3eb6 100644 --- a/tests/integration/expected/types/static_mut.masm +++ b/tests/integration/expected/types/static_mut.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/vec_alloc_vec.masm b/tests/integration/expected/vec_alloc_vec.masm index 74ae37856..cab5e0b28 100644 --- a/tests/integration/expected/vec_alloc_vec.masm +++ b/tests/integration/expected/vec_alloc_vec.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/expected/xor_bool.masm b/tests/integration/expected/xor_bool.masm index dee880591..1d47abe9e 100644 --- a/tests/integration/expected/xor_bool.masm +++ b/tests/integration/expected/xor_bool.masm @@ -1,6 +1,6 @@ # mod root_ns:root@1.0.0 -export.init +proc.init push.1179648 trace.240 exec.::intrinsics::mem::heap_init diff --git a/tests/integration/src/rust_masm_tests/examples.rs b/tests/integration/src/rust_masm_tests/examples.rs index dc9f39b48..182669972 100644 --- a/tests/integration/src/rust_masm_tests/examples.rs +++ b/tests/integration/src/rust_masm_tests/examples.rs @@ -1,6 +1,6 @@ use std::{collections::VecDeque, sync::Arc}; -use miden_core::utils::Deserializable; +use miden_core::utils::{Deserializable, Serializable}; use miden_mast_package::Package; use miden_objects::account::AccountComponentMetadata; use midenc_debug::{Executor, ToMidenRepr}; @@ -315,3 +315,34 @@ fn basic_wallet_and_p2id() { let note_package = test.compiled_package(); assert!(note_package.is_program(), "expected program"); } + +#[test] +fn auth_component_no_auth() { + let config = WasmTranslationConfig::default(); + let mut test = + CompilerTest::rust_source_cargo_miden("../../examples/auth-component-no-auth", config, []); + test.expect_wasm(expect_file![format!("../../expected/examples/auth_component_no_auth.wat")]); + test.expect_ir(expect_file![format!("../../expected/examples/auth_component_no_auth.hir")]); + test.expect_masm(expect_file![format!("../../expected/examples/auth_component_no_auth.masm")]); + let auth_comp_package = test.compiled_package(); + let lib = auth_comp_package.unwrap_library(); + let expected_module = "miden:base/authentication-component@1.0.0"; + let expected_function = "auth__procedure"; + let exports = lib + .exports() + .map(|e| format!("{}::{}", e.module, e.name.as_str())) + .collect::>(); + // dbg!(&exports); + assert!( + lib.exports().any(|export| { + export.module.to_string() == expected_module + && export.name.as_str() == expected_function + }), + "expected one of the exports to contain module '{expected_module}' and function \ + '{expected_function}'" + ); + + // Test that the package loads + let bytes = auth_comp_package.to_bytes(); + let _loaded_package = miden_mast_package::Package::read_from_bytes(&bytes).unwrap(); +} diff --git a/tools/cargo-miden/src/commands/new_project.rs b/tools/cargo-miden/src/commands/new_project.rs index ce71ca588..deb8fc36e 100644 --- a/tools/cargo-miden/src/commands/new_project.rs +++ b/tools/cargo-miden/src/commands/new_project.rs @@ -11,7 +11,7 @@ use clap::Args; /// /// Before changing it make sure the new tag exists in the rust-templates repo and points to the /// desired commit. -const TEMPLATES_REPO_TAG: &str = "v0.15.0"; +const TEMPLATES_REPO_TAG: &str = "v0.16.0"; /// The folder name to put Miden SDK WIT files in pub const WIT_DEPS_PATH: &str = "wit-deps"; @@ -21,17 +21,20 @@ pub const WIT_DEPS_PATH: &str = "wit-deps"; #[derive(Clone, Debug, Args)] pub struct ProjectTemplate { /// Rust program - #[clap(long, group = "template", conflicts_with_all(["account", "note", "tx_script"]))] + #[clap(long, group = "template", conflicts_with_all(["account", "note", "tx_script", "auth_component"]))] program: bool, /// Miden rollup account - #[clap(long, group = "template", conflicts_with_all(["program", "note", "tx_script"]))] + #[clap(long, group = "template", conflicts_with_all(["program", "note", "tx_script", "auth_component"]))] account: bool, /// Miden rollup note script - #[clap(long, group = "template", conflicts_with_all(["program", "account", "tx_script"]))] + #[clap(long, group = "template", conflicts_with_all(["program", "account", "tx_script", "auth_component"]))] note: bool, /// Miden rollup transaction script - #[clap(long, group = "template", conflicts_with_all(["program", "account", "note"]))] + #[clap(long, group = "template", conflicts_with_all(["program", "account", "note", "auth_component"]))] tx_script: bool, + /// Miden rollup authentication component + #[clap(long, group = "template", conflicts_with_all(["program", "account", "note", "tx_script"]))] + auth_component: bool, } #[allow(unused)] @@ -42,6 +45,7 @@ impl ProjectTemplate { account: false, note: false, tx_script: false, + auth_component: false, } } @@ -51,6 +55,7 @@ impl ProjectTemplate { account: true, note: false, tx_script: false, + auth_component: false, } } @@ -60,6 +65,7 @@ impl ProjectTemplate { account: false, note: true, tx_script: false, + auth_component: false, } } @@ -69,6 +75,17 @@ impl ProjectTemplate { account: false, note: false, tx_script: true, + auth_component: false, + } + } + + pub fn auth_component() -> Self { + Self { + program: false, + account: false, + note: false, + tx_script: false, + auth_component: true, } } } @@ -89,6 +106,8 @@ impl fmt::Display for ProjectTemplate { write!(f, "note") } else if self.tx_script { write!(f, "tx-script") + } else if self.auth_component { + write!(f, "auth-component") } else { panic!("Invalid project template, at least one variant must be set") } diff --git a/tools/cargo-miden/src/lib.rs b/tools/cargo-miden/src/lib.rs index d871111c9..4ef158aa8 100644 --- a/tools/cargo-miden/src/lib.rs +++ b/tools/cargo-miden/src/lib.rs @@ -354,16 +354,23 @@ where spawn_args.push(format!("{key}={value}")); } - let extra_rust_flags = String::from("-C target-feature=+bulk-memory,+wide-arithmetic"); + // `--fatal-warnings` will force the wasm-ld to error out in case of a function signature + // mismatch. This will surface the stub functions signature mismatches early on. + // Otherwise the wasm-ld will prefix the stub function name with `signature_mismatch:`. + let extra_rust_flags = String::from( + "-C target-feature=+bulk-memory,+wide-arithmetic -C link-args=--fatal-warnings", + ); // Augment RUSTFLAGS to ensure we preserve any flags set by the user - match std::env::var("RUSTFLAGS") { + let maybe_old_rustflags = match std::env::var("RUSTFLAGS") { Ok(current) if !current.is_empty() => { std::env::set_var("RUSTFLAGS", format!("{current} {extra_rust_flags}")); + Some(current) } _ => { std::env::set_var("RUSTFLAGS", extra_rust_flags); + None } - } + }; let terminal = Terminal::new( if cargo_args.quiet { Verbosity::Quiet @@ -405,6 +412,13 @@ where &spawn_args, )? }; + + if let Some(old_rustflags) = maybe_old_rustflags { + std::env::set_var("RUSTFLAGS", old_rustflags); + } else { + std::env::remove_var("RUSTFLAGS"); + } + assert_eq!(wasm_outputs.len(), 1, "expected only one Wasm artifact"); let wasm_output = wasm_outputs.first().expect("expected at least one Wasm artifact"); @@ -488,6 +502,10 @@ fn midenc_flags_from_target( midenc_args .push("--entrypoint=miden:base/transaction-script@1.0.0::run".to_string()) } + RollupTarget::AuthComponent => { + midenc_args.push("rollup:authentication-component".into()); + midenc_args.push("--lib".into()); + } } } } diff --git a/tools/cargo-miden/src/target.rs b/tools/cargo-miden/src/target.rs index 975094b9f..d6e49fcc7 100644 --- a/tools/cargo-miden/src/target.rs +++ b/tools/cargo-miden/src/target.rs @@ -45,6 +45,9 @@ pub fn detect_target_environment(root_pkg: &Package) -> Result { "transaction-script" => Ok(TargetEnv::Rollup { target: RollupTarget::TransactionScript, }), + "authentication-component" => Ok(TargetEnv::Rollup { + target: RollupTarget::AuthComponent, + }), _ => bail!( "Invalid value '{}' for 'project-kind' in [package.metadata.miden]. Must be one of: \ 'account', 'note-script', or 'transaction-script'", @@ -59,6 +62,7 @@ pub fn target_environment_to_project_type(target_env: TargetEnv) -> ProjectType TargetEnv::Base => ProjectType::Program, TargetEnv::Rollup { target } => match target { RollupTarget::Account => ProjectType::Library, + RollupTarget::AuthComponent => ProjectType::Library, RollupTarget::NoteScript | RollupTarget::TransactionScript => ProjectType::Program, }, TargetEnv::Emu => { diff --git a/tools/cargo-miden/tests/build.rs b/tools/cargo-miden/tests/build.rs index ba1419c02..ece4ec5eb 100644 --- a/tools/cargo-miden/tests/build.rs +++ b/tools/cargo-miden/tests/build.rs @@ -152,6 +152,17 @@ fn test_all_templates_and_examples() { // Verify program projects don't have WIT files verify_no_wit_files_for_new_template("--program"); + + let auth_comp = build_new_project_from_template("--auth-component"); + assert!(auth_comp.is_library()); + + let expected_function = "auth__procedure"; + let lib = auth_comp.unwrap_library(); + assert!( + lib.exports().any(|export| { export.name.as_str() == expected_function }), + "expected one of the authentication component exports to contain function \ + '{expected_function}'" + ); } /// Verify that WIT files are not present for program template