diff --git a/CHANGELOG.md b/CHANGELOG.md index f8aa2fda88..1412f28a5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Added `getAccountByKeyCommitment` method to `WebClient` for retrieving accounts by public key commitment ([#1729](https://github.com/0xMiden/miden-client/pull/1729)). * Added automatic registration of note scripts required by network transactions (NTX). The client now checks the node's script registry before submitting a transaction and registers any missing scripts via a separate registration transaction ([#1840](https://github.com/0xMiden/miden-client/pull/1840)). * Added automatic retry for rate-limited (`ResourceExhausted`) and transiently unavailable RPC calls in `GrpcClient`, with up to 5 attempts and `retry-after` header support ([#1928](https://github.com/0xMiden/miden-client/pull/1928)). +* [FEATURE][cli] Added `--offline` flag to `new-account` command for creating accounts without a running node, using a synthetic genesis header for local-only execution and debugging ([#1883](https://github.com/0xMiden/miden-client/pull/1883)). ### Changes @@ -54,6 +55,7 @@ * [FEATURE][web] Added `TransactionRequestBuilder.withExpirationDelta()` for expiring manual transaction requests ([#1904](https://github.com/0xMiden/miden-client/pull/1904)) * [FEATURE][web] Added `accounts.insert({ account, overwrite? })` to `MidenClient` for inserting pre-built `Account` objects into the local store. Enables external signer integrations that build accounts via `AccountBuilder` with custom auth commitments ([#1922](https://github.com/0xMiden/miden-client/pull/1922)). * [FEATURE][web] Exposed `executeProgram` (view call) to the JS side, allowing local execution of a transaction script against an account and inspection of the 16-element stack output without submitting to the network. Added `AdviceInputs` constructor and reverse `From` conversions. ([#1859](https://github.com/0xMiden/miden-client/issues/1859)) +* [FEATURE][cli] Added DAP (Debug Adapter Protocol) support for interactive transaction script debugging. New `--start-debug-adapter` flag on the `exec` command launches a DAP server, allowing any DAP-compatible client to set breakpoints, step through, and inspect Miden transaction scripts ([#1883](https://github.com/0xMiden/miden-client/pull/1883)). ### Fixes diff --git a/Cargo.lock b/Cargo.lock index 0efdf84c42..9599e7c3b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "anstream" -version = "1.0.0" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -143,15 +143,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.14" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" -version = "1.0.0" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.2.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a686bbee5efb88a82df0621b236e74d925f470e5445d3220a5648b892ec99c9" +checksum = "9c5bcfa8749ac45dd12cb11055aeeb6b27a3895560d60d71e3c23bf979e60514" dependencies = [ "anstyle", "bstr", @@ -294,9 +294,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.16.2" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" +checksum = "94bffc006df10ac2a68c83692d734a465f8ee6c5b384d8545a636f81d858f4bf" dependencies = [ "aws-lc-sys", "zeroize", @@ -304,9 +304,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.39.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a" +checksum = "4321e568ed89bb5a7d291a7f37997c2c0df89809d7b6d12062c81ddb54aa782e" dependencies = [ "cc", "cmake", @@ -341,9 +341,9 @@ dependencies = [ [[package]] name = "aws-sdk-kms" -version = "1.104.0" +version = "1.103.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41ae6a33da941457e89075ef8ca5b4870c8009fe4dceeba82fce2f30f313ac6" +checksum = "8e6bfd8dfb5a562f9a605bbd5c3aef09db9231c826a1e0488ce3f4338c70dbbb" dependencies = [ "aws-credential-types", "aws-runtime", @@ -365,9 +365,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.97.0" +version = "1.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aadc669e184501caaa6beafb28c6267fc1baef0810fb58f9b205485ca3f2567" +checksum = "f64a6eded248c6b453966e915d32aeddb48ea63ad17932682774eb026fbef5b1" dependencies = [ "aws-credential-types", "aws-runtime", @@ -389,9 +389,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.99.0" +version = "1.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1342a7db8f358d3de0aed2007a0b54e875458e39848d54cc1d46700b2bfcb0a8" +checksum = "db96d720d3c622fcbe08bae1c4b04a72ce6257d8b0584cb5418da00ae20a344f" dependencies = [ "aws-credential-types", "aws-runtime", @@ -413,9 +413,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.101.0" +version = "1.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab41ad64e4051ecabeea802d6a17845a91e83287e1dd249e6963ea1ba78c428a" +checksum = "fafbdda43b93f57f699c5dfe8328db590b967b8a820a13ccdd6687355dfcc7ca" dependencies = [ "aws-credential-types", "aws-runtime", @@ -592,9 +592,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.4.7" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d73dbfbaa8e4bc57b9045137680b958d274823509a360abfd8e1d514d40c95c" +checksum = "d2b1117b3b2bbe166d11199b540ceed0d0f7676e36e7b962b5a437a9971eac75" dependencies = [ "base64-simd", "bytes", @@ -905,9 +905,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.57" +version = "1.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" dependencies = [ "find-msvc-tools", "jobserver", @@ -991,9 +991,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.0" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" dependencies = [ "clap_builder", "clap_derive", @@ -1001,9 +1001,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.6.0" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" dependencies = [ "anstream", "anstyle", @@ -1013,9 +1013,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.6.0" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" dependencies = [ "heck", "proc-macro2", @@ -1025,9 +1025,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] name = "cmake" @@ -1040,9 +1040,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "comfy-table" @@ -1361,9 +1361,9 @@ dependencies = [ [[package]] name = "diesel" -version = "2.3.7" +version = "2.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ae09a41a4b89f94ec1e053623da8340d996bc32c6517d325a9daad9b239358" +checksum = "d9b6c2fc184a6fb6ebcf5f9a5e3bbfa84d8fd268cdfcce4ed508979a6259494d" dependencies = [ "bigdecimal", "diesel_derives", @@ -1467,9 +1467,9 @@ dependencies = [ [[package]] name = "dissimilar" -version = "1.0.11" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeda16ab4059c5fd2a83f2b9c9e9c981327b18aa8e3b313f7e6563799d4f093e" +checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921" [[package]] name = "document-features" @@ -1581,9 +1581,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" dependencies = [ "log", "regex", @@ -1591,9 +1591,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.10" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" dependencies = [ "anstream", "anstyle", @@ -2281,7 +2281,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.5.10", + "socket2 0.6.2", "tokio", "tower-service", "tracing", @@ -2496,9 +2496,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jiff" @@ -2611,9 +2611,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.183" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libloading" @@ -2633,9 +2633,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.15" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" dependencies = [ "libc", ] @@ -2667,9 +2667,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.25" +version = "1.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52f4c29e2a68ac30c9087e1b772dc9f44a2b66ed44edf2266cf2be9b03dafc1" +checksum = "4735e9cbde5aac84a5ce588f6b23a90b9b0b528f6c5a8db8a4aff300463a0839" dependencies = [ "cc", "pkg-config", @@ -2824,7 +2824,27 @@ dependencies = [ "miden-crypto", "miden-protocol", "miden-standards", - "miden-utils-sync", + "miden-utils-sync 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types", + "regex", + "thiserror 2.0.18", + "walkdir", +] + +[[package]] +name = "miden-agglayer" +version = "0.14.0" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" +dependencies = [ + "alloy-sol-types", + "fs-err", + "miden-assembly", + "miden-core", + "miden-core-lib", + "miden-crypto", + "miden-protocol", + "miden-standards", + "miden-utils-sync 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types", "regex", "thiserror 2.0.18", @@ -2834,8 +2854,7 @@ dependencies = [ [[package]] name = "miden-air" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5322d00bef8b19f4cd3415da2533a87c8860c7d9b80043d6cce0f184b40c5fff" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "miden-core", "miden-crypto", @@ -2893,6 +2912,15 @@ dependencies = [ "thiserror 2.0.18", ] +[[package]] +name = "miden-block-prover" +version = "0.14.0" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" +dependencies = [ + "miden-protocol", + "thiserror 2.0.18", +] + [[package]] name = "miden-client" version = "0.14.0" @@ -2904,6 +2932,7 @@ dependencies = [ "getrandom 0.3.4", "gloo-timers", "hex", + "miden-debug", "miden-node-proto-build", "miden-note-transport-proto-build", "miden-protocol", @@ -2958,6 +2987,7 @@ dependencies = [ "figment", "miden-client", "miden-client-sqlite-store", + "miden-debug", "miette", "predicates", "rand 0.9.2", @@ -3051,8 +3081,7 @@ dependencies = [ [[package]] name = "miden-core" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bf4f5601b0d669aa125cce3bba4b98f2c8df729e2d53e66777429ac5f53e228" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "derive_more", "itertools 0.14.0", @@ -3061,7 +3090,7 @@ dependencies = [ "miden-formatting", "miden-utils-core-derive", "miden-utils-indexing", - "miden-utils-sync", + "miden-utils-sync 0.22.0 (git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46)", "num-derive", "num-traits", "proptest", @@ -3081,7 +3110,7 @@ dependencies = [ "miden-core", "miden-crypto", "miden-processor", - "miden-utils-sync", + "miden-utils-sync 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 2.0.18", ] @@ -3138,21 +3167,88 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "miden-debug" +version = "0.5.0" +source = "git+https://github.com/0xMiden/miden-debug.git?rev=047592ec38b7f0d9a0ac0e012766b49cdd48f2eb#047592ec38b7f0d9a0ac0e012766b49cdd48f2eb" +dependencies = [ + "clap", + "futures", + "glob", + "log", + "miden-assembly", + "miden-assembly-syntax", + "miden-core", + "miden-crypto", + "miden-debug-dap", + "miden-debug-engine", + "miden-debug-types", + "miden-mast-package", + "miden-processor", + "miden-protocol", + "miden-thiserror", + "miden-tx", + "num-traits", + "rustc-demangle", + "serde", + "serde_json", + "smallvec", + "socket2 0.5.10", + "tokio", + "tokio-util", + "toml 0.8.23", +] + +[[package]] +name = "miden-debug-dap" +version = "0.1.0" +source = "git+https://github.com/0xMiden/miden-debug.git?rev=047592ec38b7f0d9a0ac0e012766b49cdd48f2eb#047592ec38b7f0d9a0ac0e012766b49cdd48f2eb" +dependencies = [ + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "miden-debug-engine" +version = "0.1.0" +source = "git+https://github.com/0xMiden/miden-debug.git?rev=047592ec38b7f0d9a0ac0e012766b49cdd48f2eb#047592ec38b7f0d9a0ac0e012766b49cdd48f2eb" +dependencies = [ + "clap", + "glob", + "log", + "miden-assembly", + "miden-assembly-syntax", + "miden-core", + "miden-debug-dap", + "miden-debug-types", + "miden-mast-package", + "miden-processor", + "miden-thiserror", + "miden-tx", + "num-traits", + "rustc-demangle", + "serde", + "serde_json", + "smallvec", + "socket2 0.5.10", + "toml 0.8.23", +] + [[package]] name = "miden-debug-types" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ef08bafef275f0d6a15108108b3f6df6642772e0a1c05e102cb7e96841e888" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "memchr", "miden-crypto", "miden-formatting", "miden-miette", "miden-utils-indexing", - "miden-utils-sync", + "miden-utils-sync 0.22.0 (git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46)", "paste", "serde", - "serde_spanned 1.1.0", + "serde_spanned 1.0.4", "thiserror 2.0.18", ] @@ -3274,7 +3370,7 @@ dependencies = [ "miden-protocol", "miden-remote-prover-client", "miden-standards", - "miden-tx-batch-prover", + "miden-tx-batch-prover 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.9.2", "thiserror 2.0.18", "tokio", @@ -3423,8 +3519,8 @@ dependencies = [ "hex", "indexmap", "libsqlite3-sys", - "miden-agglayer", - "miden-block-prover", + "miden-agglayer 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "miden-block-prover 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "miden-crypto", "miden-large-smt-backend-rocksdb", "miden-node-db", @@ -3441,7 +3537,7 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tokio-stream", - "toml 1.1.0+spec-1.1.0", + "toml 1.0.4+spec-1.1.0", "tonic", "tonic-reflection", "tower-http", @@ -3524,8 +3620,7 @@ dependencies = [ [[package]] name = "miden-processor" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba53ff06ef0affa0c3fb13e7e2ef5bde99f96eebcec8c360c6658050480ef676" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "itertools 0.14.0", "miden-air", @@ -3543,8 +3638,7 @@ dependencies = [ [[package]] name = "miden-protocol" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c30a20ea30071544a827d0daa12e343e444c1e314d1a4560c43f2d6c7b43c6" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" dependencies = [ "bech32", "fs-err", @@ -3557,7 +3651,7 @@ dependencies = [ "miden-mast-package", "miden-processor", "miden-protocol-macros", - "miden-utils-sync", + "miden-utils-sync 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", "miden-verifier", "rand 0.9.2", "rand_chacha", @@ -3566,15 +3660,14 @@ dependencies = [ "semver 1.0.27", "serde", "thiserror 2.0.18", - "toml 1.1.0+spec-1.1.0", + "toml 1.0.4+spec-1.1.0", "walkdir", ] [[package]] name = "miden-protocol-macros" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c58e1d47dd08af461f6aa13ec128013bb1a26183ea4dd42f323939bcbf72d4" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" dependencies = [ "proc-macro2", "quote", @@ -3633,8 +3726,7 @@ dependencies = [ [[package]] name = "miden-standards" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612af5b544a25e318d89dca9ac958d436f9a8b209be4dda6ee2df0c21c58548e" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" dependencies = [ "fs-err", "miden-assembly", @@ -3651,31 +3743,49 @@ dependencies = [ [[package]] name = "miden-testing" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982fb99a73d12abc6088562be1f606f24cbb2673e832ba872bf86d6add566638" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" dependencies = [ "anyhow", "itertools 0.14.0", - "miden-agglayer", + "miden-agglayer 0.14.0 (git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285)", "miden-assembly", - "miden-block-prover", + "miden-block-prover 0.14.0 (git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285)", "miden-core-lib", "miden-crypto", "miden-processor", "miden-protocol", "miden-standards", "miden-tx", - "miden-tx-batch-prover", + "miden-tx-batch-prover 0.14.0 (git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285)", "rand 0.9.2", "rand_chacha", "thiserror 2.0.18", ] +[[package]] +name = "miden-thiserror" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183ff8de338956ecfde3a38573241eb7a6f3d44d73866c210e5629c07fa00253" +dependencies = [ + "miden-thiserror-impl", +] + +[[package]] +name = "miden-thiserror-impl" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee4176a0f2e7d29d2a8ee7e60b6deb14ce67a20e94c3e2c7275cdb8804e1862" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "miden-tx" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e32f06ec896176724bbb29de6c655f856e5444319cd3824c921511cde24f87" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" dependencies = [ "miden-processor", "miden-protocol", @@ -3695,11 +3805,19 @@ dependencies = [ "miden-tx", ] +[[package]] +name = "miden-tx-batch-prover" +version = "0.14.0" +source = "git+https://github.com/0xMiden/protocol?rev=ae4b45778c7e2c73be87b67906b7fa1ae8e2a285#ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" +dependencies = [ + "miden-protocol", + "miden-tx", +] + [[package]] name = "miden-utils-core-derive" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "477db426fc31f666d7e65b0cc907fe431d36d88d611a0594cf266104eb168b4c" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "proc-macro2", "quote", @@ -3709,8 +3827,7 @@ dependencies = [ [[package]] name = "miden-utils-diagnostics" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "785c1ec4ad9994100b117b8eab8c453dcc35d3d168e4f72ac818efb700abe7b1" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "miden-crypto", "miden-debug-types", @@ -3722,8 +3839,7 @@ dependencies = [ [[package]] name = "miden-utils-indexing" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46cec00c8cf32ec46df7542fb9ea15fbe7a5149920ef97776a4f4bc3a563e8de" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" dependencies = [ "miden-crypto", "thiserror 2.0.18", @@ -3741,6 +3857,17 @@ dependencies = [ "parking_lot", ] +[[package]] +name = "miden-utils-sync" +version = "0.22.0" +source = "git+https://github.com/0xMiden/miden-vm.git?rev=1b60fa4b54e60075cad7a761b593d5c00c6aaf46#1b60fa4b54e60075cad7a761b593d5c00c6aaf46" +dependencies = [ + "lock_api", + "loom", + "once_cell", + "parking_lot", +] + [[package]] name = "miden-verifier" version = "0.22.0" @@ -4043,9 +4170,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.4" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" @@ -4081,9 +4208,9 @@ dependencies = [ [[package]] name = "opentelemetry-otlp" -version = "0.31.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" +checksum = "7a2366db2dca4d2ad033cad11e6ee42844fd727007af5ad04a1730f4cb8163bf" dependencies = [ "http 1.4.0", "opentelemetry", @@ -4145,9 +4272,9 @@ checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" [[package]] name = "p3-air" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2ec9cbfc642fc5173817287c3f8b789d07743b5f7e812d058b7a03e344f9ab" +checksum = "9ebc58ec27a174420348b3f04dba836fa2e5b5fe8df74601087417352757c643" dependencies = [ "p3-field", "p3-matrix", @@ -4156,9 +4283,9 @@ dependencies = [ [[package]] name = "p3-blake3" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b667f43b19499dd939c9e2553aa95688936a88360d50117dae3c8848d07dbc70" +checksum = "b3cacb38c29fbee71fe3e5c6c0a1073632e46dc3e93fbdc50ab4e4fac137b525" dependencies = [ "blake3", "p3-symmetric", @@ -4167,9 +4294,9 @@ dependencies = [ [[package]] name = "p3-challenger" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0b490c745a7d2adeeafff06411814c8078c432740162332b3cd71be0158a76" +checksum = "af9bbcb18fe90271668259aacfc43455e328673c2b5c926cff0663edc8653e4d" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -4181,9 +4308,9 @@ dependencies = [ [[package]] name = "p3-commit" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916ae7989d5c3b49f887f5c55b2f9826bdbb81aaebf834503c4145d8b267c829" +checksum = "14d07b50c6f6d3bc89ed7c54ae0c569fb4caaa58263fd389dc02fb1b0a6378fa" dependencies = [ "itertools 0.14.0", "p3-field", @@ -4194,9 +4321,9 @@ dependencies = [ [[package]] name = "p3-dft" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55301e91544440254977108b85c32c09d7ea05f2f0dd61092a2825339906a4a7" +checksum = "17e7ba0dc20be075eab3f88f0cb820a0901f86218a1c46134e7c817d41597989" dependencies = [ "itertools 0.14.0", "p3-field", @@ -4209,9 +4336,9 @@ dependencies = [ [[package]] name = "p3-field" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85affca7fc983889f260655c4cf74163eebb94605f702e4b6809ead707cba54f" +checksum = "9b8533e6c2f4d0cc61fd2ae5299bb83316898e535f47291808d37e4d666ba088" dependencies = [ "itertools 0.14.0", "num-bigint", @@ -4225,9 +4352,9 @@ dependencies = [ [[package]] name = "p3-goldilocks" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca1081f5c47b940f2d75a11c04f62ea1cc58a5d480dd465fef3861c045c63cd" +checksum = "d8102a8c85acee1f896c3764bef5fac908e6026dadfc557c185294970cce0746" dependencies = [ "num-bigint", "p3-challenger", @@ -4245,9 +4372,9 @@ dependencies = [ [[package]] name = "p3-keccak" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcf27615ece1995e4fcf4c69740f1cf515d1481367a20b4b3ce7f4f1b8d70f7" +checksum = "b65d30dd586d2855906a01c3414c155c2d564f6677d1b51f04186dcac080f757" dependencies = [ "p3-symmetric", "p3-util", @@ -4256,9 +4383,9 @@ dependencies = [ [[package]] name = "p3-matrix" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53428126b009071563d1d07305a9de8be0d21de00b57d2475289ee32ffca6577" +checksum = "72bb78444459155c2e4711d71abbfef7b04cc2ba1fa83751ccab241b01957095" dependencies = [ "itertools 0.14.0", "p3-field", @@ -4271,18 +4398,18 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082bf467011c06c768c579ec6eb9accb5e1e62108891634cc770396e917f978a" +checksum = "70a0a54345917f500130a9986fa5ff9ecbc26f0c6313080b35b713e26ddc8053" dependencies = [ "rayon", ] [[package]] name = "p3-mds" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35209e6214102ea6ec6b8cb1b9c15a9b8e597a39f9173597c957f123bced81b3" +checksum = "3cd514bf3e9bf9f1b7db2db96e5bd2972d9963dd62430de1e193d74522ae96a6" dependencies = [ "p3-dft", "p3-field", @@ -4389,9 +4516,9 @@ dependencies = [ [[package]] name = "p3-monty-31" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffa8c99ec50c035020bbf5457c6a729ba6a975719c1a8dd3f16421081e4f650c" +checksum = "0d9340a650f07a6cd42a4e877017ba7b206df87fe50dfc3cf110f01a3c370bd1" dependencies = [ "itertools 0.14.0", "num-bigint", @@ -4413,9 +4540,9 @@ dependencies = [ [[package]] name = "p3-poseidon1" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a018b618e3fa0aec8be933b1d8e404edd23f46991f6bf3f5c2f3f95e9413fe9" +checksum = "6dd56ae3a51ded1b77f7b1b21d0b157ae82b9d5ca8f2cba347c0b821fe771a79" dependencies = [ "p3-field", "p3-symmetric", @@ -4424,9 +4551,9 @@ dependencies = [ [[package]] name = "p3-poseidon2" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256a668a9ba916f8767552f13d0ba50d18968bc74a623bfdafa41e2970c944d0" +checksum = "858aa1c33ec983dfbb8cfc553a213de19d8fde96485e54e6e952b9ac5e70bd4e" dependencies = [ "p3-field", "p3-mds", @@ -4437,9 +4564,9 @@ dependencies = [ [[package]] name = "p3-symmetric" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c60a71a1507c13611b0f2b0b6e83669fd5b76f8e3115bcbced5ccfdf3ca7807" +checksum = "1a9a3b20bb8104e52d45219a78d80654c8ac6a4781be0eaa3f3e999f5ae4b9b2" dependencies = [ "itertools 0.14.0", "p3-field", @@ -4449,9 +4576,9 @@ dependencies = [ [[package]] name = "p3-util" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b766b9e9254bf3fa98d76e42cf8a5b30628c182dfd5272d270076ee12f0fc0" +checksum = "9f24495d9cd64693165a9f1b3da0758395ad6d25d2d44dd740bdb34c2bce0c53" dependencies = [ "rayon", "serde", @@ -4613,9 +4740,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" +checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" dependencies = [ "portable-atomic", ] @@ -4756,9 +4883,9 @@ dependencies = [ [[package]] name = "proptest" -version = "1.11.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" dependencies = [ "bitflags", "num-traits", @@ -4797,7 +4924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ "heck", - "itertools 0.13.0", + "itertools 0.14.0", "log", "multimap", "petgraph 0.8.3", @@ -4818,7 +4945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.117", @@ -4874,9 +5001,9 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.13.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad" +checksum = "83c41efbf8f90ac44de7f3a868f0867851d261b56291732d0cbf7cceaaeb55a6" dependencies = [ "bitflags", "memchr", @@ -5256,7 +5383,7 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.10", + "rustls-webpki 0.103.9", "subtle", "zeroize", ] @@ -5294,9 +5421,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.10" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "aws-lc-rs", "ring", @@ -5336,9 +5463,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.29" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ "windows-sys 0.61.2", ] @@ -5520,9 +5647,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.1.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ "serde_core", ] @@ -5672,12 +5799,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -5860,9 +5987,9 @@ checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b" [[package]] name = "tempfile" -version = "3.27.0" +version = "3.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" dependencies = [ "fastrand", "getrandom 0.4.2", @@ -5891,12 +6018,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" dependencies = [ "rustix", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -6044,7 +6171,7 @@ dependencies = [ "mio", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.3", + "socket2 0.6.2", "tokio-macros", "windows-sys 0.61.2", ] @@ -6111,6 +6238,7 @@ 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", @@ -6125,26 +6253,26 @@ checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.1.0", + "serde_spanned 1.0.4", "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 0.7.15", + "winnow", ] [[package]] name = "toml" -version = "1.1.0+spec-1.1.0" +version = "1.0.4+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc" +checksum = "c94c3321114413476740df133f0d8862c61d87c8d26f04c6841e033c8c80db47" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.1.0", - "toml_datetime 1.1.0+spec-1.1.0", + "serde_spanned 1.0.4", + "toml_datetime 1.0.0+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 1.0.0", + "winnow", ] [[package]] @@ -6167,9 +6295,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.1.0+spec-1.1.0" +version = "1.0.0+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" +checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e" dependencies = [ "serde_core", ] @@ -6185,16 +6313,16 @@ dependencies = [ "serde_spanned 0.6.9", "toml_datetime 0.6.11", "toml_write", - "winnow 0.7.15", + "winnow", ] [[package]] name = "toml_parser" -version = "1.1.0+spec-1.1.0" +version = "1.0.9+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" +checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" dependencies = [ - "winnow 1.0.0", + "winnow", ] [[package]] @@ -6205,9 +6333,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.1.0+spec-1.1.0" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tonic" @@ -6229,7 +6357,7 @@ dependencies = [ "percent-encoding", "pin-project", "rustls-native-certs", - "socket2 0.6.3", + "socket2 0.6.2", "sync_wrapper", "tokio", "tokio-rustls 0.26.4", @@ -6501,9 +6629,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.23" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", "nu-ansi-term", @@ -6560,7 +6688,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 1.1.0+spec-1.1.0", + "toml 1.0.4+spec-1.1.0", ] [[package]] @@ -6616,9 +6744,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-segmentation" -version = "1.13.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a559e63b5d8004e12f9bce88af5c6d939c58de839b7532cfe9653846cedd2a9e" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" @@ -6687,9 +6815,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.22.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" dependencies = [ "getrandom 0.4.2", "js-sys", @@ -7006,7 +7134,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", ] [[package]] @@ -7024,14 +7161,31 @@ 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", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -7040,42 +7194,84 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[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_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[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_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -7083,19 +7279,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winnow" -version = "0.7.15" +name = "windows_x86_64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" -dependencies = [ - "memchr", -] +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "1.0.0" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] [[package]] name = "wit-bindgen" @@ -7238,18 +7434,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.47" +version = "0.8.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +checksum = "a789c6e490b576db9f7e6b6d661bcc9799f7c0ac8352f56ea20193b2681532e5" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.47" +version = "0.8.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +checksum = "f65c489a7071a749c849713807783f70672b28094011623e200cb86dcb835953" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 532c46cb6c..563d012eeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,6 +57,12 @@ miden-remote-prover-client = { default-features = false, features = [ "tx-prover", ], git = "https://github.com/0xMiden/miden-node", rev = "c2d61c0eee9f81dd6335ed51c3424a9bd5e34dd8" } +# Miden debug dependency +miden-debug = { default-features = false, features = [ + "dap", + "std", +], git = "https://github.com/0xMiden/miden-debug.git", rev = "047592ec38b7f0d9a0ac0e012766b49cdd48f2eb" } + # External dependencies anyhow = { default-features = false, version = "1.0" } async-trait = { version = "0.1" } @@ -81,3 +87,22 @@ module_name_repetitions = "allow" # Many triggers, and is a stylistic choice must_use_candidate = "allow" # This marks many fn's which isn't helpful. should_panic_without_expect = "allow" # We don't care about the specific panic message. # End of pedantic lints. + +[patch.crates-io] +miden-protocol = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-standards = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-testing = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-tx = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-air = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } +miden-core = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } +miden-debug-types = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } +miden-processor = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } +miden-utils-core-derive = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } +miden-utils-diagnostics = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } +miden-utils-indexing = { git = "https://github.com/0xMiden/miden-vm.git", rev = "1b60fa4b54e60075cad7a761b593d5c00c6aaf46" } + +[patch."https://github.com/0xMiden/miden-base"] +miden-protocol = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-standards = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-testing = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } +miden-tx = { git = "https://github.com/0xMiden/protocol", rev = "ae4b45778c7e2c73be87b67906b7fa1ae8e2a285" } diff --git a/bin/miden-cli/Cargo.toml b/bin/miden-cli/Cargo.toml index 6958911ede..0f2ecfd2d9 100644 --- a/bin/miden-cli/Cargo.toml +++ b/bin/miden-cli/Cargo.toml @@ -16,10 +16,14 @@ version.workspace = true name = "miden-client" path = "src/main.rs" +[features] +dap = ["dep:miden-debug", "miden-client/dap"] + [dependencies] # Workspace dependencies miden-client = { features = ["tonic"], workspace = true } miden-client-sqlite-store = { workspace = true } +miden-debug = { optional = true, workspace = true } # External dependencies clap = { features = ["derive"], version = "4.5" } diff --git a/bin/miden-cli/src/commands/exec.rs b/bin/miden-cli/src/commands/exec.rs index fdd57b9e4f..4dfd96ce57 100644 --- a/bin/miden-cli/src/commands/exec.rs +++ b/bin/miden-cli/src/commands/exec.rs @@ -2,7 +2,9 @@ use std::collections::BTreeMap; use std::path::PathBuf; use clap::Parser; +use miden_client::account::AccountId; use miden_client::keystore::Keystore; +use miden_client::transaction::{ForeignAccount, TransactionScript}; use miden_client::vm::AdviceInputs; use miden_client::{Client, Felt, Word}; use serde::{Deserialize, Deserializer, Serialize, de}; @@ -47,6 +49,13 @@ pub struct ExecCmd { /// Print the output stack grouped into words #[arg(long, default_value_t = false)] hex_words: bool, + + /// Start a DAP debug adapter server on the given address (e.g. "127.0.0.1:4711") + /// and wait for a DAP client to connect before executing. + /// + /// If this binary was built without DAP support, using this flag returns an error. + #[arg(long = "start-debug-adapter")] + start_debug_adapter: Option, } impl ExecCmd { @@ -87,19 +96,13 @@ impl ExecCmd { let tx_script = client.code_builder().compile_tx_script(&program)?; - let result = client - .execute_program(account_id, tx_script, advice_inputs, BTreeMap::new()) - .await; + let output_stack = + self.execute_program(&mut client, account_id, tx_script, advice_inputs).await?; - match result { - Ok(output_stack) => { - println!("Program executed successfully"); - println!("Output stack:"); - self.print_stack(output_stack); - Ok(()) - }, - Err(err) => Err(CliError::Exec(err.into(), "error executing the program".to_string())), - } + println!("Program executed successfully"); + println!("Output stack:"); + self.print_stack(output_stack); + Ok(()) } /// Print the output stack in a human-readable format @@ -130,6 +133,61 @@ impl ExecCmd { } } } + + async fn execute_program( + &self, + client: &mut Client, + account_id: AccountId, + tx_script: TransactionScript, + advice_inputs: AdviceInputs, + ) -> Result<[Felt; 16], CliError> { + let foreign_accounts = BTreeMap::::new(); + + #[cfg(feature = "dap")] + if let Some(addr) = self.start_debug_adapter.as_ref() { + let config = miden_debug::DapConfig::new(addr.clone()); + let config_handle = config.clone(); + miden_debug::DapConfig::set_global(config); + + let script_path = PathBuf::from(&self.script_path); + loop { + let program = std::fs::read_to_string(&script_path)?; + let tx_script = client.code_builder().compile_tx_script(&program)?; + + let result = client + .execute_program_with_dap( + account_id, + tx_script, + advice_inputs.clone(), + foreign_accounts.clone(), + ) + .await; + + if config_handle.restart_requested() { + config_handle.reset_restart(); + eprintln!("Recompiling from source and restarting debug session..."); + continue; + } + + return result.map_err(|err| { + CliError::Exec(err.into(), "error executing the program".to_string()) + }); + } + } + + #[cfg(not(feature = "dap"))] + if self.start_debug_adapter.is_some() { + return Err(CliError::InvalidArgument( + "--start-debug-adapter requires a CLI build with the `dap` feature enabled" + .to_string(), + )); + } + + client + .execute_program(account_id, tx_script, advice_inputs, foreign_accounts) + .await + .map_err(|err| CliError::Exec(err.into(), "error executing the program".to_string())) + } } // INPUT FILE PROCESSING diff --git a/bin/miden-cli/src/commands/new_account.rs b/bin/miden-cli/src/commands/new_account.rs index 53170eb40b..3ae378bead 100644 --- a/bin/miden-cli/src/commands/new_account.rs +++ b/bin/miden-cli/src/commands/new_account.rs @@ -98,6 +98,9 @@ pub struct NewWalletCmd { /// authentication transaction. #[arg(long, default_value_t = false)] pub deploy: bool, + /// Seed local-only state so the wallet can be created and used for execution without a node. + #[arg(long, default_value_t = false)] + pub offline: bool, } impl NewWalletCmd { @@ -126,6 +129,7 @@ impl NewWalletCmd { &package_paths, self.init_storage_data_path.clone(), self.deploy, + self.offline, ) .await?; @@ -193,6 +197,9 @@ pub struct NewAccountCmd { /// authentication transaction. #[arg(long, default_value_t = false)] pub deploy: bool, + /// Seed local-only state so the account can be created and used for execution without a node. + #[arg(long, default_value_t = false)] + pub offline: bool, } impl NewAccountCmd { @@ -209,6 +216,7 @@ impl NewAccountCmd { &self.packages, self.init_storage_data_path.clone(), self.deploy, + self.offline, ) .await?; @@ -385,6 +393,7 @@ async fn create_client_account( package_paths: &[PathBuf], init_storage_data_path: Option, deploy: bool, + offline: bool, ) -> Result { if package_paths.is_empty() { return Err(CliError::InvalidArgument(format!( @@ -393,6 +402,12 @@ async fn create_client_account( ", client_binary_name().display()))); } + if deploy && offline { + return Err(CliError::InvalidArgument( + "`--offline` cannot be combined with `--deploy`".to_string(), + )); + } + // Load the component templates and initialization storage data. let cli_config = CliConfig::load()?; @@ -455,6 +470,11 @@ async fn create_client_account( println!("Using custom authentication component from package (no key generated)."); } + if offline { + client.prepare_offline_bootstrap().await?; + println!("Offline mode seeded default RPC limits and a synthetic genesis header."); + } + client.add_account(&account, false).await?; if deploy { diff --git a/crates/rust-client/Cargo.toml b/crates/rust-client/Cargo.toml index 0cc167f55d..ef862cd9f4 100644 --- a/crates/rust-client/Cargo.toml +++ b/crates/rust-client/Cargo.toml @@ -24,6 +24,7 @@ ignored = ["getrandom", "prost-types", "tonic-prost"] crate-type = ["lib"] [features] +dap = ["dep:miden-debug"] default = ["std"] std = [ "dep:tokio", @@ -40,6 +41,7 @@ tonic = [] [dependencies] # Miden dependencies +miden-debug = { optional = true, workspace = true } miden-protocol = { workspace = true } miden-remote-prover-client = { default-features = false, features = ["tx-prover"], workspace = true } miden-standards = { workspace = true } diff --git a/crates/rust-client/src/sync/block_header.rs b/crates/rust-client/src/sync/block_header.rs index 5ed4330e8a..b94b029b0f 100644 --- a/crates/rust-client/src/sync/block_header.rs +++ b/crates/rust-client/src/sync/block_header.rs @@ -2,15 +2,25 @@ use alloc::sync::Arc; use alloc::vec::Vec; use miden_protocol::Word; -use miden_protocol::block::{BlockHeader, BlockNumber}; +use miden_protocol::account::AccountId; +use miden_protocol::block::account_tree::AccountTree; +use miden_protocol::block::nullifier_tree::NullifierTree; +use miden_protocol::block::{BlockHeader, BlockNoteTree, BlockNumber, Blockchain, FeeParameters}; +use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; use miden_protocol::crypto::merkle::MerklePath; use miden_protocol::crypto::merkle::mmr::{Forest, InOrderIndex, MmrPeaks, PartialMmr}; +use miden_protocol::crypto::merkle::smt::Smt; +use miden_protocol::transaction::{OrderedTransactionHeaders, TransactionKernel}; use tracing::warn; use crate::rpc::NodeRpcClient; use crate::store::{BlockRelevance, StoreError}; use crate::{Client, ClientError}; +/// Synthetic faucet account ID used only by the offline bootstrap genesis header so fee +/// parameters can reference a stable native-asset faucet without requiring node state. +const OFFLINE_NATIVE_ASSET_FAUCET_ID: u128 = 0xab00_0000_0000_cd20_0000_ac00_0000_de00; + /// Network information management methods. impl Client { /// Retrieves a block header by its block number from the store. @@ -43,6 +53,30 @@ impl Client { Ok(()) } + /// Seeds the local client state needed to create accounts and execute programs without a node. + /// + /// This stores default RPC limits and inserts a synthetic genesis header if one is not + /// already present in the store. The synthetic header is only intended for local-only + /// execution and debugging. + pub async fn prepare_offline_bootstrap(&mut self) -> Result<(), ClientError> { + let limits = self.store.get_rpc_limits().await?.unwrap_or_default(); + self.store.set_rpc_limits(limits).await?; + self.rpc_api.set_rpc_limits(limits).await; + + if let Some((genesis, _)) = self.store.get_block_header_by_num(BlockNumber::GENESIS).await? + { + self.rpc_api.set_genesis_commitment(genesis.commitment()).await?; + return Ok(()); + } + + let genesis = synthetic_offline_genesis_header(); + let blank_mmr_peaks = MmrPeaks::new(Forest::empty(), vec![]) + .expect("Blank MmrPeaks should not fail to instantiate"); + self.store.insert_block_header(&genesis, blank_mmr_peaks, false).await?; + self.rpc_api.set_genesis_commitment(genesis.commitment()).await?; + Ok(()) + } + /// Fetches from the store the current view of the chain's [`PartialMmr`]. pub async fn get_current_partial_mmr(&self) -> Result { self.store.get_current_partial_mmr().await.map_err(Into::into) @@ -86,6 +120,30 @@ impl Client { } } +fn synthetic_offline_genesis_header() -> BlockHeader { + let native_asset_id = AccountId::try_from(OFFLINE_NATIVE_ASSET_FAUCET_ID) + .expect("offline native asset faucet ID should be valid"); + let fee_parameters = + FeeParameters::new(native_asset_id, 500).expect("offline fee params should be valid"); + let validator_key = SecretKey::with_rng(&mut rand::rng()).public_key(); + let transactions = OrderedTransactionHeaders::new_unchecked(Vec::new()); + + BlockHeader::new( + 0, + Word::empty(), + BlockNumber::GENESIS, + Blockchain::new().commitment(), + AccountTree::::default().root(), + NullifierTree::::default().root(), + BlockNoteTree::empty().root(), + transactions.commitment(), + TransactionKernel.to_commitment(), + validator_key, + fee_parameters, + 0, + ) +} + // UTILS // -------------------------------------------------------------------------------------------- @@ -156,13 +214,22 @@ pub(crate) async fn fetch_block_header( #[cfg(test)] mod tests { - use miden_protocol::block::{BlockHeader, BlockNumber}; + use alloc::vec::Vec; + + use miden_protocol::block::account_tree::AccountTree; + use miden_protocol::block::nullifier_tree::NullifierTree; + use miden_protocol::block::{BlockHeader, BlockNoteTree, BlockNumber, Blockchain}; use miden_protocol::crypto::merkle::MerklePath; use miden_protocol::crypto::merkle::mmr::{Forest, InOrderIndex, Mmr, PartialMmr}; - use miden_protocol::transaction::TransactionKernel; + use miden_protocol::crypto::merkle::smt::Smt; + use miden_protocol::transaction::{OrderedTransactionHeaders, TransactionKernel}; use miden_protocol::{Felt, Word}; - use super::{adjust_merkle_path_for_forest, authenticated_block_nodes}; + use super::{ + adjust_merkle_path_for_forest, + authenticated_block_nodes, + synthetic_offline_genesis_header, + }; fn word(n: u64) -> Word { Word::new([Felt::new(n), Felt::new(0), Felt::new(0), Felt::new(0)]) @@ -281,4 +348,21 @@ mod tests { assert_eq!(nodes[0], (InOrderIndex::from_leaf_pos(4), block_header.commitment())); assert_eq!(&nodes[1..], path_nodes.as_slice()); } + + #[test] + fn synthetic_offline_genesis_header_matches_empty_chain_state() { + let genesis = synthetic_offline_genesis_header(); + + assert_eq!(genesis.block_num(), BlockNumber::GENESIS); + assert_eq!(genesis.prev_block_commitment(), Word::empty()); + assert_eq!(genesis.chain_commitment(), Blockchain::new().commitment()); + assert_eq!(genesis.account_root(), AccountTree::::default().root()); + assert_eq!(genesis.nullifier_root(), NullifierTree::::default().root()); + assert_eq!(genesis.note_root(), BlockNoteTree::empty().root()); + assert_eq!( + genesis.tx_commitment(), + OrderedTransactionHeaders::new_unchecked(Vec::new()).commitment() + ); + assert_eq!(genesis.tx_kernel_commitment(), TransactionKernel.to_commitment()); + } } diff --git a/crates/rust-client/src/transaction/mod.rs b/crates/rust-client/src/transaction/mod.rs index 5bf70abff9..4cf29383ac 100644 --- a/crates/rust-client/src/transaction/mod.rs +++ b/crates/rust-client/src/transaction/mod.rs @@ -470,36 +470,30 @@ where advice_inputs: AdviceInputs, foreign_accounts: BTreeMap, ) -> Result<[Felt; 16], ClientError> { - let (fpi_block_number, foreign_account_inputs) = - self.retrieve_foreign_account_inputs(foreign_accounts).await?; + let (data_store, block_ref) = + self.prepare_program_execution(account_id, foreign_accounts).await?; - let block_ref = if let Some(block_number) = fpi_block_number { - block_number - } else { - self.get_sync_height().await? - }; - - let account_record = self - .store - .get_account(account_id) - .await? - .ok_or(ClientError::AccountDataNotFound(account_id))?; - - let account: Account = account_record.try_into()?; - - let data_store = ClientDataStore::new(self.store.clone(), self.rpc_api.clone()); - - data_store.register_foreign_account_inputs(foreign_account_inputs.iter().cloned()); - - // Ensure code is loaded on MAST store - data_store.mast_store().load_account_code(account.code()); + Ok(self + .build_executor(&data_store)? + .execute_tx_view_script(account_id, block_ref, tx_script, advice_inputs) + .await?) + } - for fpi_account in &foreign_account_inputs { - data_store.mast_store().load_account_code(fpi_account.code()); - } + /// Executes the provided transaction script with a DAP debug adapter listening for + /// connections, allowing interactive debugging via any DAP-compatible client. + #[cfg(feature = "dap")] + pub async fn execute_program_with_dap( + &mut self, + account_id: AccountId, + tx_script: TransactionScript, + advice_inputs: AdviceInputs, + foreign_accounts: BTreeMap, + ) -> Result<[Felt; 16], ClientError> { + let (data_store, block_ref) = + self.prepare_program_execution(account_id, foreign_accounts).await?; Ok(self - .build_executor(&data_store)? + .build_dap_executor(&data_store)? .execute_tx_view_script(account_id, block_ref, tx_script, advice_inputs) .await?) } @@ -788,6 +782,45 @@ where Ok((Some(block_num), return_foreign_account_inputs)) } + /// Prepares the data store and block reference for program execution. + /// + /// This is shared setup for both `execute_program` and `execute_program_with_dap`. + async fn prepare_program_execution( + &mut self, + account_id: AccountId, + foreign_accounts: BTreeMap, + ) -> Result<(ClientDataStore, BlockNumber), ClientError> { + let (fpi_block_number, foreign_account_inputs) = + self.retrieve_foreign_account_inputs(foreign_accounts).await?; + + let block_ref = if let Some(block_number) = fpi_block_number { + block_number + } else { + self.get_sync_height().await? + }; + + let account_record = self + .store + .get_account(account_id) + .await? + .ok_or(ClientError::AccountDataNotFound(account_id))?; + + let account: Account = account_record.try_into()?; + + let data_store = ClientDataStore::new(self.store.clone(), self.rpc_api.clone()); + + data_store.register_foreign_account_inputs(foreign_account_inputs.iter().cloned()); + + // Ensure code is loaded on MAST store + data_store.mast_store().load_account_code(account.code()); + + for fpi_account in &foreign_account_inputs { + data_store.mast_store().load_account_code(fpi_account.code()); + } + + Ok((data_store, block_ref)) + } + /// Creates a transaction executor configured with the client's runtime options, /// authenticator, and source manager. pub(crate) fn build_executor<'store, 'auth, STORE: DataStore + Sync>( @@ -802,6 +835,26 @@ where Ok(executor) } + + /// Creates a transaction executor configured for DAP (Debug Adapter Protocol) debugging. + #[cfg(feature = "dap")] + pub(crate) fn build_dap_executor<'store, 'auth, STORE: DataStore + Sync>( + &'auth self, + data_store: &'store STORE, + ) -> Result< + TransactionExecutor<'store, 'auth, STORE, AUTH, miden_debug::DapExecutor>, + TransactionExecutorError, + > { + let mut executor = TransactionExecutor::new(data_store) + .with_program_executor::() + .with_options(self.exec_options)?; + if let Some(authenticator) = self.authenticator.as_deref() { + executor = executor.with_authenticator(authenticator); + } + executor = executor.with_source_manager(self.source_manager.clone()); + + Ok(executor) + } } // HELPERS diff --git a/crates/sqlite-store/src/account/tests.rs b/crates/sqlite-store/src/account/tests.rs index d9127e08a1..198bbc4cec 100644 --- a/crates/sqlite-store/src/account/tests.rs +++ b/crates/sqlite-store/src/account/tests.rs @@ -1464,7 +1464,7 @@ async fn undo_multiple_nonces_at_once() -> anyhow::Result<()> { .interact_with_connection(move |conn| SqliteStore::get_account_header(conn, account_id)) .await? .expect("account should exist after undo"); - assert_eq!(header.nonce().as_canonical_u64(), 0); + assert_eq!(header.nonce().as_int(), 0); assert_eq!(header.to_commitment(), initial_commitment); Ok(()) @@ -1602,7 +1602,7 @@ async fn undo_after_update_removes_genuinely_new_entries() -> anyhow::Result<()> .interact_with_connection(move |conn| SqliteStore::get_account_header(conn, account_id)) .await? .expect("account should exist after undo"); - assert_eq!(header.nonce().as_canonical_u64(), 0); + assert_eq!(header.nonce().as_int(), 0); Ok(()) }