diff --git a/CHANGELOG.md b/CHANGELOG.md index 904db239b8..c662ddb5b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ - Added `GetNoteError` gRPC endpoint to query the latest execution error for network notes (https://github.com/0xMiden/node/issues/1758). - Added verbose `info!`-level logging to the network transaction builder for transaction execution, note filtering failures, and transaction outcomes ([#1770](https://github.com/0xMiden/node/pull/1770)). - [BREAKING] Move block proving from Blocker Producer to the Store ([#1579](https://github.com/0xMiden/node/pull/1579)). -- [BREAKING] Updated miden-base dependencies to use `next` branch; renamed `NoteInputs` to `NoteStorage`, `.inputs()` to `.storage()`, and database `inputs` column to `storage` ([#1595](https://github.com/0xMiden/node/pull/1595)). +- [BREAKING] Updated miden-protocol dependencies to use `next` branch; renamed `NoteInputs` to `NoteStorage`, `.inputs()` to `.storage()`, and database `inputs` column to `storage` ([#1595](https://github.com/0xMiden/node/pull/1595)). - Validator now persists validated transactions ([#1614](https://github.com/0xMiden/node/pull/1614)). - [BREAKING] Remove `SynState` and introduce `SyncChainMmr` ([#1591](https://github.com/0xMiden/node/issues/1591)). - Introduce `SyncChainMmr` RPC endpoint to sync chain MMR deltas within specified block ranges ([#1591](https://github.com/0xMiden/node/issues/1591)). diff --git a/Cargo.lock b/Cargo.lock index d2a98a3592..cb96c5e3f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,6 +51,81 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "alloy-primitives" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3b431b4e72cd8bd0ec7a50b4be18e73dab74de0dba180eef171055e5d5926e" +dependencies = [ + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "itoa", + "paste", + "ruint", + "rustc-hash", + "sha3", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab81bab693da9bb79f7a95b64b394718259fdd7e41dceeced4cad57cb71c4f6a" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489f1620bb7e2483fb5819ed01ab6edc1d2f93939dce35a5695085a1afd1d699" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "sha3", + "syn 2.0.117", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56cef806ad22d4392c5fc83cf8f2089f988eb99c7067b4e0c6f1971fc1cca318" +dependencies = [ + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.117", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-types" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64612d29379782a5dde6f4b6570d9c756d734d760c0c94c254d361e678a6591f" +dependencies = [ + "alloy-primitives", + "alloy-sol-macro", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -73,7 +148,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", - "anstyle-parse", + "anstyle-parse 0.2.7", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse 1.0.0", "anstyle-query", "anstyle-wincon", "colorchoice", @@ -83,9 +173,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" @@ -96,6 +186,15 @@ dependencies = [ "utf8parse", ] +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + [[package]] name = "anstyle-query" version = "1.1.5" @@ -118,12 +217,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" -dependencies = [ - "backtrace", -] +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "arrayref" @@ -160,7 +256,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -177,9 +273,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-config" -version = "1.8.14" +version = "1.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a8fc176d53d6fe85017f230405e3255cedb4a02221cb55ed6d76dccbbb099b2" +checksum = "11493b0bad143270fb8ad284a096dd529ba91924c5409adeac856cc1bf047dbc" dependencies = [ "aws-credential-types", "aws-runtime", @@ -197,7 +293,7 @@ dependencies = [ "fastrand", "hex", "http 1.4.0", - "ring", + "sha1", "time", "tokio", "tracing", @@ -207,9 +303,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.2.12" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e26bbf46abc608f2dc61fd6cb3b7b0665497cc259a21520151ed98f8b37d2c79" +checksum = "8f20799b373a1be121fe3005fba0c2090af9411573878f224df44b42727fcaf7" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -219,9 +315,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.15.4" +version = "1.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7b6141e96a8c160799cc2d5adecd5cbbe5054cb8c7c4af53da0f83bb7ad256" +checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" dependencies = [ "aws-lc-sys", "zeroize", @@ -229,9 +325,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.37.1" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b092fe214090261288111db7a2b2c2118e5a7f30dc2569f1732c4069a6840549" +checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a" dependencies = [ "cc", "cmake", @@ -241,9 +337,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.7.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f92058d22a46adf53ec57a6a96f34447daf02bff52e8fb956c66bcd5c6ac12" +checksum = "5fc0651c57e384202e47153c1260b84a9936e19803d747615edf199dc3b98d17" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -266,9 +362,9 @@ dependencies = [ [[package]] name = "aws-sdk-kms" -version = "1.100.0" +version = "1.104.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723700afe7459a33d1ac30852e9208b801946c032625cc8c808f57b9563bb5c7" +checksum = "c41ae6a33da941457e89075ef8ca5b4870c8009fe4dceeba82fce2f30f313ac6" dependencies = [ "aws-credential-types", "aws-runtime", @@ -290,9 +386,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.94.0" +version = "1.97.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "699da1961a289b23842d88fe2984c6ff68735fdf9bdcbc69ceaeb2491c9bf434" +checksum = "9aadc669e184501caaa6beafb28c6267fc1baef0810fb58f9b205485ca3f2567" dependencies = [ "aws-credential-types", "aws-runtime", @@ -314,9 +410,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.96.0" +version = "1.99.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e3a4cb3b124833eafea9afd1a6cc5f8ddf3efefffc6651ef76a03cbc6b4981" +checksum = "1342a7db8f358d3de0aed2007a0b54e875458e39848d54cc1d46700b2bfcb0a8" dependencies = [ "aws-credential-types", "aws-runtime", @@ -338,9 +434,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.98.0" +version = "1.101.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89c4f19655ab0856375e169865c91264de965bd74c407c7f1e403184b1049409" +checksum = "ab41ad64e4051ecabeea802d6a17845a91e83287e1dd249e6963ea1ba78c428a" dependencies = [ "aws-credential-types", "aws-runtime", @@ -363,9 +459,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f6ae9b71597dc5fd115d52849d7a5556ad9265885ad3492ea8d73b93bbc46e" +checksum = "b0b660013a6683ab23797778e21f1f854744fdf05f68204b4cca4c8c04b5d1f4" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -385,9 +481,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.12" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cba48474f1d6807384d06fec085b909f5807e16653c5af5c45dfe89539f0b70" +checksum = "2ffcaf626bdda484571968400c326a244598634dc75fd451325a54ad1a59acfc" dependencies = [ "futures-util", "pin-project-lite", @@ -396,9 +492,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.63.4" +version = "0.63.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4a8a5fe3e4ac7ee871237c340bbce13e982d37543b65700f4419e039f5d78e" +checksum = "ba1ab2dc1c2c3749ead27180d333c42f11be8b0e934058fb4b2258ee8dbe5231" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -417,9 +513,9 @@ dependencies = [ [[package]] name = "aws-smithy-http-client" -version = "1.1.10" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0709f0083aa19b704132684bc26d3c868e06bd428ccc4373b0b55c3e8748a58b" +checksum = "6a2f165a7feee6f263028b899d0a181987f4fa7179a6411a32a439fba7c5f769" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -436,7 +532,7 @@ dependencies = [ "hyper-util", "pin-project-lite", "rustls 0.21.12", - "rustls 0.23.36", + "rustls 0.23.37", "rustls-native-certs", "rustls-pki-types", "tokio", @@ -447,27 +543,27 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.62.4" +version = "0.62.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b3a779093e18cad88bbae08dc4261e1d95018c4c5b9356a52bcae7c0b6e9bb" +checksum = "9648b0bb82a2eedd844052c6ad2a1a822d1f8e3adee5fbf668366717e428856a" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-observability" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3f39d5bb871aaf461d59144557f16d5927a5248a983a40654d9cf3b9ba183b" +checksum = "a06c2315d173edbf1920da8ba3a7189695827002e4c0fc961973ab1c54abca9c" dependencies = [ "aws-smithy-runtime-api", ] [[package]] name = "aws-smithy-query" -version = "0.60.14" +version = "0.60.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f76a580e3d8f8961e5d48763214025a2af65c2fa4cd1fb7f270a0e107a71b0" +checksum = "1a56d79744fb3edb5d722ef79d86081e121d3b9422cb209eb03aea6aa4f21ebd" dependencies = [ "aws-smithy-types", "urlencoding", @@ -475,9 +571,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.10.1" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd3dfc18c1ce097cf81fced7192731e63809829c6cbf933c1ec47452d08e1aa" +checksum = "028999056d2d2fd58a697232f9eec4a643cf73a71cf327690a7edad1d2af2110" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -500,9 +596,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.11.4" +version = "1.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c55e0837e9b8526f49e0b9bfa9ee18ddee70e853f5bc09c5d11ebceddcb0fec" +checksum = "876ab3c9c29791ba4ba02b780a3049e21ec63dabda09268b175272c3733a79e6" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -517,9 +613,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.4.4" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576b0d6991c9c32bc14fc340582ef148311f924d41815f641a308b5d11e8e7cd" +checksum = "9d73dbfbaa8e4bc57b9045137680b958d274823509a360abfd8e1d514d40c95c" dependencies = [ "base64-simd", "bytes", @@ -543,18 +639,18 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.14" +version = "0.60.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b53543b4b86ed43f051644f704a98c7291b3618b67adf057ee77a366fa52fcaa" +checksum = "0ce02add1aa3677d022f8adf81dcbe3046a95f17a1b1e8979c145cd21d3d22b3" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.3.12" +version = "1.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c50f3cdf47caa8d01f2be4a6663ea02418e892f9bbfd82c7b9a3a37eaccdd3a" +checksum = "47c8323699dd9b3c8d5b3c13051ae9cdef58fd179957c882f8374dd8725962d9" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -693,6 +789,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bindgen" version = "0.72.1" @@ -708,7 +813,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -728,9 +833,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "blake3" @@ -766,9 +871,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.1" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "byteorder" @@ -810,9 +915,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.54" +version = "1.2.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" dependencies = [ "find-msvc-tools", "jobserver", @@ -873,9 +978,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", "js-sys", @@ -935,9 +1040,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.55" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" dependencies = [ "clap_builder", "clap_derive", @@ -945,11 +1050,11 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.55" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ - "anstream", + "anstream 1.0.0", "anstyle", "clap_lex", "strsim", @@ -957,21 +1062,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "clap_lex" -version = "0.7.7" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cmake" @@ -984,9 +1089,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "combine" @@ -998,6 +1103,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "const-hex" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" +dependencies = [ + "cfg-if", + "cpufeatures", + "proptest", + "serde_core", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -1010,6 +1127,15 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1158,7 +1284,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1182,7 +1308,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1193,7 +1319,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1263,9 +1389,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.5.5" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ "powerfmt", ] @@ -1285,17 +1411,19 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" dependencies = [ + "convert_case", "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.114", + "syn 2.0.117", + "unicode-xid", ] [[package]] name = "diesel" -version = "2.3.6" +version = "2.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b6c2fc184a6fb6ebcf5f9a5e3bbfa84d8fd268cdfcce4ed508979a6259494d" +checksum = "f4ae09a41a4b89f94ec1e053623da8340d996bc32c6517d325a9daad9b239358" dependencies = [ "bigdecimal", "diesel_derives", @@ -1318,7 +1446,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1338,7 +1466,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe2444076b48641147115697648dc743c2c00b61adade0f01ce67133c7babe8c" dependencies = [ - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1367,14 +1495,14 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "dissimilar" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921" +checksum = "aeda16ab4059c5fd2a83f2b9c9e9c981327b18aa8e3b313f7e6563799d4f093e" [[package]] name = "downcast-rs" @@ -1393,7 +1521,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -1468,9 +1596,9 @@ dependencies = [ [[package]] name = "ena" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +checksum = "eabffdaee24bd1bf95c5ef7cec31260444317e72ea56c4c91750e8b7ee58d5f1" dependencies = [ "log", ] @@ -1486,9 +1614,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" dependencies = [ "log", "regex", @@ -1496,11 +1624,11 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" dependencies = [ - "anstream", + "anstream 0.6.21", "anstyle", "env_filter", "jiff", @@ -1547,9 +1675,9 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "find-msvc-tools" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "fixed-hash" @@ -1575,7 +1703,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin", + "spin 0.9.8", ] [[package]] @@ -1617,9 +1745,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "3.2.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf68cef89750956493a66a10f512b9e58d9db21f2a573c079c0bdf1207a54a7" +checksum = "73fde052dbfc920003cfd2c8e2c6e6d4cc7c1091538c3a24226cec0665ab08c0" dependencies = [ "autocfg", ] @@ -1632,9 +1760,9 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" dependencies = [ "futures-channel", "futures-core", @@ -1647,9 +1775,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", @@ -1657,15 +1785,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" dependencies = [ "futures-core", "futures-task", @@ -1674,32 +1802,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-timer" @@ -1709,9 +1837,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-channel", "futures-core", @@ -1721,7 +1849,6 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", - "pin-utils", "slab", ] @@ -1773,21 +1900,21 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi", + "r-efi 6.0.0", "wasip2", "wasip3", "wasm-bindgen", @@ -1822,7 +1949,7 @@ dependencies = [ "parking_lot", "portable-atomic", "quanta", - "rand", + "rand 0.9.2", "smallvec", "spinning_top", "web-time", @@ -1912,9 +2039,6 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash 0.2.0", - "rayon", - "serde", - "serde_core", ] [[package]] @@ -2097,7 +2221,7 @@ dependencies = [ "http 1.4.0", "hyper 1.8.1", "hyper-util", - "rustls 0.23.36", + "rustls 0.23.37", "rustls-native-certs", "rustls-pki-types", "tokio", @@ -2120,14 +2244,13 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ "base64", "bytes", "futures-channel", - "futures-core", "futures-util", "http 1.4.0", "http-body 1.0.1", @@ -2136,7 +2259,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.2", + "socket2 0.6.3", "system-configuration", "tokio", "tower-service", @@ -2146,9 +2269,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2311,9 +2434,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "iri-string" @@ -2357,15 +2480,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" -version = "0.2.18" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" dependencies = [ "jiff-static", "log", @@ -2376,13 +2499,13 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.18" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -2419,9 +2542,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.85" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" dependencies = [ "once_cell", "wasm-bindgen", @@ -2461,7 +2584,7 @@ dependencies = [ "ena", "itertools 0.14.0", "lalrpop-util", - "petgraph", + "petgraph 0.7.1", "regex", "regex-syntax", "sha3", @@ -2494,9 +2617,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.180" +version = "0.2.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libloading" @@ -2541,9 +2664,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.23" +version = "1.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d118bbf3771060e7311cc7bb0545b01d08a8b4a7de949198dec1fa0ca1c0f7" +checksum = "d52f4c29e2a68ac30c9087e1b772dc9f44a2b66ed44edf2266cf2be9b03dafc1" dependencies = [ "cc", "pkg-config", @@ -2552,15 +2675,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" @@ -2605,7 +2722,7 @@ dependencies = [ "quote", "regex-syntax", "rustc_version 0.4.1", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -2652,6 +2769,17 @@ dependencies = [ "libc", ] +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "matchers" version = "0.2.0" @@ -2675,16 +2803,17 @@ checksum = "120fa187be19d9962f0926633453784691731018a2bf936ddb4e29101b79c4a7" [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "miden-agglayer" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563f709601fc773bcb1782f0f5f1930894dbc627341df4af2bbd5040f21f4532" +checksum = "98863d46f0f288b03f52a4591230b6ddded2b2110b4e0f9268d4b6f19efe49ba" dependencies = [ + "alloy-sol-types", "fs-err", "miden-assembly", "miden-core", @@ -2701,22 +2830,22 @@ dependencies = [ [[package]] name = "miden-air" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cca9632323bd4e32ae5b21b101ed417a646f5d72196b1bf3f1ca889a148322a" +checksum = "5322d00bef8b19f4cd3415da2533a87c8860c7d9b80043d6cce0f184b40c5fff" dependencies = [ "miden-core", + "miden-crypto", "miden-utils-indexing", "thiserror 2.0.18", - "winter-air", - "winter-prover", + "tracing", ] [[package]] name = "miden-assembly" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2395b2917aea613a285d3425d1ca07e6c45442e2b34febdea2081db555df62fc" +checksum = "7ece22da0cbf350e4a2939a07eaa3200445e42e47ce1b1ee6538723b6b40a4d4" dependencies = [ "env_logger", "log", @@ -2729,9 +2858,9 @@ dependencies = [ [[package]] name = "miden-assembly-syntax" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f9bed037d137f209b9e7b28811ec78c0536b3f9259d6f4ceb5823c87513b346" +checksum = "d84a0e14ce66e76497a6771f3e360eb85557f2417ea22db279d54c1238ffafde" dependencies = [ "aho-corasick", "env_logger", @@ -2753,9 +2882,9 @@ dependencies = [ [[package]] name = "miden-block-prover" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7a73ebc8160af69c330a722263a83bd7f01103ff3c91b47b8ee7fb6b887726" +checksum = "9710309c899f329e92853b1e396d01d6d0876dc5a95555b786cf7e6c93eae5bd" dependencies = [ "miden-protocol", "thiserror 2.0.18", @@ -2763,9 +2892,9 @@ dependencies = [ [[package]] name = "miden-core" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8714aa5f86c59e647b7417126b32adc4ef618f835964464f5425549df76b6d03" +checksum = "7bf4f5601b0d669aa125cce3bba4b98f2c8df729e2d53e66777429ac5f53e228" dependencies = [ "derive_more", "itertools 0.14.0", @@ -2774,20 +2903,19 @@ dependencies = [ "miden-formatting", "miden-utils-core-derive", "miden-utils-indexing", + "miden-utils-sync", "num-derive", "num-traits", "proptest", "proptest-derive", "thiserror 2.0.18", - "winter-math", - "winter-utils", ] [[package]] name = "miden-core-lib" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb16a4d39202c59a7964d3585cd5af21a46a759ff6452cb5f20723ed5af4362" +checksum = "82595fabb062315c32f6fc11c31755d3e5c6f8bc8c67d35154a067397d65b1de" dependencies = [ "env_logger", "fs-err", @@ -2796,15 +2924,14 @@ dependencies = [ "miden-crypto", "miden-processor", "miden-utils-sync", - "sha2", "thiserror 2.0.18", ] [[package]] name = "miden-crypto" -version = "0.19.8" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be59336a868de7c379eace9450563c2d7f4a0b7ab936835ec5a340dcd8d9a5ed" +checksum = "0ed0a034a460e27723dcfdf25effffab84331c3b46b13e7a1bd674197cc71bfe" dependencies = [ "blake3", "cc", @@ -2813,42 +2940,51 @@ dependencies = [ "ed25519-dalek", "flume", "glob", - "hashbrown 0.16.1", "hkdf", "k256", "miden-crypto-derive", + "miden-field", + "miden-serde-utils", "num", "num-complex", - "rand", + "p3-blake3", + "p3-challenger", + "p3-dft", + "p3-goldilocks", + "p3-keccak", + "p3-matrix", + "p3-maybe-rayon", + "p3-miden-lifted-stark", + "p3-symmetric", + "p3-util", + "rand 0.9.2", "rand_chacha", "rand_core 0.9.5", "rand_hc", "rayon", + "serde", "sha2", "sha3", "subtle", "thiserror 2.0.18", - "winter-crypto", - "winter-math", - "winter-utils", "x25519-dalek", ] [[package]] name = "miden-crypto-derive" -version = "0.19.6" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550b5656b791fec59c0b6089b4d0368db746a34749ccd47e59afb01aa877e9e" +checksum = "e8bf6ebde028e79bcc61a3632d2f375a5cc64caa17d014459f75015238cb1e08" dependencies = [ "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "miden-debug-types" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1494f102ad5b9fa43e391d2601186dc601f41ab7dcd8a23ecca9bf3ef930f4" +checksum = "c9ef08bafef275f0d6a15108108b3f6df6642772e0a1c05e102cb7e96841e888" dependencies = [ "memchr", "miden-crypto", @@ -2862,6 +2998,24 @@ dependencies = [ "thiserror 2.0.18", ] +[[package]] +name = "miden-field" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38011348f4fb4c9e5ce1f471203d024721c00e3b60a91aa91aaefe6738d8b5ea" +dependencies = [ + "miden-serde-utils", + "num-bigint", + "p3-challenger", + "p3-field", + "p3-goldilocks", + "paste", + "rand 0.10.0", + "serde", + "subtle", + "thiserror 2.0.18", +] + [[package]] name = "miden-formatting" version = "0.1.1" @@ -2873,7 +3027,7 @@ dependencies = [ [[package]] name = "miden-genesis" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "clap", @@ -2884,7 +3038,7 @@ dependencies = [ "miden-node-utils", "miden-protocol", "miden-standards", - "rand", + "rand 0.9.2", "rand_chacha", "tempfile", "tokio", @@ -2892,25 +3046,25 @@ dependencies = [ [[package]] name = "miden-large-smt-backend-rocksdb" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "miden-crypto", "miden-node-rocksdb-cxx-linkage-fix", "miden-protocol", "rayon", "rocksdb", - "winter-utils", ] [[package]] name = "miden-mast-package" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692185bfbe0ecdb28bf623f1f8c88282cd6727ba081a28e23b301bdde1b45be4" +checksum = "f9b24d09fda64e0751f943ac616643342b05a47d626e2ee0040b902eff3c924e" dependencies = [ "derive_more", "miden-assembly-syntax", "miden-core", + "miden-debug-types", "thiserror 2.0.18", ] @@ -2920,8 +3074,6 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eef536978f24a179d94fa2a41e4f92b28e7d8aab14b8d23df28ad2a3d7098b20" dependencies = [ - "backtrace", - "backtrace-ext", "cfg-if", "futures", "indenter", @@ -2932,13 +3084,9 @@ dependencies = [ "rustc_version 0.2.3", "rustversion", "serde_json", - "spin", + "spin 0.9.8", "strip-ansi-escapes", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "syn 2.0.114", - "terminal_size 0.3.0", + "syn 2.0.117", "textwrap", "thiserror 2.0.18", "trybuild", @@ -2953,12 +3101,12 @@ checksum = "86a905f3ea65634dd4d1041a4f0fd0a3e77aa4118341d265af1a94339182222f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "miden-network-monitor" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "axum", @@ -2971,7 +3119,7 @@ dependencies = [ "miden-standards", "miden-testing", "miden-tx", - "rand", + "rand 0.9.2", "rand_chacha", "reqwest", "serde", @@ -2986,7 +3134,7 @@ dependencies = [ [[package]] name = "miden-node" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "clap", @@ -3006,7 +3154,7 @@ dependencies = [ [[package]] name = "miden-node-block-producer" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "assert_matches", @@ -3024,7 +3172,7 @@ dependencies = [ "miden-tx", "miden-tx-batch-prover", "pretty_assertions", - "rand", + "rand 0.9.2", "rand_chacha", "rstest", "serial_test", @@ -3037,12 +3185,11 @@ dependencies = [ "tower-http", "tracing", "url", - "winterfell", ] [[package]] name = "miden-node-db" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "deadpool", "deadpool-diesel", @@ -3055,15 +3202,15 @@ dependencies = [ [[package]] name = "miden-node-grpc-error-macro" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "miden-node-ntx-builder" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "build-rs", @@ -3096,7 +3243,7 @@ dependencies = [ [[package]] name = "miden-node-proto" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "assert_matches", @@ -3121,7 +3268,7 @@ dependencies = [ [[package]] name = "miden-node-proto-build" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "build-rs", "fs-err", @@ -3132,17 +3279,16 @@ dependencies = [ [[package]] name = "miden-node-rocksdb-cxx-linkage-fix" -version = "0.14.0-alpha.8" +version = "0.14.0" [[package]] name = "miden-node-rpc" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "futures", "http 1.4.0", "mediatype", - "miden-air", "miden-node-proto", "miden-node-proto-build", "miden-node-store", @@ -3168,7 +3314,7 @@ dependencies = [ [[package]] name = "miden-node-store" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "assert_matches", @@ -3196,7 +3342,7 @@ dependencies = [ "miden-remote-prover-client", "miden-standards", "pretty_assertions", - "rand", + "rand 0.9.2", "rand_chacha", "regex", "serde", @@ -3205,7 +3351,7 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tokio-stream", - "toml 1.0.3+spec-1.1.0", + "toml 1.0.7+spec-1.1.0", "tonic", "tonic-reflection", "tower-http", @@ -3215,19 +3361,18 @@ dependencies = [ [[package]] name = "miden-node-stress-test" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "clap", "fs-err", "futures", - "miden-air", "miden-node-block-producer", "miden-node-proto", "miden-node-store", "miden-node-utils", "miden-protocol", "miden-standards", - "rand", + "rand 0.9.2", "rayon", "tokio", "tonic", @@ -3239,12 +3384,12 @@ name = "miden-node-test-macro" version = "0.1.0" dependencies = [ "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "miden-node-utils" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "bytes", @@ -3261,7 +3406,7 @@ dependencies = [ "opentelemetry", "opentelemetry-otlp", "opentelemetry_sdk", - "rand", + "rand 0.9.2", "thiserror 2.0.18", "tokio", "tonic", @@ -3277,7 +3422,7 @@ dependencies = [ [[package]] name = "miden-node-validator" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "aws-config", @@ -3302,9 +3447,9 @@ dependencies = [ [[package]] name = "miden-processor" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e09f7916b1e7505f74a50985a185fdea4c0ceb8f854a34c90db28e3f7da7ab6" +checksum = "ba53ff06ef0affa0c3fb13e7e2ef5bde99f96eebcec8c360c6658050480ef676" dependencies = [ "itertools 0.14.0", "miden-air", @@ -3317,14 +3462,13 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tracing", - "winter-prover", ] [[package]] name = "miden-protocol" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa3569c557146d3c4a4f48449f5c14ec94c43b6d22491d79c2b87617ac06ce8" +checksum = "38c30a20ea30071544a827d0daa12e343e444c1e314d1a4560c43f2d6c7b43c6" dependencies = [ "bech32", "fs-err", @@ -3339,46 +3483,49 @@ dependencies = [ "miden-protocol-macros", "miden-utils-sync", "miden-verifier", - "rand", + "rand 0.9.2", "rand_chacha", "rand_xoshiro", "regex", "semver 1.0.27", "serde", "thiserror 2.0.18", - "toml 0.9.11+spec-1.1.0", + "toml 1.0.7+spec-1.1.0", "walkdir", - "winter-rand-utils", ] [[package]] name = "miden-protocol-macros" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e32fb40b2bc29e534da52691d3cd32d0207878171128d0ce5c2d2ecfa019fc5" +checksum = "76c58e1d47dd08af461f6aa13ec128013bb1a26183ea4dd42f323939bcbf72d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "miden-prover" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d45e30526be72b8af0fd1d8b24c9cba8ac1187ca335dcee38b8e5e20234e7698" +checksum = "15462425359e87540d92e277cf1174a85a174ca433bd63d27286f65ab318f2d4" dependencies = [ + "bincode", "miden-air", + "miden-core", + "miden-crypto", "miden-debug-types", "miden-processor", + "serde", + "thiserror 2.0.18", + "tokio", "tracing", - "winter-maybe-async", - "winter-prover", ] [[package]] name = "miden-remote-prover" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "anyhow", "assert_matches", @@ -3415,11 +3562,11 @@ dependencies = [ [[package]] name = "miden-remote-prover-client" -version = "0.14.0-alpha.8" +version = "0.14.0" dependencies = [ "build-rs", "fs-err", - "getrandom 0.4.1", + "getrandom 0.4.2", "miden-node-proto-build", "miden-protocol", "miden-tx", @@ -3434,11 +3581,21 @@ dependencies = [ "tonic-web-wasm-client", ] +[[package]] +name = "miden-serde-utils" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff78082e9b4ca89863e68da01b35f8a4029ee6fd912e39fa41fde4273a7debab" +dependencies = [ + "p3-field", + "p3-goldilocks", +] + [[package]] name = "miden-standards" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83ef3e49765ac3aa2a1defc853e0b130dfbd8480d91c9e49696d51186cdf839" +checksum = "612af5b544a25e318d89dca9ac958d436f9a8b209be4dda6ee2df0c21c58548e" dependencies = [ "fs-err", "miden-assembly", @@ -3446,7 +3603,7 @@ dependencies = [ "miden-core-lib", "miden-processor", "miden-protocol", - "rand", + "rand 0.9.2", "regex", "thiserror 2.0.18", "walkdir", @@ -3454,9 +3611,9 @@ dependencies = [ [[package]] name = "miden-testing" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98fb3700334c2b30c1e92966e3585c6790efb647b70c9eeef7c02423137c1782" +checksum = "982fb99a73d12abc6088562be1f606f24cbb2673e832ba872bf86d6add566638" dependencies = [ "anyhow", "itertools 0.14.0", @@ -3470,17 +3627,16 @@ dependencies = [ "miden-standards", "miden-tx", "miden-tx-batch-prover", - "rand", + "rand 0.9.2", "rand_chacha", "thiserror 2.0.18", - "winterfell", ] [[package]] name = "miden-tx" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e32105298b8fc6d0b9ae9f037c3243bcca5a1f31c27f90310856e468c01f8" +checksum = "18e32f06ec896176724bbb29de6c655f856e5444319cd3824c921511cde24f87" dependencies = [ "miden-processor", "miden-protocol", @@ -3492,9 +3648,9 @@ dependencies = [ [[package]] name = "miden-tx-batch-prover" -version = "0.14.0-alpha.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d4ac3e1778203c3336630311c8cfd0af77672356f96cd623d3c3e2398456fd" +checksum = "eb6bd365128454fe630a5441d1cf99297b6e1bba56923f00b97c1df485c37b90" dependencies = [ "miden-protocol", "miden-tx", @@ -3502,9 +3658,9 @@ dependencies = [ [[package]] name = "miden-utils-core-derive" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b1d490e6d7b509622d3c2cc69ffd66ad48bf953dc614579b568fe956ce0a6c" +checksum = "477db426fc31f666d7e65b0cc907fe431d36d88d611a0594cf266104eb168b4c" dependencies = [ "proc-macro2", "quote", @@ -3513,9 +3669,9 @@ dependencies = [ [[package]] name = "miden-utils-diagnostics" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52658f6dc091c1c78e8b35ee3e7ff3dad53051971a3c514e461f581333758fe7" +checksum = "785c1ec4ad9994100b117b8eab8c453dcc35d3d168e4f72ac818efb700abe7b1" dependencies = [ "miden-crypto", "miden-debug-types", @@ -3526,44 +3682,51 @@ dependencies = [ [[package]] name = "miden-utils-indexing" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff7bcb7875b222424bdfb657a7cf21a55e036aa7558ebe1f5d2e413b440d0d" +checksum = "46cec00c8cf32ec46df7542fb9ea15fbe7a5149920ef97776a4f4bc3a563e8de" dependencies = [ + "miden-crypto", "thiserror 2.0.18", ] [[package]] name = "miden-utils-sync" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d53d1ab5b275d8052ad9c4121071cb184bc276ee74354b0d8a2075e5c1d1f0" +checksum = "9529c1c173506f30d3949f7a54b65f1eb318098e37ed5730a1bb9027eee2fa4b" dependencies = [ "lock_api", "loom", + "once_cell", "parking_lot", ] [[package]] name = "miden-verifier" -version = "0.20.6" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13816663794beb15c8a4721c15252eb21f3b3233525684f60c7888837a98ff4" +checksum = "997c842047ffa2d011eb65bf638a3135b2d52bce5b20770fcc6040f1b48c624a" dependencies = [ + "bincode", "miden-air", "miden-core", + "miden-crypto", + "serde", "thiserror 2.0.18", "tracing", - "winter-verifier", ] [[package]] name = "midenc-hir-type" -version = "0.4.3" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d4cfab04baffdda3fb9eafa5f873604059b89a1699aa95e4f1057397a69f0b5" +checksum = "2eb29d7c049fb69373c7e775e3d4411e63e4ee608bc43826282ba62c6ec9f891" dependencies = [ "miden-formatting", + "miden-serde-utils", + "serde", + "serde_repr", "smallvec", "thiserror 2.0.18", ] @@ -3582,7 +3745,7 @@ dependencies = [ "supports-color", "supports-hyperlinks", "supports-unicode", - "terminal_size 0.4.3", + "terminal_size", "textwrap", "unicode-width 0.1.14", ] @@ -3595,7 +3758,7 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3605,7 +3768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36c791ecdf977c99f45f23280405d7723727470f6689a5e6dbf513ac547ae10d" dependencies = [ "serde", - "toml 0.9.11+spec-1.1.0", + "toml 0.9.12+spec-1.1.0", ] [[package]] @@ -3750,7 +3913,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -3815,9 +3978,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" @@ -3859,9 +4022,9 @@ dependencies = [ [[package]] name = "opentelemetry-otlp" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2366db2dca4d2ad033cad11e6ee42844fd727007af5ad04a1730f4cb8163bf" +checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" dependencies = [ "http 1.4.0", "opentelemetry", @@ -3897,7 +4060,7 @@ dependencies = [ "futures-util", "opentelemetry", "percent-encoding", - "rand", + "rand 0.9.2", "thiserror 2.0.18", "tokio", "tokio-stream", @@ -3911,63 +4074,389 @@ checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "owo-colors" -version = "4.2.3" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" +checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" [[package]] -name = "page_size" -version = "0.6.0" +name = "p3-air" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +checksum = "9ebc58ec27a174420348b3f04dba836fa2e5b5fe8df74601087417352757c643" dependencies = [ - "libc", - "winapi", + "p3-field", + "p3-matrix", + "tracing", ] [[package]] -name = "parking_lot" -version = "0.12.5" +name = "p3-blake3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +checksum = "b3cacb38c29fbee71fe3e5c6c0a1073632e46dc3e93fbdc50ab4e4fac137b525" dependencies = [ - "lock_api", - "parking_lot_core", + "blake3", + "p3-symmetric", + "p3-util", ] [[package]] -name = "parking_lot_core" -version = "0.9.12" +name = "p3-challenger" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +checksum = "af9bbcb18fe90271668259aacfc43455e328673c2b5c926cff0663edc8653e4d" dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link", + "p3-field", + "p3-maybe-rayon", + "p3-monty-31", + "p3-symmetric", + "p3-util", + "tracing", ] [[package]] -name = "paste" -version = "1.0.15" +name = "p3-commit" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "14d07b50c6f6d3bc89ed7c54ae0c569fb4caaa58263fd389dc02fb1b0a6378fa" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-matrix", + "p3-util", + "serde", +] [[package]] -name = "percent-encoding" -version = "2.3.2" +name = "p3-dft" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +checksum = "17e7ba0dc20be075eab3f88f0cb820a0901f86218a1c46134e7c817d41597989" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "spin 0.10.0", + "tracing", +] [[package]] -name = "petgraph" -version = "0.7.1" +name = "p3-field" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +checksum = "9b8533e6c2f4d0cc61fd2ae5299bb83316898e535f47291808d37e4d666ba088" dependencies = [ - "fixedbitset", - "indexmap", + "itertools 0.14.0", + "num-bigint", + "p3-maybe-rayon", + "p3-util", + "paste", + "rand 0.10.0", + "serde", + "tracing", +] + +[[package]] +name = "p3-goldilocks" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8102a8c85acee1f896c3764bef5fac908e6026dadfc557c185294970cce0746" +dependencies = [ + "num-bigint", + "p3-challenger", + "p3-dft", + "p3-field", + "p3-mds", + "p3-poseidon1", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "paste", + "rand 0.10.0", + "serde", +] + +[[package]] +name = "p3-keccak" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65d30dd586d2855906a01c3414c155c2d564f6677d1b51f04186dcac080f757" +dependencies = [ + "p3-symmetric", + "p3-util", + "tiny-keccak", +] + +[[package]] +name = "p3-matrix" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72bb78444459155c2e4711d71abbfef7b04cc2ba1fa83751ccab241b01957095" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand 0.10.0", + "serde", + "tracing", +] + +[[package]] +name = "p3-maybe-rayon" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a0a54345917f500130a9986fa5ff9ecbc26f0c6313080b35b713e26ddc8053" +dependencies = [ + "rayon", +] + +[[package]] +name = "p3-mds" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd514bf3e9bf9f1b7db2db96e5bd2972d9963dd62430de1e193d74522ae96a6" +dependencies = [ + "p3-dft", + "p3-field", + "p3-symmetric", + "p3-util", + "rand 0.10.0", +] + +[[package]] +name = "p3-miden-lifted-air" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5c31c65fdc88952d7b301546add9670676e5b878aa0066dd929f107c203b006" +dependencies = [ + "p3-air", + "p3-field", + "p3-matrix", + "p3-util", + "thiserror 2.0.18", +] + +[[package]] +name = "p3-miden-lifted-fri" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab9932f1b0a16609a45cd4ee10a4d35412728bc4b38837c7979d7c85d8dcc9fc" +dependencies = [ + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-miden-lmcs", + "p3-miden-transcript", + "p3-util", + "rand 0.10.0", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "p3-miden-lifted-stark" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3956ab7270c3cdd53ca9796d39ae1821984eb977415b0672110f9666bff5d8" +dependencies = [ + "p3-challenger", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-miden-lifted-air", + "p3-miden-lifted-fri", + "p3-miden-lmcs", + "p3-miden-stateful-hasher", + "p3-miden-transcript", + "p3-util", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "p3-miden-lmcs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c46791c983e772136db3d48f102431457451447abb9087deb6c8ce3c1efc86" +dependencies = [ + "p3-commit", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-miden-stateful-hasher", + "p3-miden-transcript", + "p3-symmetric", + "p3-util", + "rand 0.10.0", + "serde", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "p3-miden-stateful-hasher" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec47a9d9615eb3d9d2a59b00d19751d9ad85384b55886827913d680d912eac6a" +dependencies = [ + "p3-field", + "p3-symmetric", +] + +[[package]] +name = "p3-miden-transcript" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c565647487e4a949f67e6f115b0391d6cb82ac8e561165789939bab23d0ae7" +dependencies = [ + "p3-challenger", + "p3-field", + "serde", + "thiserror 2.0.18", +] + +[[package]] +name = "p3-monty-31" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d9340a650f07a6cd42a4e877017ba7b206df87fe50dfc3cf110f01a3c370bd1" +dependencies = [ + "itertools 0.14.0", + "num-bigint", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-mds", + "p3-poseidon1", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "paste", + "rand 0.10.0", + "serde", + "spin 0.10.0", + "tracing", +] + +[[package]] +name = "p3-poseidon1" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd56ae3a51ded1b77f7b1b21d0b157ae82b9d5ca8f2cba347c0b821fe771a79" +dependencies = [ + "p3-field", + "p3-symmetric", + "rand 0.10.0", +] + +[[package]] +name = "p3-poseidon2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "858aa1c33ec983dfbb8cfc553a213de19d8fde96485e54e6e952b9ac5e70bd4e" +dependencies = [ + "p3-field", + "p3-mds", + "p3-symmetric", + "p3-util", + "rand 0.10.0", +] + +[[package]] +name = "p3-symmetric" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9a3b20bb8104e52d45219a78d80654c8ac6a4781be0eaa3f3e999f5ae4b9b2" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-util", + "serde", +] + +[[package]] +name = "p3-util" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f24495d9cd64693165a9f1b3da0758395ad6d25d2d44dd740bdb34c2bce0c53" +dependencies = [ + "rayon", + "serde", + "transpose", +] + +[[package]] +name = "page_size" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "petgraph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap", ] [[package]] @@ -3981,29 +4470,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.10" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.10" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pin-utils" @@ -4068,15 +4557,15 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" dependencies = [ "portable-atomic", ] @@ -4128,7 +4617,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -4143,13 +4632,35 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "proc-macro2" version = "1.0.106" @@ -4161,15 +4672,15 @@ dependencies = [ [[package]] name = "proptest" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40" +checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" dependencies = [ "bit-set", "bit-vec", "bitflags", "num-traits", - "rand", + "rand 0.9.2", "rand_chacha", "rand_xorshift", "regex-syntax", @@ -4186,7 +4697,7 @@ checksum = "fb6dc647500e84a25a85b100e76c85b8ace114c209432dc174f20aac11d4ed6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -4201,23 +4712,22 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ "heck", "itertools 0.14.0", "log", "multimap", - "once_cell", - "petgraph", + "petgraph 0.8.3", "prettyplease", "prost", "prost-types", "pulldown-cmark", "pulldown-cmark-to-cmark", "regex", - "syn 2.0.114", + "syn 2.0.117", "tempfile", ] @@ -4231,7 +4741,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -4248,9 +4758,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" dependencies = [ "prost", ] @@ -4284,9 +4794,9 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" +checksum = "7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad" dependencies = [ "bitflags", "memchr", @@ -4295,9 +4805,9 @@ dependencies = [ [[package]] name = "pulldown-cmark-to-cmark" -version = "21.1.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8246feae3db61428fd0bb94285c690b460e4517d83152377543ca802357785f1" +checksum = "50793def1b900256624a709439404384204a5dc3a6ec580281bfaac35e882e90" dependencies = [ "pulldown-cmark", ] @@ -4335,8 +4845,8 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.36", - "socket2 0.6.2", + "rustls 0.23.37", + "socket2 0.6.3", "thiserror 2.0.18", "tokio", "tracing", @@ -4353,10 +4863,10 @@ dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", - "rand", + "rand 0.9.2", "ring", "rustc-hash", - "rustls 0.23.36", + "rustls 0.23.37", "rustls-pki-types", "slab", "thiserror 2.0.18", @@ -4374,16 +4884,16 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.2", + "socket2 0.6.3", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -4394,6 +4904,21 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core 0.6.4", +] + [[package]] name = "rand" version = "0.9.2" @@ -4404,6 +4929,15 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "rand" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +dependencies = [ + "rand_core 0.10.0", +] + [[package]] name = "rand_chacha" version = "0.9.0" @@ -4432,6 +4966,12 @@ dependencies = [ "getrandom 0.3.4", ] +[[package]] +name = "rand_core" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" + [[package]] name = "rand_hc" version = "0.3.2" @@ -4499,9 +5039,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -4511,9 +5051,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -4528,9 +5068,9 @@ checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "relative-path" @@ -4561,7 +5101,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.36", + "rustls 0.23.37", "rustls-pki-types", "rustls-platform-verifier", "serde", @@ -4648,10 +5188,31 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.1", - "syn 2.0.114", + "syn 2.0.117", "unicode-ident", ] +[[package]] +name = "ruint" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" +dependencies = [ + "proptest", + "rand 0.8.5", + "rand 0.9.2", + "ruint-macro", + "serde_core", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "rustc-demangle" version = "0.1.27" @@ -4684,27 +5245,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustix" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.11.0", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -4722,16 +5270,16 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.36" +version = "0.23.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.9", + "rustls-webpki 0.103.10", "subtle", "zeroize", ] @@ -4769,10 +5317,10 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.36", + "rustls 0.23.37", "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.103.9", + "rustls-webpki 0.103.10", "security-framework", "security-framework-sys", "webpki-root-certs", @@ -4797,9 +5345,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.9" +version = "0.103.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" dependencies = [ "aws-lc-rs", "ring", @@ -4827,9 +5375,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" @@ -4851,9 +5399,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ "windows-sys 0.61.2", ] @@ -4902,9 +5450,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.5.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags", "core-foundation 0.10.1", @@ -4915,9 +5463,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.15.0" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", @@ -4975,7 +5523,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5002,6 +5550,17 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "serde_spanned" version = "1.0.4" @@ -5025,9 +5584,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.3.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0b343e184fc3b7bb44dff0705fffcf4b3756ba6aff420dddd8b24ca145e555" +checksum = "911bd979bf1070a3f3aa7b691a3b3e9968f339ceeec89e08c280a8a22207a32f" dependencies = [ "futures-executor", "futures-util", @@ -5040,13 +5599,24 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "3.3.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f50427f258fb77356e4cd4aa0e87e2bd2c66dbcee41dc405282cae2bfc26c83" +checksum = "0a7d91949b85b0d2fb687445e448b40d322b6b3e4af6b44a29b21d9a5f33e6d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", ] [[package]] @@ -5113,15 +5683,18 @@ checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" [[package]] name = "slab" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] [[package]] name = "smawk" @@ -5141,12 +5714,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5158,6 +5731,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +dependencies = [ + "lock_api", +] + [[package]] name = "spinning_top" version = "0.3.0" @@ -5201,6 +5783,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + [[package]] name = "string_cache" version = "0.8.9" @@ -5268,15 +5856,27 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.114" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53f425ae0b12e2f5ae65542e00898d500d4d318b4baf09f40fd0d410454e9947" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "sync_wrapper" version = "1.0.2" @@ -5294,14 +5894,14 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "system-configuration" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ "bitflags", "core-foundation 0.9.4", @@ -5326,14 +5926,14 @@ checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b" [[package]] name = "tempfile" -version = "3.24.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.2", "once_cell", - "rustix 1.1.3", + "rustix", "windows-sys 0.61.2", ] @@ -5355,23 +5955,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix 0.38.44", - "windows-sys 0.48.0", -] - [[package]] name = "terminal_size" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" dependencies = [ - "rustix 1.1.3", + "rustix", "windows-sys 0.60.2", ] @@ -5418,7 +6008,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5429,7 +6019,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5472,6 +6062,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinystr" version = "0.8.2" @@ -5494,9 +6093,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" dependencies = [ "tinyvec_macros", ] @@ -5509,9 +6108,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.49.0" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" dependencies = [ "bytes", "libc", @@ -5519,20 +6118,20 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.2", + "socket2 0.6.3", "tokio-macros", "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5551,7 +6150,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.36", + "rustls 0.23.37", "tokio", ] @@ -5582,32 +6181,30 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.11+spec-1.1.0" +version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ - "indexmap", "serde_core", "serde_spanned", "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", - "toml_writer", - "winnow", + "winnow 0.7.15", ] [[package]] name = "toml" -version = "1.0.3+spec-1.1.0" +version = "1.0.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7614eaf19ad818347db24addfa201729cf2a9b6fdfd9eb0ab870fcacc606c0c" +checksum = "dd28d57d8a6f6e458bc0b8784f8fdcc4b99a437936056fa122cb234f18656a96" dependencies = [ "indexmap", "serde_core", "serde_spanned", - "toml_datetime 1.0.0+spec-1.1.0", + "toml_datetime 1.0.1+spec-1.1.0", "toml_parser", "toml_writer", - "winnow", + "winnow 1.0.0", ] [[package]] @@ -5621,45 +6218,45 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.0.0+spec-1.1.0" +version = "1.0.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e" +checksum = "9b320e741db58cac564e26c607d3cc1fdc4a88fd36c879568c07856ed83ff3e9" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.23.10+spec-1.0.0" +version = "0.25.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +checksum = "8ca1a40644a28bce036923f6a431df0b34236949d111cc07cb6dca830c9ef2e1" dependencies = [ "indexmap", - "toml_datetime 0.7.5+spec-1.1.0", + "toml_datetime 1.0.1+spec-1.1.0", "toml_parser", - "winnow", + "winnow 1.0.0", ] [[package]] name = "toml_parser" -version = "1.0.9+spec-1.1.0" +version = "1.0.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" +checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420" dependencies = [ - "winnow", + "winnow 1.0.0", ] [[package]] name = "toml_writer" -version = "1.0.6+spec-1.1.0" +version = "1.0.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" +checksum = "f17aaa1c6e3dc22b1da4b6bba97d066e354c7945cac2f7852d4e4e7ca7a6b56d" [[package]] name = "tonic" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7613188ce9f7df5bfe185db26c5814347d110db17920415cf2fbcad85e7203" +checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" dependencies = [ "async-trait", "axum", @@ -5675,7 +6272,7 @@ dependencies = [ "percent-encoding", "pin-project", "rustls-native-certs", - "socket2 0.6.2", + "socket2 0.6.3", "sync_wrapper", "tokio", "tokio-rustls 0.26.4", @@ -5688,21 +6285,21 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40aaccc9f9eccf2cd82ebc111adc13030d23e887244bc9cfa5d1d636049de3" +checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734" dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "tonic-health" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a82868bf299e0a1d2e8dce0dc33a46c02d6f045b2c1f1d6cc8dc3d0bf1812ef" +checksum = "f4ff0636fef47afb3ec02818f5bceb4377b8abb9d6a386aeade18bd6212f8eb7" dependencies = [ "prost", "tokio", @@ -5713,9 +6310,9 @@ dependencies = [ [[package]] name = "tonic-prost" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66bd50ad6ce1252d87ef024b3d64fe4c3cf54a86fb9ef4c631fdd0ded7aeaa67" +checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" dependencies = [ "bytes", "prost", @@ -5724,25 +6321,25 @@ dependencies = [ [[package]] name = "tonic-prost-build" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a16cba4043dc3ff43fcb3f96b4c5c154c64cbd18ca8dce2ab2c6a451d058a2" +checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "prost-types", "quote", - "syn 2.0.114", + "syn 2.0.117", "tempfile", "tonic-build", ] [[package]] name = "tonic-reflection" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34da53e8387581d66db16ff01f98a70b426b091fdf76856e289d5c1bd386ed7b" +checksum = "aaf0685a51e6d02b502ba0764002e766b7f3042aed13d9234925b6ffbfa3fca7" dependencies = [ "prost", "prost-types", @@ -5754,9 +6351,9 @@ dependencies = [ [[package]] name = "tonic-web" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75214f6b6bd28c19aa752ac09fdf0eea546095670906c21fe3940e180a4c43f2" +checksum = "29453d84de05f4f1b573db22e6f9f6c95c189a6089a440c9a098aa9dea009299" dependencies = [ "base64", "bytes", @@ -5883,7 +6480,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -5948,9 +6545,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" dependencies = [ "matchers", "nu-ansi-term", @@ -5967,6 +6564,16 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5975,9 +6582,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trybuild" -version = "1.0.114" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17e807bff86d2a06b52bca4276746584a78375055b6e45843925ce2802b335" +checksum = "47c635f0191bd3a2941013e5062667100969f8c4e9cd787c14f977265d73616e" dependencies = [ "dissimilar", "glob", @@ -5986,7 +6593,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 0.9.11+spec-1.1.0", + "toml 1.0.7+spec-1.1.0", ] [[package]] @@ -6021,9 +6628,9 @@ checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-linebreak" @@ -6031,6 +6638,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "unicode-width" version = "0.1.14" @@ -6098,9 +6711,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.20.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ "js-sys", "wasm-bindgen", @@ -6193,9 +6806,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ "cfg-if", "once_cell", @@ -6206,9 +6819,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.58" +version = "0.4.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" dependencies = [ "cfg-if", "futures-util", @@ -6220,9 +6833,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6230,22 +6843,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" dependencies = [ "unicode-ident", ] @@ -6299,9 +6912,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.85" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" dependencies = [ "js-sys", "wasm-bindgen", @@ -6378,7 +6991,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -6389,7 +7002,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -6436,15 +7049,6 @@ dependencies = [ "windows-targets 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -6487,21 +7091,6 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -6541,12 +7130,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -6565,12 +7148,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -6589,12 +7166,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -6625,12 +7196,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -6649,12 +7214,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -6673,12 +7232,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -6697,12 +7250,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -6717,124 +7264,17 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" -dependencies = [ - "memchr", -] - -[[package]] -name = "winter-air" -version = "0.13.1" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef01227f23c7c331710f43b877a8333f5f8d539631eea763600f1a74bf018c7c" -dependencies = [ - "libm", - "winter-crypto", - "winter-fri", - "winter-math", - "winter-utils", -] +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" [[package]] -name = "winter-crypto" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdb247bc142438798edb04067ab72a22cf815f57abbd7b78a6fa986fc101db8" -dependencies = [ - "blake3", - "sha3", - "winter-math", - "winter-utils", -] - -[[package]] -name = "winter-fri" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd592b943f9d65545683868aaf1b601eb66e52bfd67175347362efff09101d3a" -dependencies = [ - "winter-crypto", - "winter-math", - "winter-utils", -] - -[[package]] -name = "winter-math" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aecfb48ee6a8b4746392c8ff31e33e62df8528a3b5628c5af27b92b14aef1ea" -dependencies = [ - "winter-utils", -] - -[[package]] -name = "winter-maybe-async" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d31a19dae58475d019850e25b0170e94b16d382fbf6afee9c0e80fdc935e73e" -dependencies = [ - "quote", - "syn 2.0.114", -] - -[[package]] -name = "winter-prover" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84cc631ed56cd39b78ef932c1ec4060cc6a44d114474291216c32f56655b3048" -dependencies = [ - "tracing", - "winter-air", - "winter-crypto", - "winter-fri", - "winter-math", - "winter-maybe-async", - "winter-utils", -] - -[[package]] -name = "winter-rand-utils" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4ff3b651754a7bd216f959764d0a5ab6f4b551c9a3a08fb9ccecbed594b614a" -dependencies = [ - "rand", - "winter-utils", -] - -[[package]] -name = "winter-utils" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9951263ef5317740cd0f49e618db00c72fabb70b75756ea26c4d5efe462c04dd" -dependencies = [ - "rayon", -] - -[[package]] -name = "winter-verifier" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0425ea81f8f703a1021810216da12003175c7974a584660856224df04b2e2fdb" -dependencies = [ - "winter-air", - "winter-crypto", - "winter-fri", - "winter-math", - "winter-utils", -] - -[[package]] -name = "winterfell" -version = "0.13.1" +name = "winnow" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f824ddd5aec8ca6a54307f20c115485a8a919ea94dd26d496d856ca6185f4f" +checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" dependencies = [ - "winter-air", - "winter-prover", - "winter-verifier", + "memchr", ] [[package]] @@ -6867,7 +7307,7 @@ dependencies = [ "heck", "indexmap", "prettyplease", - "syn 2.0.114", + "syn 2.0.117", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -6883,7 +7323,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -6972,28 +7412,28 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.34" +version = "0.8.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ddd76bcebeed25db614f82bf31a9f4222d3fbba300e6fb6c00afa26cbd4d9d" +checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.34" +version = "0.8.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8187381b52e32220d50b255276aa16a084ec0a9017a0ca2152a1f55c539758d" +checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] @@ -7013,7 +7453,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", "synstructure", ] @@ -7053,11 +7493,11 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] name = "zmij" -version = "1.0.17" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 93c0e91055..1079a7f9c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,50 +32,45 @@ license = "MIT" readme = "README.md" repository = "https://github.com/0xMiden/node" rust-version = "1.93" -version = "0.14.0-alpha.8" +version = "0.14.0" # Optimize the cryptography for faster tests involving account creation. [profile.test.package.miden-crypto] opt-level = 2 -# Avoid running the expensive debug assertion in winter-prover -[profile.test.package.winter-prover] -debug-assertions = false - [profile.release] debug = true [workspace.dependencies] # Workspace crates. -miden-large-smt-backend-rocksdb = { path = "crates/large-smt-backend-rocksdb", version = "=0.14.0-alpha.8" } -miden-node-block-producer = { path = "crates/block-producer", version = "=0.14.0-alpha.8" } -miden-node-db = { path = "crates/db", version = "=0.14.0-alpha.8" } -miden-node-grpc-error-macro = { path = "crates/grpc-error-macro", version = "=0.14.0-alpha.8" } -miden-node-ntx-builder = { path = "crates/ntx-builder", version = "=0.14.0-alpha.8" } -miden-node-proto = { path = "crates/proto", version = "=0.14.0-alpha.8" } -miden-node-proto-build = { path = "proto", version = "=0.14.0-alpha.8" } -miden-node-rpc = { path = "crates/rpc", version = "=0.14.0-alpha.8" } -miden-node-store = { path = "crates/store", version = "=0.14.0-alpha.8" } +miden-agglayer = { version = "0.14" } +miden-large-smt-backend-rocksdb = { path = "crates/large-smt-backend-rocksdb", version = "0.14" } +miden-node-block-producer = { path = "crates/block-producer", version = "0.14" } +miden-node-db = { path = "crates/db", version = "0.14" } +miden-node-grpc-error-macro = { path = "crates/grpc-error-macro", version = "0.14" } +miden-node-ntx-builder = { path = "crates/ntx-builder", version = "0.14" } +miden-node-proto = { path = "crates/proto", version = "0.14" } +miden-node-proto-build = { path = "proto", version = "0.14" } +miden-node-rpc = { path = "crates/rpc", version = "0.14" } +miden-node-store = { path = "crates/store", version = "0.14" } miden-node-test-macro = { path = "crates/test-macro" } -miden-node-utils = { path = "crates/utils", version = "=0.14.0-alpha.8" } -miden-node-validator = { path = "crates/validator", version = "=0.14.0-alpha.8" } -miden-remote-prover-client = { path = "crates/remote-prover-client", version = "=0.14.0-alpha.8" } +miden-node-utils = { path = "crates/utils", version = "0.14" } +miden-node-validator = { path = "crates/validator", version = "0.14" } +miden-remote-prover-client = { path = "crates/remote-prover-client", version = "0.14" } # Temporary workaround until # is part of `rocksdb-rust` release -miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "=0.14.0-alpha.8" } - -# miden-base aka protocol dependencies. These should be updated in sync. -miden-block-prover = { version = "=0.14.0-alpha.2" } -miden-protocol = { default-features = false, version = "=0.14.0-alpha.2" } -miden-standards = { version = "=0.14.0-alpha.2" } -miden-testing = { version = "=0.14.0-alpha.2" } -miden-tx = { default-features = false, version = "=0.14.0-alpha.2" } -miden-tx-batch-prover = { version = "=0.14.0-alpha.2" } +miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "0.14" } -# Other miden dependencies. These should align with those expected by miden-base. -miden-air = { features = ["std", "testing"], version = "0.20" } +# miden-protocol dependencies. These should be updated in sync. +miden-block-prover = { version = "0.14" } +miden-protocol = { default-features = false, version = "0.14" } +miden-standards = { version = "0.14" } +miden-testing = { version = "0.14" } +miden-tx = { default-features = false, version = "0.14" } +miden-tx-batch-prover = { version = "0.14" } -miden-crypto = { version = "0.19.7" } +# Other miden dependencies. These should align with those expected by miden-protocol. +miden-crypto = { version = "0.23" } # External dependencies anyhow = { version = "1.0" } @@ -113,7 +108,7 @@ thiserror = { default-features = false, version = "2.0" } tokio = { features = ["rt-multi-thread"], version = "1.46" } tokio-stream = { version = "0.1" } tokio-util = { version = "0.7" } -toml = "1.0" +toml = { version = "1.0" } tonic = { default-features = false, version = "0.14" } tonic-health = { version = "0.14" } tonic-prost = { version = "0.14" } diff --git a/bin/genesis/Cargo.toml b/bin/genesis/Cargo.toml index ac42961207..c37ab026fd 100644 --- a/bin/genesis/Cargo.toml +++ b/bin/genesis/Cargo.toml @@ -21,7 +21,7 @@ anyhow = { workspace = true } clap = { workspace = true } fs-err = { workspace = true } hex = { workspace = true } -miden-agglayer = { version = "=0.14.0-alpha.2" } +miden-agglayer = { workspace = true } miden-protocol = { features = ["std"], workspace = true } miden-standards = { workspace = true } rand = { workspace = true } diff --git a/bin/genesis/src/main.rs b/bin/genesis/src/main.rs index 425dc159dc..0b66588273 100644 --- a/bin/genesis/src/main.rs +++ b/bin/genesis/src/main.rs @@ -13,9 +13,9 @@ use miden_protocol::account::{ AccountStorageMode, AccountType, }; -use miden_protocol::crypto::dsa::falcon512_rpo::{self, SecretKey as RpoSecretKey}; -use miden_protocol::crypto::rand::RpoRandomCoin; -use miden_protocol::utils::Deserializable; +use miden_protocol::crypto::dsa::falcon512_poseidon2::{self, SecretKey as FalconSecretKey}; +use miden_protocol::crypto::rand::RandomCoin; +use miden_protocol::utils::serde::Deserializable; use miden_protocol::{Felt, ONE, Word}; use miden_standards::AuthMethod; use miden_standards::account::wallets::create_basic_wallet; @@ -71,7 +71,7 @@ fn run( let bridge_admin = create_basic_wallet( rand::random(), AuthMethod::SingleSig { - approver: (bridge_admin_pub.into(), AuthScheme::Falcon512Rpo), + approver: (bridge_admin_pub.into(), AuthScheme::Falcon512Poseidon2), }, AccountType::RegularAccountImmutableCode, AccountStorageMode::Public, @@ -83,7 +83,7 @@ fn run( let ger_manager = create_basic_wallet( rand::random(), AuthMethod::SingleSig { - approver: (ger_manager_pub.into(), AuthScheme::Falcon512Rpo), + approver: (ger_manager_pub.into(), AuthScheme::Falcon512Poseidon2), }, AccountType::RegularAccountImmutableCode, AccountStorageMode::Public, @@ -104,14 +104,14 @@ fn run( // Write .mac files. let bridge_admin_secrets = bridge_admin_secret - .map(|sk| vec![AuthSecretKey::Falcon512Rpo(sk)]) + .map(|sk| vec![AuthSecretKey::Falcon512Poseidon2(sk)]) .unwrap_or_default(); AccountFile::new(bridge_admin, bridge_admin_secrets) .write(output_dir.join("bridge_admin.mac")) .context("failed to write bridge_admin.mac")?; let ger_manager_secrets = ger_manager_secret - .map(|sk| vec![AuthSecretKey::Falcon512Rpo(sk)]) + .map(|sk| vec![AuthSecretKey::Falcon512Poseidon2(sk)]) .unwrap_or_default(); AccountFile::new(ger_manager, ger_manager_secrets) .write(output_dir.join("ger_manager.mac")) @@ -156,11 +156,11 @@ path = "bridge.mac" } /// Generates a new Falcon512 keypair using a random seed. -fn generate_falcon_keypair() -> (falcon512_rpo::PublicKey, RpoSecretKey) { +fn generate_falcon_keypair() -> (falcon512_poseidon2::PublicKey, FalconSecretKey) { let mut rng = ChaCha20Rng::from_seed(rand::random()); let auth_seed: [u64; 4] = rng.random(); - let mut coin = RpoRandomCoin::new(Word::from(auth_seed.map(Felt::new))); - let secret_key = RpoSecretKey::with_rng(&mut coin); + let mut coin = RandomCoin::new(Word::from(auth_seed.map(Felt::new))); + let secret_key = FalconSecretKey::with_rng(&mut coin); let public_key = secret_key.public_key(); (public_key, secret_key) } @@ -170,11 +170,11 @@ fn generate_falcon_keypair() -> (falcon512_rpo::PublicKey, RpoSecretKey) { fn resolve_pubkey( hex_pubkey: Option<&str>, label: &str, -) -> anyhow::Result<(falcon512_rpo::PublicKey, Option)> { +) -> anyhow::Result<(falcon512_poseidon2::PublicKey, Option)> { if let Some(hex_str) = hex_pubkey { let bytes = hex::decode(hex_str).with_context(|| format!("invalid hex for {label} public key"))?; - let pubkey = falcon512_rpo::PublicKey::read_from_bytes(&bytes) + let pubkey = falcon512_poseidon2::PublicKey::read_from_bytes(&bytes) .with_context(|| format!("failed to deserialize {label} public key"))?; Ok((pubkey, None)) } else { @@ -199,7 +199,7 @@ fn bump_nonce_to_one(mut account: Account) -> anyhow::Result { mod tests { use miden_node_store::genesis::config::GenesisConfig; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::Serializable; use super::*; diff --git a/bin/network-monitor/src/assets/counter_program.masm b/bin/network-monitor/src/assets/counter_program.masm index 9cd6536f45..9f8679da93 100644 --- a/bin/network-monitor/src/assets/counter_program.masm +++ b/bin/network-monitor/src/assets/counter_program.masm @@ -1,6 +1,6 @@ # Counter program for network monitoring with note authentication # Storage layout: -# - OWNER_SLOT: authorized wallet account id as [prefix, suffix, 0, 0] +# - OWNER_SLOT: authorized wallet account id as [suffix, prefix, 0, 0] # - COUNTER_SLOT: counter value (u64) use miden::core::sys @@ -19,10 +19,10 @@ const OWNER_SLOT = word("miden::monitor::counter_contract::owner") pub proc increment # Ensure the note sender matches the authorized wallet. push.OWNER_SLOT[0..2] exec.active_account::get_item - # => [owner_prefix, owner_suffix, 0, 0] + # => [owner_suffix, owner_prefix, 0, 0] exec.active_note::get_sender - # => [sender_prefix, sender_suffix, owner_prefix, owner_suffix, 0, 0] + # => [sender_suffix, sender_prefix, owner_suffix, owner_prefix, 0, 0] exec.account_id::is_equal # => [are_equal, 0, 0] diff --git a/bin/network-monitor/src/counter.rs b/bin/network-monitor/src/counter.rs index dd004ff0d0..47439986cf 100644 --- a/bin/network-monitor/src/counter.rs +++ b/bin/network-monitor/src/counter.rs @@ -16,7 +16,7 @@ use miden_protocol::account::auth::AuthSecretKey; use miden_protocol::account::{Account, AccountFile, AccountHeader, AccountId}; use miden_protocol::assembly::Library; use miden_protocol::block::{BlockHeader, BlockNumber}; -use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey; +use miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey; use miden_protocol::note::{ Note, NoteAssets, @@ -28,13 +28,12 @@ use miden_protocol::note::{ NoteType, }; use miden_protocol::transaction::{InputNotes, PartialBlockchain, TransactionArgs}; -use miden_protocol::utils::Deserializable; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_protocol::{Felt, Word}; use miden_standards::account::interface::{AccountInterface, AccountInterfaceExt}; use miden_standards::code_builder::CodeBuilder; use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint}; use miden_tx::auth::BasicAuthenticator; -use miden_tx::utils::Serializable; use miden_tx::{LocalTransactionProver, TransactionExecutor}; use rand::{Rng, SeedableRng}; use rand_chacha::ChaCha20Rng; @@ -122,7 +121,7 @@ async fn fetch_counter_value( .find(|slot| slot.slot_name == COUNTER_SLOT_NAME.as_str()) .context(format!("counter slot '{}' not found", COUNTER_SLOT_NAME.as_str()))?; - // The counter value is stored as a Word, with the actual u64 value in the last element + // The counter value is stored as a Word, with the actual u64 value in the first element let slot_value: Word = counter_slot .commitment .as_ref() @@ -130,7 +129,11 @@ async fn fetch_counter_value( .try_into() .context("failed to convert slot value to word")?; - let value = slot_value.as_elements().last().expect("Word has 4 elements").as_int(); + let value = slot_value + .as_elements() + .first() + .expect("Word has 4 elements") + .as_canonical_u64(); Ok(Some(value)) } @@ -321,7 +324,7 @@ async fn setup_increment_task( .await? .unwrap_or(wallet_account_file.account.clone()); - let AuthSecretKey::Falcon512Rpo(secret_key) = wallet_account_file + let AuthSecretKey::Falcon512Poseidon2(secret_key) = wallet_account_file .auth_secret_keys .first() .expect("wallet account file should have one auth secret key") @@ -821,7 +824,8 @@ async fn create_and_submit_network_note( rng: &mut ChaCha20Rng, ) -> Result<(String, AccountHeader, BlockNumber)> { // Create authenticator for transaction signing - let authenticator = BasicAuthenticator::new(&[AuthSecretKey::Falcon512Rpo(secret_key.clone())]); + let authenticator = + BasicAuthenticator::new(&[AuthSecretKey::Falcon512Poseidon2(secret_key.clone())]); let account_interface = AccountInterface::from_account(wallet_account); @@ -851,7 +855,7 @@ async fn create_and_submit_network_note( // Prove the transaction let prover = LocalTransactionProver::default(); - let proven_tx = prover.prove(executed_tx).context("Failed to prove transaction")?; + let proven_tx = prover.prove(executed_tx).await.context("Failed to prove transaction")?; // Submit the proven transaction let request = ProvenTransaction { diff --git a/bin/network-monitor/src/deploy/counter.rs b/bin/network-monitor/src/deploy/counter.rs index e517beb063..5479f15898 100644 --- a/bin/network-monitor/src/deploy/counter.rs +++ b/bin/network-monitor/src/deploy/counter.rs @@ -16,7 +16,7 @@ use miden_protocol::account::{ StorageSlotName, }; use miden_protocol::utils::sync::LazyLock; -use miden_protocol::{Felt, FieldElement, Word}; +use miden_protocol::{Felt, Word}; use miden_standards::code_builder::CodeBuilder; use miden_standards::testing::account_component::IncrNonceAuthComponent; use tracing::instrument; @@ -46,7 +46,7 @@ pub fn create_counter_account(owner_account_id: AccountId) -> Result { let owner_id_slot = StorageSlot::with_value( OWNER_SLOT_NAME.clone(), - Word::from([Felt::ZERO, Felt::ZERO, owner_account_id_suffix, owner_account_id_prefix]), + Word::from([owner_account_id_suffix, owner_account_id_prefix, Felt::ZERO, Felt::ZERO]), ); let counter_slot = StorageSlot::with_value(COUNTER_SLOT_NAME.clone(), Word::empty()); @@ -54,7 +54,7 @@ pub fn create_counter_account(owner_account_id: AccountId) -> Result { let component_code = CodeBuilder::default().compile_component_code("counter::program", script)?; - let metadata = AccountComponentMetadata::new("counter::program").with_supports_all_types(); + let metadata = AccountComponentMetadata::new("counter::program", AccountType::all()); let account_code = AccountComponent::new(component_code, vec![counter_slot, owner_id_slot], metadata)?; diff --git a/bin/network-monitor/src/deploy/mod.rs b/bin/network-monitor/src/deploy/mod.rs index b89c09aa0c..72f194a731 100644 --- a/bin/network-monitor/src/deploy/mod.rs +++ b/bin/network-monitor/src/deploy/mod.rs @@ -11,7 +11,7 @@ use anyhow::{Context, Result}; use miden_node_proto::clients::{Builder, RpcClient}; use miden_node_proto::generated::rpc::BlockHeaderByNumberRequest; use miden_node_proto::generated::transaction::ProvenTransaction; -use miden_protocol::account::{Account, AccountId, PartialAccount, PartialStorage, StorageMapKey}; +use miden_protocol::account::{Account, AccountId, PartialAccount, StorageMapKey}; use miden_protocol::assembly::{ DefaultSourceManager, Library, @@ -19,7 +19,7 @@ use miden_protocol::assembly::{ ModuleKind, Path as MidenPath, }; -use miden_protocol::asset::{AssetVaultKey, AssetWitness, PartialVault}; +use miden_protocol::asset::{AssetVaultKey, AssetWitness}; use miden_protocol::block::{BlockHeader, BlockNumber}; use miden_protocol::crypto::merkle::mmr::{MmrPeaks, PartialMmr}; use miden_protocol::note::NoteScript; @@ -30,9 +30,9 @@ use miden_protocol::transaction::{ TransactionArgs, TransactionKernel, }; +use miden_protocol::utils::serde::Serializable; use miden_protocol::{MastForest, Word}; use miden_tx::auth::BasicAuthenticator; -use miden_tx::utils::Serializable; use miden_tx::{ DataStore, DataStoreError, @@ -203,7 +203,7 @@ pub async fn deploy_counter_account(counter_account: &Account, rpc_url: &Url) -> let prover = LocalTransactionProver::default(); - let proven_tx = prover.prove(executed_tx).context("Failed to prove transaction")?; + let proven_tx = prover.prove(executed_tx).await.context("Failed to prove transaction")?; let request = ProvenTransaction { transaction: proven_tx.to_bytes(), @@ -288,18 +288,8 @@ impl DataStore for MonitorDataStore { account_id: AccountId, mut _block_refs: BTreeSet, ) -> Result<(PartialAccount, BlockHeader, PartialBlockchain), DataStoreError> { - let account = self.get_account(account_id)?.clone(); - let partial_storage = PartialStorage::new_full(account.storage().clone()); - let assert_vault = PartialVault::new_full(account.vault().clone()); - let partial_account = PartialAccount::new( - account_id, - account.nonce(), - account.code().clone(), - partial_storage, - assert_vault, - account.seed(), - ) - .expect("Partial account be valid"); + let account = self.get_account(account_id)?; + let partial_account = PartialAccount::from(account); Ok((partial_account, self.block_header.clone(), self.partial_block_chain.clone())) } diff --git a/bin/network-monitor/src/deploy/wallet.rs b/bin/network-monitor/src/deploy/wallet.rs index ba074a60f8..9b9274440d 100644 --- a/bin/network-monitor/src/deploy/wallet.rs +++ b/bin/network-monitor/src/deploy/wallet.rs @@ -6,7 +6,7 @@ use anyhow::Result; use miden_node_utils::crypto::get_rpo_random_coin; use miden_protocol::account::auth::{AuthScheme, AuthSecretKey}; use miden_protocol::account::{Account, AccountFile, AccountStorageMode, AccountType}; -use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey; +use miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey; use miden_standards::AuthMethod; use miden_standards::account::wallets::create_basic_wallet; use rand::{Rng, SeedableRng}; @@ -23,7 +23,7 @@ pub fn create_wallet_account() -> Result<(Account, SecretKey)> { let mut rng = ChaCha20Rng::from_seed(rand::random()); let secret_key = SecretKey::with_rng(&mut get_rpo_random_coin(&mut rng)); let auth = AuthMethod::SingleSig { - approver: (secret_key.public_key().into(), AuthScheme::Falcon512Rpo), + approver: (secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2), }; let init_seed: [u8; 32] = rng.random(); @@ -43,7 +43,7 @@ pub fn save_wallet_account( secret_key: &SecretKey, file_path: &Path, ) -> Result<()> { - let auth_secret_key = AuthSecretKey::Falcon512Rpo(secret_key.clone()); + let auth_secret_key = AuthSecretKey::Falcon512Poseidon2(secret_key.clone()); let account_file = AccountFile::new(account.clone(), vec![auth_secret_key]); account_file.write(file_path)?; Ok(()) diff --git a/bin/network-monitor/src/remote_prover.rs b/bin/network-monitor/src/remote_prover.rs index b103a60c42..ffa2a2724e 100644 --- a/bin/network-monitor/src/remote_prover.rs +++ b/bin/network-monitor/src/remote_prover.rs @@ -13,8 +13,8 @@ use miden_protocol::asset::{Asset, FungibleAsset}; use miden_protocol::note::NoteType; use miden_protocol::testing::account_id::{ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_SENDER}; use miden_protocol::transaction::TransactionInputs; +use miden_protocol::utils::serde::Serializable; use miden_testing::{Auth, MockChainBuilder}; -use miden_tx::utils::Serializable; use serde::{Deserialize, Serialize}; use tokio::sync::watch; use tokio::time::MissedTickBehavior; @@ -278,7 +278,9 @@ pub async fn generate_mock_transaction() -> anyhow::Result { // Create an account with basic authentication let account = mock_chain_builder - .add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo }) + .add_existing_wallet(Auth::BasicAuth { + auth_scheme: AuthScheme::Falcon512Poseidon2, + }) .context("Failed to add wallet to mock chain")?; // Create a fungible asset diff --git a/bin/node/src/commands/bundled.rs b/bin/node/src/commands/bundled.rs index 525bbd9d4b..d076ad18bb 100644 --- a/bin/node/src/commands/bundled.rs +++ b/bin/node/src/commands/bundled.rs @@ -9,7 +9,7 @@ use miden_node_utils::clap::{GrpcOptionsExternal, StorageOptions}; use miden_node_utils::grpc::UrlExt; use miden_node_validator::{Validator, ValidatorSigner}; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; -use miden_protocol::utils::Deserializable; +use miden_protocol::utils::serde::Deserializable; use tokio::net::TcpListener; use tokio::task::JoinSet; use url::Url; diff --git a/bin/node/src/commands/mod.rs b/bin/node/src/commands/mod.rs index 7ccc4e7748..be91d139dc 100644 --- a/bin/node/src/commands/mod.rs +++ b/bin/node/src/commands/mod.rs @@ -13,7 +13,7 @@ use miden_node_block_producer::{ use miden_node_utils::clap::duration_to_human_readable_string; use miden_node_validator::ValidatorSigner; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; -use miden_protocol::utils::Deserializable; +use miden_protocol::utils::serde::Deserializable; use tokio::net::TcpListener; use url::Url; diff --git a/bin/node/src/commands/store.rs b/bin/node/src/commands/store.rs index 53ea3dae96..abcd69c24b 100644 --- a/bin/node/src/commands/store.rs +++ b/bin/node/src/commands/store.rs @@ -7,7 +7,7 @@ use miden_node_utils::clap::{GrpcOptionsInternal, StorageOptions}; use miden_node_utils::fs::ensure_empty_directory; use miden_node_utils::grpc::UrlExt; use miden_protocol::block::ProvenBlock; -use miden_protocol::utils::Deserializable; +use miden_protocol::utils::serde::Deserializable; use url::Url; use super::{ diff --git a/bin/node/src/commands/validator.rs b/bin/node/src/commands/validator.rs index 7c3219e775..8e1e9fdf9f 100644 --- a/bin/node/src/commands/validator.rs +++ b/bin/node/src/commands/validator.rs @@ -9,7 +9,7 @@ use miden_node_utils::grpc::UrlExt; use miden_node_utils::signer::BlockSigner; use miden_node_validator::{Validator, ValidatorSigner}; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use url::Url; use crate::commands::{ diff --git a/bin/remote-prover/src/server/prover.rs b/bin/remote-prover/src/server/prover.rs index 6ca76794e5..2931cc70fe 100644 --- a/bin/remote-prover/src/server/prover.rs +++ b/bin/remote-prover/src/server/prover.rs @@ -8,7 +8,7 @@ use miden_protocol::block::BlockProof; use miden_protocol::transaction::{ProvenTransaction, TransactionInputs}; use miden_tx::LocalTransactionProver; use miden_tx_batch_prover::LocalBatchProver; -use tracing::instrument; +use tracing::{Instrument, instrument}; use crate::COMPONENT; use crate::generated::{self as proto}; @@ -33,11 +33,11 @@ impl Prover { /// Proves a [`proto::ProofRequest`] using the appropriate prover implementation as specified /// during construction. - pub fn prove(&self, request: proto::ProofRequest) -> Result { + pub async fn prove(&self, request: proto::ProofRequest) -> Result { match self { - Prover::Transaction(prover) => prover.prove_request(request), - Prover::Batch(prover) => prover.prove_request(request), - Prover::Block(prover) => prover.prove_request(request), + Prover::Transaction(prover) => prover.prove_request(request).await, + Prover::Batch(prover) => prover.prove_request(request).await, + Prover::Block(prover) => prover.prove_request(request).await, } } } @@ -51,30 +51,35 @@ impl Prover { /// /// Implementations of this trait only need to provide the input and outputs types, as well as the /// proof implementation. -trait ProveRequest { - type Input: miden_protocol::utils::Deserializable; - type Output: miden_protocol::utils::Serializable; +#[async_trait::async_trait] +trait ProveRequest: Send + Sync { + type Input: miden_protocol::utils::serde::Deserializable + Send; + type Output: miden_protocol::utils::serde::Serializable + Send; - fn prove(&self, input: Self::Input) -> Result; + async fn prove(&self, input: Self::Input) -> Result; /// Entry-point to the proof request handling. /// /// Decodes the request, proves it, and encodes the response. - fn prove_request(&self, request: proto::ProofRequest) -> Result { - Self::decode_request(request) - .and_then(|input| { - // We cannot #[instrument] the trait's prove method because it lacks an - // implementation, so we do it manually. - tracing::info_span!("prove", target = COMPONENT).in_scope(|| { - self.prove(input).inspect_err(|e| tracing::Span::current().set_error(e)) - }) - }) - .map(|output| Self::encode_response(output)) + async fn prove_request( + &self, + request: proto::ProofRequest, + ) -> Result { + let input = Self::decode_request(request)?; + + let prove_span = tracing::info_span!("prove", target = COMPONENT); + let result = self.prove(input).instrument(prove_span).await; + + if let Err(e) = &result { + tracing::Span::current().set_error(e); + } + + result.map(|output| Self::encode_response(output)) } #[instrument(target=COMPONENT, skip_all, err)] fn decode_request(request: proto::ProofRequest) -> Result { - use miden_protocol::utils::Deserializable; + use miden_protocol::utils::serde::Deserializable; Self::Input::read_from_bytes(&request.payload).map_err(|e| { tonic::Status::invalid_argument(e.as_report_context("failed to decode request")) @@ -83,38 +88,41 @@ trait ProveRequest { #[instrument(target=COMPONENT, skip_all)] fn encode_response(output: Self::Output) -> proto::Proof { - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::Serializable; proto::Proof { payload: output.to_bytes() } } } +#[async_trait::async_trait] impl ProveRequest for LocalTransactionProver { type Input = TransactionInputs; type Output = ProvenTransaction; - fn prove(&self, input: Self::Input) -> Result { - self.prove(input).map_err(|e| { + async fn prove(&self, input: Self::Input) -> Result { + LocalTransactionProver::prove(self, input).await.map_err(|e| { tonic::Status::internal(e.as_report_context("failed to prove transaction")) }) } } +#[async_trait::async_trait] impl ProveRequest for LocalBatchProver { type Input = ProposedBatch; type Output = ProvenBatch; - fn prove(&self, input: Self::Input) -> Result { + async fn prove(&self, input: Self::Input) -> Result { self.prove(input) .map_err(|e| tonic::Status::internal(e.as_report_context("failed to prove batch"))) } } +#[async_trait::async_trait] impl ProveRequest for LocalBlockProver { type Input = BlockProofRequest; type Output = BlockProof; - fn prove(&self, input: Self::Input) -> Result { + async fn prove(&self, input: Self::Input) -> Result { let BlockProofRequest { tx_batches, block_header, block_inputs } = input; self.prove(tx_batches, &block_header, block_inputs) .map_err(|e| tonic::Status::internal(e.as_report_context("failed to prove block"))) diff --git a/bin/remote-prover/src/server/service.rs b/bin/remote-prover/src/server/service.rs index 4a72147a65..0658336625 100644 --- a/bin/remote-prover/src/server/service.rs +++ b/bin/remote-prover/src/server/service.rs @@ -76,13 +76,6 @@ impl proto::api_server::Api for ProverService { // This mutex is fair and uses FIFO ordering. let prover = self.acquire_prover().await; - // Blocking in place is fairly safe since we guarantee that only a single request is - // processed at a time. - // - // This has the downside that requests being proven cannot be cancelled since we are now - // outside the async runtime. This could occur if the server timeout is exceeded, or - // the client cancels the request. A different approach is technically possible, but - // would require more complex logic to handle cancellation in tandem with sync. - tokio::task::block_in_place(|| prover.prove(request)).map(tonic::Response::new) + prover.prove(request).await.map(tonic::Response::new) } } diff --git a/bin/remote-prover/src/server/tests.rs b/bin/remote-prover/src/server/tests.rs index f1d526b16d..bc3d892620 100644 --- a/bin/remote-prover/src/server/tests.rs +++ b/bin/remote-prover/src/server/tests.rs @@ -11,8 +11,8 @@ use miden_protocol::batch::{ProposedBatch, ProvenBatch}; use miden_protocol::note::NoteType; use miden_protocol::testing::account_id::{ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_SENDER}; use miden_protocol::transaction::{ExecutedTransaction, ProvenTransaction}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_testing::{Auth, MockChainBuilder}; -use miden_tx::utils::{Deserializable, Serializable}; use miden_tx::{LocalTransactionProver, TransactionVerifier}; use miden_tx_batch_prover::LocalBatchProver; use serial_test::serial; @@ -64,7 +64,9 @@ impl ProofRequest { // Create a mock transaction to send to the server let mut mock_chain_builder = MockChainBuilder::new(); let account = mock_chain_builder - .add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo }) + .add_existing_wallet(Auth::BasicAuth { + auth_scheme: AuthScheme::Falcon512Poseidon2, + }) .unwrap(); let fungible_asset_1: Asset = @@ -96,7 +98,9 @@ impl ProofRequest { // Create a mock transaction to send to the server let mut mock_chain_builder = MockChainBuilder::new(); let account = mock_chain_builder - .add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo }) + .add_existing_wallet(Auth::BasicAuth { + auth_scheme: AuthScheme::Falcon512Poseidon2, + }) .unwrap(); let fungible_asset_1: Asset = @@ -122,9 +126,7 @@ impl ProofRequest { .unwrap(); let tx = Box::pin(tx.execute()).await.unwrap(); - let tx = tokio::task::block_in_place(|| { - LocalTransactionProver::default().prove(tx.tx_inputs().clone()).unwrap() - }); + let tx = LocalTransactionProver::default().prove(tx.tx_inputs().clone()).await.unwrap(); ProposedBatch::new( vec![Arc::new(tx)], diff --git a/bin/stress-test/Cargo.toml b/bin/stress-test/Cargo.toml index 0be68877dc..452da58606 100644 --- a/bin/stress-test/Cargo.toml +++ b/bin/stress-test/Cargo.toml @@ -20,7 +20,6 @@ workspace = true clap = { features = ["derive"], version = "4.5" } fs-err = { workspace = true } futures = { workspace = true } -miden-air = { features = ["testing"], workspace = true } miden-node-block-producer = { workspace = true } miden-node-proto = { workspace = true } miden-node-store = { workspace = true } diff --git a/bin/stress-test/src/seeding/mod.rs b/bin/stress-test/src/seeding/mod.rs index f6ba165109..adfad1fd9d 100644 --- a/bin/stress-test/src/seeding/mod.rs +++ b/bin/stress-test/src/seeding/mod.rs @@ -4,7 +4,6 @@ use std::sync::{Arc, Mutex}; use std::time::Instant; use metrics::SeedingMetrics; -use miden_air::ExecutionProof; use miden_node_block_producer::store::StoreClient; use miden_node_proto::domain::batch::BatchInputs; use miden_node_proto::generated::store::rpc_client::RpcClient; @@ -33,20 +32,23 @@ use miden_protocol::block::{ SignedBlock, }; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey as EcdsaSecretKey; -use miden_protocol::crypto::dsa::falcon512_rpo::{PublicKey, SecretKey}; -use miden_protocol::crypto::rand::RpoRandomCoin; +use miden_protocol::crypto::dsa::falcon512_poseidon2::{PublicKey, SecretKey}; +use miden_protocol::crypto::rand::RandomCoin; use miden_protocol::errors::AssetError; use miden_protocol::note::{Note, NoteHeader, NoteId, NoteInclusionProof}; use miden_protocol::transaction::{ InputNote, + InputNoteCommitment, InputNotes, OrderedTransactionHeaders, OutputNote, ProvenTransaction, - ProvenTransactionBuilder, + PublicOutputNote, TransactionHeader, + TxAccountUpdate, }; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; +use miden_protocol::vm::ExecutionProof; use miden_protocol::{Felt, ONE, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::account::faucets::BasicFungibleFaucet; @@ -161,7 +163,7 @@ async fn generate_blocks( // share random coin seed and key pair for all accounts to avoid key generation overhead let coin_seed: [u64; 4] = rand::rng().random(); - let rng = Arc::new(Mutex::new(RpoRandomCoin::new(coin_seed.map(Felt::new).into()))); + let rng = Arc::new(Mutex::new(RandomCoin::new(coin_seed.map(Felt::new).into()))); let key_pair = { let mut rng = rng.lock().unwrap(); SecretKey::with_rng(&mut *rng) @@ -287,7 +289,7 @@ fn create_accounts_and_notes( num_accounts: usize, storage_mode: AccountStorageMode, key_pair: &SecretKey, - rng: &Arc>, + rng: &Arc>, faucet_id: AccountId, block_num: usize, ) -> (Vec, Vec) { @@ -310,7 +312,7 @@ fn create_accounts_and_notes( /// Creates a public P2ID note containing 10 tokens of the fungible asset associated with the /// specified `faucet_id` and sent to the specified target account. -fn create_note(faucet_id: AccountId, target_id: AccountId, rng: &mut RpoRandomCoin) -> Note { +fn create_note(faucet_id: AccountId, target_id: AccountId, rng: &mut RandomCoin) -> Note { let asset = Asset::Fungible(FungibleAsset::new(faucet_id, 10).unwrap()); P2idNote::create( faucet_id, @@ -330,7 +332,7 @@ fn create_account(public_key: PublicKey, index: u64, storage_mode: AccountStorag AccountBuilder::new(init_seed.try_into().unwrap()) .account_type(AccountType::RegularAccountImmutableCode) .storage_mode(storage_mode) - .with_auth_component(AuthSingleSig::new(public_key.into(), AuthScheme::Falcon512Rpo)) + .with_auth_component(AuthSingleSig::new(public_key.into(), AuthScheme::Falcon512Poseidon2)) .with_component(BasicWallet) .build() .unwrap() @@ -339,7 +341,7 @@ fn create_account(public_key: PublicKey, index: u64, storage_mode: AccountStorag /// Creates a new faucet account. fn create_faucet() -> Account { let coin_seed: [u64; 4] = rand::rng().random(); - let mut rng = RpoRandomCoin::new(coin_seed.map(Felt::new).into()); + let mut rng = RandomCoin::new(coin_seed.map(Felt::new).into()); let key_pair = SecretKey::with_rng(&mut rng); let init_seed = [0_u8; 32]; @@ -350,7 +352,7 @@ fn create_faucet() -> Account { .with_component(BasicFungibleFaucet::new(token_symbol, 2, Felt::new(u64::MAX)).unwrap()) .with_auth_component(AuthSingleSig::new( key_pair.public_key().into(), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build() .unwrap() @@ -422,20 +424,24 @@ fn create_consume_note_tx( (AccountUpdateDetails::Private, Word::empty()) }; - ProvenTransactionBuilder::new( + let account_update = TxAccountUpdate::new( account.id(), init_hash, account.to_commitment(), account_delta_commitment, + details, + ) + .unwrap(); + ProvenTransaction::new( + account_update, + vec![InputNoteCommitment::from(input_note)], + Vec::::new(), block_ref.block_num(), block_ref.commitment(), fee_from_block(block_ref).unwrap(), u32::MAX.into(), ExecutionProof::new_dummy(), ) - .add_input_notes(vec![input_note]) - .account_update_details(details) - .build() .unwrap() } @@ -457,11 +463,21 @@ fn create_emit_note_tx( faucet.increment_nonce(ONE).unwrap(); - ProvenTransactionBuilder::new( + let account_update = TxAccountUpdate::new( faucet.id(), initial_account_hash, faucet.to_commitment(), Word::empty(), + AccountUpdateDetails::Private, + ) + .unwrap(); + ProvenTransaction::new( + account_update, + Vec::::new(), + output_notes + .into_iter() + .map(|note| OutputNote::Public(PublicOutputNote::new(note).unwrap())) + .collect::>(), block_ref.block_num(), block_ref.commitment(), FungibleAsset::new( @@ -472,8 +488,6 @@ fn create_emit_note_tx( u32::MAX.into(), ExecutionProof::new_dummy(), ) - .add_output_notes(output_notes.into_iter().map(OutputNote::Full).collect::>()) - .build() .unwrap() } @@ -513,7 +527,7 @@ async fn get_block_inputs( batch .input_notes() .into_iter() - .filter_map(|note| note.header().map(NoteHeader::commitment)) + .filter_map(|note| note.header().map(NoteHeader::to_commitment)) }), batches.iter().map(ProvenBatch::reference_block_num), ) diff --git a/bin/stress-test/src/store/mod.rs b/bin/stress-test/src/store/mod.rs index f1ea6e0f77..a9f1491fe5 100644 --- a/bin/stress-test/src/store/mod.rs +++ b/bin/stress-test/src/store/mod.rs @@ -9,7 +9,7 @@ use miden_node_utils::clap::StorageOptions; use miden_node_utils::tracing::grpc::OtelInterceptor; use miden_protocol::account::AccountId; use miden_protocol::note::{NoteDetails, NoteTag}; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use rand::Rng; use rand::seq::SliceRandom; use tokio::fs; diff --git a/crates/block-producer/Cargo.toml b/crates/block-producer/Cargo.toml index 6ca345217a..c5c62abb3a 100644 --- a/crates/block-producer/Cargo.toml +++ b/crates/block-producer/Cargo.toml @@ -54,4 +54,3 @@ rstest = { workspace = true } serial_test = "3.2" tempfile = { workspace = true } tokio = { features = ["test-util"], workspace = true } -winterfell = { version = "0.13" } diff --git a/crates/block-producer/src/block_builder/mod.rs b/crates/block-producer/src/block_builder/mod.rs index 56b5a3666f..0a669d2854 100644 --- a/crates/block-producer/src/block_builder/mod.rs +++ b/crates/block-producer/src/block_builder/mod.rs @@ -168,7 +168,7 @@ impl BlockBuilder { .input_notes() .iter() .cloned() - .filter_map(|note| note.header().map(NoteHeader::commitment)) + .filter_map(|note| note.header().map(NoteHeader::to_commitment)) }); let block_references_iter = batch_iter.clone().map(Deref::deref).map(ProvenBatch::reference_block_num); diff --git a/crates/block-producer/src/domain/transaction.rs b/crates/block-producer/src/domain/transaction.rs index f581ca95e8..825497f2ed 100644 --- a/crates/block-producer/src/domain/transaction.rs +++ b/crates/block-producer/src/domain/transaction.rs @@ -93,7 +93,7 @@ impl AuthenticatedTransaction { self.inner .output_notes() .iter() - .map(miden_protocol::transaction::OutputNote::commitment) + .map(miden_protocol::transaction::OutputNote::to_commitment) } pub fn output_notes(&self) -> impl Iterator + '_ { @@ -117,7 +117,7 @@ impl AuthenticatedTransaction { pub fn unauthenticated_note_commitments(&self) -> impl Iterator + '_ { self.inner .unauthenticated_notes() - .map(NoteHeader::commitment) + .map(NoteHeader::to_commitment) .filter(|commitment| !self.notes_authenticated_by_store.contains(commitment)) } diff --git a/crates/block-producer/src/errors.rs b/crates/block-producer/src/errors.rs index b610b0534a..daa798d7f6 100644 --- a/crates/block-producer/src/errors.rs +++ b/crates/block-producer/src/errors.rs @@ -7,6 +7,7 @@ use miden_protocol::block::BlockNumber; use miden_protocol::errors::{ProposedBatchError, ProposedBlockError, ProvenBatchError}; use miden_protocol::note::Nullifier; use miden_protocol::transaction::TransactionId; +use miden_protocol::utils::serde::DeserializationError; use miden_remote_prover_client::RemoteProverClientError; use thiserror::Error; use tokio::task::JoinError; @@ -119,7 +120,7 @@ pub enum AddTransactionError { }, #[error("transaction deserialization failed")] - TransactionDeserializationFailed(#[source] miden_protocol::utils::DeserializationError), + TransactionDeserializationFailed(#[source] DeserializationError), #[error( "transaction expired at block height {expired_at} but the block height limit was {limit}" @@ -167,7 +168,7 @@ impl From for AddTransactionError { #[grpc(internal)] pub enum SubmitProvenBatchError { #[error("batch deserialization failed")] - Deserialization(#[source] miden_protocol::utils::DeserializationError), + Deserialization(#[source] DeserializationError), } // Batch building errors diff --git a/crates/block-producer/src/mempool/nodes.rs b/crates/block-producer/src/mempool/nodes.rs index c41e305fab..6ae39d37d0 100644 --- a/crates/block-producer/src/mempool/nodes.rs +++ b/crates/block-producer/src/mempool/nodes.rs @@ -251,7 +251,7 @@ impl Node for ProvenBatchNode { fn output_note_commitments(&self) -> Box + '_> { Box::new( self.tx_headers() - .flat_map(|tx| tx.output_notes().iter().map(NoteHeader::commitment)), + .flat_map(|tx| tx.output_notes().iter().map(NoteHeader::to_commitment)), ) } @@ -261,7 +261,7 @@ impl Node for ProvenBatchNode { .input_notes() .iter() .filter_map(|note| note.header()) - .map(NoteHeader::commitment), + .map(NoteHeader::to_commitment), ) } @@ -302,7 +302,7 @@ impl Node for BlockNode { batch .input_notes() .iter() - .filter_map(|note| note.header().map(NoteHeader::commitment)) + .filter_map(|note| note.header().map(NoteHeader::to_commitment)) })) } diff --git a/crates/block-producer/src/mempool/subscription.rs b/crates/block-producer/src/mempool/subscription.rs index a09c1cc864..1da3bf03fe 100644 --- a/crates/block-producer/src/mempool/subscription.rs +++ b/crates/block-producer/src/mempool/subscription.rs @@ -68,8 +68,10 @@ impl SubscriptionProvider { let network_notes = tx .output_notes() .filter_map(|note| match note { - OutputNote::Full(inner) => inner.clone().into_account_target_network_note().ok(), - _ => None, + OutputNote::Public(inner) => { + inner.clone().into_note().into_account_target_network_note().ok() + }, + OutputNote::Private(_) => None, }) .collect(); let account_delta = diff --git a/crates/block-producer/src/store/mod.rs b/crates/block-producer/src/store/mod.rs index fb20bc160e..391f747ba1 100644 --- a/crates/block-producer/src/store/mod.rs +++ b/crates/block-producer/src/store/mod.rs @@ -14,7 +14,7 @@ use miden_protocol::batch::OrderedBatches; use miden_protocol::block::{BlockHeader, BlockInputs, BlockNumber, SignedBlock}; use miden_protocol::note::Nullifier; use miden_protocol::transaction::ProvenTransaction; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use tracing::{debug, info, instrument}; use url::Url; @@ -165,7 +165,7 @@ impl StoreClient { nullifiers: proven_tx.nullifiers().map(Into::into).collect(), unauthenticated_notes: proven_tx .unauthenticated_notes() - .map(|note| note.commitment().into()) + .map(|note| note.to_commitment().into()) .collect(), }; diff --git a/crates/block-producer/src/test_utils/mod.rs b/crates/block-producer/src/test_utils/mod.rs index 007fb60cb3..aea1ca35ae 100644 --- a/crates/block-producer/src/test_utils/mod.rs +++ b/crates/block-producer/src/test_utils/mod.rs @@ -1,6 +1,6 @@ use miden_protocol::Word; use miden_protocol::account::AccountId; -use miden_protocol::crypto::rand::{FeltRng, RpoRandomCoin}; +use miden_protocol::crypto::rand::{FeltRng, RandomCoin}; use miden_protocol::testing::account_id::AccountIdBuilder; use miden_protocol::transaction::TransactionId; @@ -20,7 +20,7 @@ pub mod note; /// /// It prints its seed on construction which allows us to reproduce /// test failures. -pub struct Random(RpoRandomCoin); +pub struct Random(RandomCoin); impl Random { /// Creates a [Random] with a random seed. This seed is logged @@ -30,7 +30,7 @@ impl Random { println!("Random::with_random_seed: {seed:?}"); - Self(RpoRandomCoin::new(Word::from(seed))) + Self(RandomCoin::new(Word::from(seed))) } pub fn draw_tx_id(&mut self) -> TransactionId { diff --git a/crates/block-producer/src/test_utils/note.rs b/crates/block-producer/src/test_utils/note.rs index 6defeac83d..c2bd627a78 100644 --- a/crates/block-producer/src/test_utils/note.rs +++ b/crates/block-producer/src/test_utils/note.rs @@ -1,5 +1,5 @@ use miden_protocol::note::Note; -use miden_protocol::transaction::OutputNote; +use miden_protocol::transaction::{OutputNote, PublicOutputNote}; use miden_standards::testing::note::NoteBuilder; use rand_chacha::ChaCha20Rng; use rand_chacha::rand_core::SeedableRng; @@ -12,5 +12,5 @@ pub fn mock_note(num: u8) -> Note { } pub fn mock_output_note(num: u8) -> OutputNote { - OutputNote::Full(mock_note(num)) + OutputNote::Public(PublicOutputNote::new(mock_note(num)).unwrap()) } diff --git a/crates/block-producer/src/test_utils/proven_tx.rs b/crates/block-producer/src/test_utils/proven_tx.rs index b8d67e9fbe..6af29a0ac4 100644 --- a/crates/block-producer/src/test_utils/proven_tx.rs +++ b/crates/block-producer/src/test_utils/proven_tx.rs @@ -4,14 +4,17 @@ use std::sync::Arc; use itertools::Itertools; use miden_node_utils::fee::test_fee; use miden_protocol::account::AccountId; +use miden_protocol::account::delta::AccountUpdateDetails; use miden_protocol::asset::FungibleAsset; use miden_protocol::block::BlockNumber; use miden_protocol::note::{Note, Nullifier}; use miden_protocol::transaction::{ InputNote, + InputNoteCommitment, OutputNote, + PrivateNoteHeader, ProvenTransaction, - ProvenTransactionBuilder, + TxAccountUpdate, }; use miden_protocol::vm::ExecutionProof; use miden_protocol::{Felt, ONE, Word}; @@ -131,7 +134,7 @@ impl MockProvenTxBuilder { .map(|note_index| { let note = Note::mock_noop(Word::from([0, 0, 0, note_index])); - OutputNote::Header(note.header().clone()) + OutputNote::Private(PrivateNoteHeader::new(note.header().clone()).unwrap()) }) .collect(); @@ -139,21 +142,31 @@ impl MockProvenTxBuilder { } pub fn build(self) -> ProvenTransaction { - ProvenTransactionBuilder::new( + let account_update = TxAccountUpdate::new( self.account_id, self.initial_account_commitment, self.final_account_commitment, Word::empty(), + AccountUpdateDetails::Private, + ) + .unwrap(); + let input_notes: Vec = self + .input_notes + .unwrap_or_default() + .into_iter() + .map(InputNoteCommitment::from) + .chain(self.nullifiers.unwrap_or_default().into_iter().map(InputNoteCommitment::from)) + .collect(); + ProvenTransaction::new( + account_update, + input_notes, + self.output_notes.unwrap_or_default(), BlockNumber::GENESIS, Word::empty(), self.fee, self.expiration_block_num, ExecutionProof::new_dummy(), ) - .add_input_notes(self.input_notes.unwrap_or_default()) - .add_input_notes(self.nullifiers.unwrap_or_default()) - .add_output_notes(self.output_notes.unwrap_or_default()) - .build() .unwrap() } } diff --git a/crates/block-producer/src/validator/mod.rs b/crates/block-producer/src/validator/mod.rs index 9844e2d9b3..085ea61f12 100644 --- a/crates/block-producer/src/validator/mod.rs +++ b/crates/block-producer/src/validator/mod.rs @@ -2,7 +2,7 @@ use miden_node_proto::clients::{Builder, ValidatorClient}; use miden_node_proto::generated as proto; use miden_protocol::block::ProposedBlock; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::Signature; -use miden_protocol::utils::{Deserializable, DeserializationError, Serializable}; +use miden_protocol::utils::serde::{Deserializable, DeserializationError, Serializable}; use thiserror::Error; use tracing::{info, instrument}; use url::Url; diff --git a/crates/db/src/conv.rs b/crates/db/src/conv.rs index 64c853c73d..8da9b50d38 100644 --- a/crates/db/src/conv.rs +++ b/crates/db/src/conv.rs @@ -151,7 +151,7 @@ pub(crate) fn raw_sql_to_nonce(raw: i64) -> Felt { } #[inline(always)] pub(crate) fn nonce_to_raw_sql(nonce: Felt) -> i64 { - nonce.as_int() as i64 + nonce.as_canonical_u64() as i64 } #[inline(always)] diff --git a/crates/large-smt-backend-rocksdb/Cargo.toml b/crates/large-smt-backend-rocksdb/Cargo.toml index d1226512d0..5109ecc9c3 100644 --- a/crates/large-smt-backend-rocksdb/Cargo.toml +++ b/crates/large-smt-backend-rocksdb/Cargo.toml @@ -19,7 +19,6 @@ miden-crypto = { features = ["concurrent", "std"], workspace = true } miden-protocol = { features = ["std"], workspace = true } rayon = { version = "1.10" } rocksdb = { default-features = false, features = ["bindgen-runtime", "lz4"], version = "0.24" } -winter-utils = { version = "0.13" } [build-dependencies] miden-node-rocksdb-cxx-linkage-fix = { workspace = true } diff --git a/crates/large-smt-backend-rocksdb/src/rocksdb.rs b/crates/large-smt-backend-rocksdb/src/rocksdb.rs index 92f187c4d9..1a54feb475 100644 --- a/crates/large-smt-backend-rocksdb/src/rocksdb.rs +++ b/crates/large-smt-backend-rocksdb/src/rocksdb.rs @@ -6,6 +6,7 @@ use std::sync::Arc; use miden_crypto::Map; use miden_crypto::merkle::NodeIndex; use miden_crypto::merkle::smt::{InnerNode, SmtLeaf, Subtree}; +use miden_crypto::utils::{Deserializable, Serializable}; use rocksdb::{ BlockBasedOptions, Cache, @@ -20,7 +21,6 @@ use rocksdb::{ ReadOptions, WriteBatch, }; -use winter_utils::{Deserializable, Serializable}; use super::{SmtStorage, StorageError, StorageUpdateParts, StorageUpdates, SubtreeUpdate}; use crate::helpers::{insert_into_leaf, map_rocksdb_err, remove_from_leaf}; @@ -44,8 +44,6 @@ const METADATA_CF: &str = "metadata"; /// rebuilding. const DEPTH_24_CF: &str = "depth24"; -/// The key used in the `METADATA_CF` column family to store the SMT's root hash. -const ROOT_KEY: &[u8] = b"smt_root"; /// The key used in the `METADATA_CF` column family to store the total count of non-empty leaves. const LEAF_COUNT_KEY: &[u8] = b"leaf_count"; /// The key used in the `METADATA_CF` column family to store the total count of key-value entries. @@ -241,7 +239,7 @@ impl RocksDbStorage { 56 => 7, d => panic!("unsupported depth {d}"), }; - KeyBytes::new(index.value(), keep) + KeyBytes::new(index.position(), keep) } /// Retrieves a handle to a `RocksDB` column family by its name. @@ -264,35 +262,6 @@ impl RocksDbStorage { } impl SmtStorage for RocksDbStorage { - /// Retrieves the SMT root hash from the `METADATA_CF` column family. - /// - /// # Errors - /// - `StorageError::Backend`: If the metadata column family is missing or a RocksDB error - /// occurs. - /// - `StorageError::DeserializationError`: If the retrieved root hash bytes cannot be - /// deserialized. - fn get_root(&self) -> Result, StorageError> { - let cf = self.cf_handle(METADATA_CF)?; - match self.db.get_cf(cf, ROOT_KEY).map_err(map_rocksdb_err)? { - Some(bytes) => { - let digest = Word::read_from_bytes(&bytes)?; - Ok(Some(digest)) - }, - None => Ok(None), - } - } - - /// Stores the SMT root hash in the `METADATA_CF` column family. - /// - /// # Errors - /// - `StorageError::Backend`: If the metadata column family is missing or a RocksDB error - /// occurs. - fn set_root(&self, root: Word) -> Result<(), StorageError> { - let cf = self.cf_handle(METADATA_CF)?; - self.db.put_cf(cf, ROOT_KEY, root.to_bytes()).map_err(map_rocksdb_err)?; - Ok(()) - } - /// Retrieves the total count of non-empty leaves from the `METADATA_CF` column family. /// Returns 0 if the count is not found. /// @@ -355,7 +324,7 @@ impl SmtStorage for RocksDbStorage { /// - `StorageError::DeserializationError`: If existing leaf data is corrupt. #[expect(clippy::single_match_else)] fn insert_value( - &self, + &mut self, index: u64, key: Word, value: Word, @@ -428,7 +397,7 @@ impl SmtStorage for RocksDbStorage { /// # Errors /// - `StorageError::Backend`: If column families are missing or a RocksDB error occurs. /// - `StorageError::DeserializationError`: If existing leaf data is corrupt. - fn remove_value(&self, index: u64, key: Word) -> Result, StorageError> { + fn remove_value(&mut self, index: u64, key: Word) -> Result, StorageError> { let Some(mut leaf) = self.get_leaf(index)? else { return Ok(None); }; @@ -488,7 +457,7 @@ impl SmtStorage for RocksDbStorage { /// /// # Errors /// - `StorageError::Backend`: If column families are missing or a RocksDB error occurs. - fn set_leaves(&self, leaves: Map) -> Result<(), StorageError> { + fn set_leaves(&mut self, leaves: Map) -> Result<(), StorageError> { let cf = self.cf_handle(LEAVES_CF)?; let leaf_count: usize = leaves.len(); let entry_count: usize = leaves.values().map(|leaf| leaf.entries().len()).sum(); @@ -519,7 +488,7 @@ impl SmtStorage for RocksDbStorage { /// - `StorageError::Backend`: If the leaves column family is missing or a RocksDB error occurs. /// - `StorageError::DeserializationError`: If the retrieved (to be returned) leaf data is /// corrupt. - fn remove_leaf(&self, index: u64) -> Result, StorageError> { + fn remove_leaf(&mut self, index: u64) -> Result, StorageError> { let key = Self::index_db_key(index); let cf = self.cf_handle(LEAVES_CF)?; let old_bytes = self.db.get_cf(cf, key).map_err(map_rocksdb_err)?; @@ -676,7 +645,7 @@ impl SmtStorage for RocksDbStorage { /// # Errors /// - Returns `StorageError` if column family lookup, serialization, or the write operation /// fails. - fn set_subtree(&self, subtree: &Subtree) -> Result<(), StorageError> { + fn set_subtree(&mut self, subtree: &Subtree) -> Result<(), StorageError> { let subtrees_cf = self.subtree_cf(subtree.root_index()); let mut batch = WriteBatch::default(); @@ -692,7 +661,7 @@ impl SmtStorage for RocksDbStorage { .hash(); let depth24_cf = self.cf_handle(DEPTH_24_CF)?; - let hash_key = Self::index_db_key(subtree.root_index().value()); + let hash_key = Self::index_db_key(subtree.root_index().position()); batch.put_cf(depth24_cf, hash_key, root_hash.to_bytes()); } @@ -714,7 +683,7 @@ impl SmtStorage for RocksDbStorage { /// /// # Errors /// - Returns `StorageError::Backend` if any column family lookup or RocksDB write fails. - fn set_subtrees(&self, subtrees: Vec) -> Result<(), StorageError> { + fn set_subtrees(&mut self, subtrees: Vec) -> Result<(), StorageError> { let depth24_cf = self.cf_handle(DEPTH_24_CF)?; let mut batch = WriteBatch::default(); @@ -727,7 +696,7 @@ impl SmtStorage for RocksDbStorage { if subtree.root_index().depth() == IN_MEMORY_DEPTH && let Some(root_node) = subtree.get_inner_node(subtree.root_index()) { - let hash_key = Self::index_db_key(subtree.root_index().value()); + let hash_key = Self::index_db_key(subtree.root_index().position()); batch.put_cf(depth24_cf, hash_key, root_node.hash().to_bytes()); } } @@ -741,7 +710,7 @@ impl SmtStorage for RocksDbStorage { /// # Errors /// - `StorageError::Backend`: If the subtrees column family is missing or a RocksDB error /// occurs. - fn remove_subtree(&self, index: NodeIndex) -> Result<(), StorageError> { + fn remove_subtree(&mut self, index: NodeIndex) -> Result<(), StorageError> { let subtrees_cf = self.subtree_cf(index); let mut batch = WriteBatch::default(); @@ -751,7 +720,7 @@ impl SmtStorage for RocksDbStorage { // Also remove level 24 hash cache if this is a level 24 subtree if index.depth() == IN_MEMORY_DEPTH { let depth24_cf = self.cf_handle(DEPTH_24_CF)?; - let hash_key = Self::index_db_key(index.value()); + let hash_key = Self::index_db_key(index.position()); batch.delete_cf(depth24_cf, hash_key); } @@ -790,7 +759,7 @@ impl SmtStorage for RocksDbStorage { /// - `StorageError::Backend`: If `index.depth() < IN_MEMORY_DEPTH`, or if RocksDB errors occur. /// - `StorageError::Value`: If existing Subtree data is corrupt. fn set_inner_node( - &self, + &mut self, index: NodeIndex, node: InnerNode, ) -> Result, StorageError> { @@ -818,7 +787,7 @@ impl SmtStorage for RocksDbStorage { /// # Errors /// - `StorageError::Backend`: If `index.depth() < IN_MEMORY_DEPTH`, or if RocksDB errors occur. /// - `StorageError::Value`: If existing Subtree data is corrupt. - fn remove_inner_node(&self, index: NodeIndex) -> Result, StorageError> { + fn remove_inner_node(&mut self, index: NodeIndex) -> Result, StorageError> { if index.depth() < IN_MEMORY_DEPTH { return Err(StorageError::Unsupported( "Cannot remove inner node from upper part of the tree".into(), @@ -856,7 +825,7 @@ impl SmtStorage for RocksDbStorage { /// /// # Errors /// - `StorageError::Backend`: If any column family is missing or a RocksDB write error occurs. - fn apply(&self, updates: StorageUpdates) -> Result<(), StorageError> { + fn apply(&mut self, updates: StorageUpdates) -> Result<(), StorageError> { use rayon::prelude::*; let mut batch = WriteBatch::default(); @@ -868,7 +837,6 @@ impl SmtStorage for RocksDbStorage { let StorageUpdateParts { leaf_updates, subtree_updates, - new_root, leaf_count_delta, entry_count_delta, } = updates.into_parts(); @@ -896,14 +864,14 @@ impl SmtStorage for RocksDbStorage { .then(|| subtree.get_inner_node(index)) .flatten() .map(|root_node| { - let hash_key = Self::index_db_key(index.value()); + let hash_key = Self::index_db_key(index.position()); (hash_key, Some(root_node.hash().to_bytes())) }); (index, Some(bytes), depth24_op) }, SubtreeUpdate::Delete { index } => { let depth24_op = is_depth_24(index).then(|| { - let hash_key = Self::index_db_key(index.value()); + let hash_key = Self::index_db_key(index.position()); (hash_key, None) }); (index, None, depth24_op) @@ -943,8 +911,6 @@ impl SmtStorage for RocksDbStorage { batch.put_cf(metadata_cf, ENTRY_COUNT_KEY, new_entry_count.to_be_bytes()); } - batch.put_cf(metadata_cf, ROOT_KEY, new_root.to_bytes()); - let mut write_opts = rocksdb::WriteOptions::default(); // Disable immediate WAL sync to disk for better performance write_opts.set_sync(false); diff --git a/crates/ntx-builder/src/actor/execute.rs b/crates/ntx-builder/src/actor/execute.rs index e2bb27347e..9718056eea 100644 --- a/crates/ntx-builder/src/actor/execute.rs +++ b/crates/ntx-builder/src/actor/execute.rs @@ -49,7 +49,6 @@ use miden_tx::{ TransactionProverError, }; use tokio::sync::Mutex; -use tokio::task::JoinError; use tracing::{Instrument, instrument}; use crate::COMPONENT; @@ -71,8 +70,6 @@ pub enum NtxError { Proving(#[source] TransactionProverError), #[error("failed to submit transaction")] Submission(#[source] tonic::Status), - #[error("the ntx task panicked")] - Panic(#[source] JoinError), } type NtxResult = Result; @@ -141,9 +138,14 @@ impl NtxContext { &self, data_store: &'a NtxDataStore, ) -> TransactionExecutor<'a, 'b, NtxDataStore, UnreachableAuth> { - let exec_options = - ExecutionOptions::new(Some(self.max_cycles), self.max_cycles, false, false) - .expect("max_cycles should be within valid range"); + let exec_options = ExecutionOptions::new( + Some(self.max_cycles), + self.max_cycles, + ExecutionOptions::DEFAULT_CORE_TRACE_FRAGMENT_SIZE, + false, + false, + ) + .expect("max_cycles should be within valid range"); TransactionExecutor::new(data_store) .with_options(exec_options) @@ -317,11 +319,9 @@ impl NtxContext { if let Some(remote) = &self.prover { remote.prove(tx_inputs).await } else { - // Only perform tx inptus clone for local proving. + // Only perform tx inputs clone for local proving. let tx_inputs = tx_inputs.clone(); - tokio::task::spawn_blocking(move || LocalTransactionProver::default().prove(tx_inputs)) - .await - .map_err(NtxError::Panic)? + LocalTransactionProver::default().prove(tx_inputs).await } .map_err(NtxError::Proving) } diff --git a/crates/ntx-builder/src/clients/block_producer.rs b/crates/ntx-builder/src/clients/block_producer.rs index 94227ba22d..c58522165b 100644 --- a/crates/ntx-builder/src/clients/block_producer.rs +++ b/crates/ntx-builder/src/clients/block_producer.rs @@ -6,7 +6,7 @@ use miden_node_proto::domain::mempool::MempoolEvent; use miden_node_proto::generated::{self as proto}; use miden_node_utils::FlattenResult; use miden_protocol::transaction::ProvenTransaction; -use miden_tx::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use tokio_stream::StreamExt; use tonic::Status; use tracing::{info, instrument}; diff --git a/crates/ntx-builder/src/clients/store.rs b/crates/ntx-builder/src/clients/store.rs index 1f8c7b5f72..598de6d672 100644 --- a/crates/ntx-builder/src/clients/store.rs +++ b/crates/ntx-builder/src/clients/store.rs @@ -26,8 +26,8 @@ use miden_protocol::crypto::merkle::mmr::{Forest, MmrPeaks, PartialMmr}; use miden_protocol::crypto::merkle::smt::SmtProof; use miden_protocol::note::NoteScript; use miden_protocol::transaction::AccountInputs; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_standards::note::AccountTargetNetworkNote; -use miden_tx::utils::{Deserializable, Serializable}; use thiserror::Error; use tracing::{info, instrument}; use url::Url; diff --git a/crates/ntx-builder/src/clients/validator.rs b/crates/ntx-builder/src/clients/validator.rs index 6488c61675..9b095079b7 100644 --- a/crates/ntx-builder/src/clients/validator.rs +++ b/crates/ntx-builder/src/clients/validator.rs @@ -3,7 +3,7 @@ use std::time::Duration; use miden_node_proto::clients::{Builder, ValidatorClient as InnerValidatorClient}; use miden_node_proto::generated::{self as proto}; use miden_protocol::transaction::{ProvenTransaction, TransactionInputs}; -use miden_tx::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use tonic::Status; use tracing::{info, instrument}; use url::Url; diff --git a/crates/ntx-builder/src/db/models/conv.rs b/crates/ntx-builder/src/db/models/conv.rs index dd129df728..0fed2b9593 100644 --- a/crates/ntx-builder/src/db/models/conv.rs +++ b/crates/ntx-builder/src/db/models/conv.rs @@ -7,7 +7,7 @@ use miden_protocol::account::{Account, AccountId}; use miden_protocol::block::{BlockHeader, BlockNumber}; use miden_protocol::note::{NoteId, NoteScript, Nullifier}; use miden_protocol::transaction::TransactionId; -use miden_tx::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; // SERIALIZATION (domain → DB) // ================================================================================================ diff --git a/crates/ntx-builder/src/db/models/queries/mod.rs b/crates/ntx-builder/src/db/models/queries/mod.rs index e831c3ba8a..3d71f3a94d 100644 --- a/crates/ntx-builder/src/db/models/queries/mod.rs +++ b/crates/ntx-builder/src/db/models/queries/mod.rs @@ -9,8 +9,8 @@ use miden_protocol::account::delta::AccountUpdateDetails; use miden_protocol::block::{BlockHeader, BlockNumber}; use miden_protocol::note::Nullifier; use miden_protocol::transaction::TransactionId; +use miden_protocol::utils::serde::Serializable; use miden_standards::note::AccountTargetNetworkNote; -use miden_tx::utils::Serializable; use super::account_effect::NetworkAccountEffect; use crate::db::models::conv as conversions; diff --git a/crates/ntx-builder/src/db/models/queries/notes.rs b/crates/ntx-builder/src/db/models/queries/notes.rs index 533ec5d6e7..54022d774f 100644 --- a/crates/ntx-builder/src/db/models/queries/notes.rs +++ b/crates/ntx-builder/src/db/models/queries/notes.rs @@ -5,8 +5,8 @@ use miden_node_db::DatabaseError; use miden_node_proto::domain::account::NetworkAccountId; use miden_protocol::block::BlockNumber; use miden_protocol::note::{Note, Nullifier}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_standards::note::AccountTargetNetworkNote; -use miden_tx::utils::{Deserializable, Serializable}; use crate::NoteError; use crate::db::models::conv as conversions; diff --git a/crates/ntx-builder/src/test_utils.rs b/crates/ntx-builder/src/test_utils.rs index 10c00eed64..1c2c743106 100644 --- a/crates/ntx-builder/src/test_utils.rs +++ b/crates/ntx-builder/src/test_utils.rs @@ -32,8 +32,12 @@ pub fn mock_network_account_id_seeded(seed: u8) -> NetworkAccountId { /// Creates a unique `TransactionId` from a seed value. pub fn mock_tx_id(seed: u64) -> TransactionId { + use miden_protocol::testing::account_id::ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET; + let w = |n: u64| Word::try_from([n, 0, 0, 0]).unwrap(); - TransactionId::new(w(seed), w(seed + 1), w(seed + 2), w(seed + 3)) + let faucet_id = AccountId::try_from(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET).unwrap(); + let fee = miden_protocol::asset::FungibleAsset::new(faucet_id, 0).unwrap(); + TransactionId::new(w(seed), w(seed + 1), w(seed + 2), w(seed + 3), fee) } /// Creates a `AccountTargetNetworkNote` targeting the given network account. diff --git a/crates/proto/src/domain/account.rs b/crates/proto/src/domain/account.rs index aeec888328..3772241c95 100644 --- a/crates/proto/src/domain/account.rs +++ b/crates/proto/src/domain/account.rs @@ -20,7 +20,7 @@ use miden_protocol::block::account_tree::AccountWitness; use miden_protocol::crypto::merkle::SparseMerklePath; use miden_protocol::crypto::merkle::smt::SmtProof; use miden_protocol::note::NoteAttachment; -use miden_protocol::utils::{Deserializable, DeserializationError, Serializable}; +use miden_protocol::utils::serde::{Deserializable, DeserializationError, Serializable}; use miden_standards::note::{NetworkAccountTarget, NetworkAccountTargetError}; use thiserror::Error; @@ -298,7 +298,7 @@ impl From for proto::account::AccountHeader { vault_root: Some(header.vault_root().into()), storage_commitment: Some(header.storage_commitment().into()), code_commitment: Some(header.code_commitment().into()), - nonce: header.nonce().as_int(), + nonce: header.nonce().as_canonical_u64(), } } } @@ -373,14 +373,9 @@ impl TryFrom for AccountVaultDetails { if too_many_assets { Ok(Self::LimitExceeded) } else { - let parsed_assets = - Result::, ConversionError>::from_iter(assets.into_iter().map(|asset| { - let asset = asset - .asset - .ok_or(proto::primitives::Asset::missing_field(stringify!(asset)))?; - let asset = Word::try_from(asset)?; - Asset::try_from(asset).map_err(ConversionError::AssetError) - }))?; + let parsed_assets = Result::, ConversionError>::from_iter( + assets.into_iter().map(Asset::try_from), + )?; Ok(Self::Assets(parsed_assets)) } } @@ -395,9 +390,7 @@ impl From for proto::rpc::AccountVaultDetails { }, AccountVaultDetails::Assets(assets) => Self { too_many_assets: false, - assets: Vec::from_iter(assets.into_iter().map(|asset| proto::primitives::Asset { - asset: Some(proto::primitives::Digest::from(Word::from(asset))), - })), + assets: Vec::from_iter(assets.into_iter().map(proto::primitives::Asset::from)), }, } } @@ -1008,17 +1001,20 @@ impl TryFrom for Asset { type Error = ConversionError; fn try_from(value: proto::primitives::Asset) -> Result { - let inner = value.asset.ok_or(proto::primitives::Asset::missing_field("asset"))?; - let word = Word::try_from(inner)?; + let key = value.key.ok_or(proto::primitives::Asset::missing_field("key"))?; + let key_word = Word::try_from(key)?; + let value = value.value.ok_or(proto::primitives::Asset::missing_field("value"))?; + let value_word = Word::try_from(value)?; - Asset::try_from(word).map_err(ConversionError::AssetError) + Asset::from_key_value_words(key_word, value_word).map_err(ConversionError::AssetError) } } impl From for proto::primitives::Asset { fn from(asset_from: Asset) -> Self { proto::primitives::Asset { - asset: Some(Word::from(asset_from).into()), + key: Some(asset_from.to_key_word().into()), + value: Some(asset_from.to_value_word().into()), } } } diff --git a/crates/proto/src/domain/batch.rs b/crates/proto/src/domain/batch.rs index 1cccf6ab8b..0c17a7eadf 100644 --- a/crates/proto/src/domain/batch.rs +++ b/crates/proto/src/domain/batch.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use miden_protocol::block::BlockHeader; use miden_protocol::note::{NoteId, NoteInclusionProof}; use miden_protocol::transaction::PartialBlockchain; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use crate::errors::{ConversionError, MissingFieldHelper}; use crate::generated as proto; diff --git a/crates/proto/src/domain/block.rs b/crates/proto/src/domain/block.rs index 112f84e50b..6383c255db 100644 --- a/crates/proto/src/domain/block.rs +++ b/crates/proto/src/domain/block.rs @@ -14,7 +14,7 @@ use miden_protocol::block::{ use miden_protocol::crypto::dsa::ecdsa_k256_keccak::{PublicKey, Signature}; use miden_protocol::note::{NoteId, NoteInclusionProof}; use miden_protocol::transaction::PartialBlockchain; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use thiserror::Error; use crate::errors::{ConversionError, MissingFieldHelper}; diff --git a/crates/proto/src/domain/digest.rs b/crates/proto/src/domain/digest.rs index 08d8c3f9a1..d411c100fd 100644 --- a/crates/proto/src/domain/digest.rs +++ b/crates/proto/src/domain/digest.rs @@ -3,7 +3,7 @@ use std::fmt::{Debug, Display, Formatter}; use hex::{FromHex, ToHex}; use miden_protocol::account::StorageMapKey; use miden_protocol::note::NoteId; -use miden_protocol::{Felt, StarkField, Word}; +use miden_protocol::{Felt, Word}; use crate::errors::ConversionError; use crate::generated as proto; @@ -106,10 +106,10 @@ impl From<&[u64; 4]> for proto::primitives::Digest { impl From<[Felt; 4]> for proto::primitives::Digest { fn from(value: [Felt; 4]) -> Self { Self { - d0: value[0].as_int(), - d1: value[1].as_int(), - d2: value[2].as_int(), - d3: value[3].as_int(), + d0: value[0].as_canonical_u64(), + d1: value[1].as_canonical_u64(), + d2: value[2].as_canonical_u64(), + d3: value[3].as_canonical_u64(), } } } @@ -123,10 +123,10 @@ impl From<&[Felt; 4]> for proto::primitives::Digest { impl From for proto::primitives::Digest { fn from(value: Word) -> Self { Self { - d0: value[0].as_int(), - d1: value[1].as_int(), - d2: value[2].as_int(), - d3: value[3].as_int(), + d0: value[0].as_canonical_u64(), + d1: value[1].as_canonical_u64(), + d2: value[2].as_canonical_u64(), + d3: value[3].as_canonical_u64(), } } } @@ -174,10 +174,7 @@ impl TryFrom for [Felt; 4] { type Error = ConversionError; fn try_from(value: proto::primitives::Digest) -> Result { - if [value.d0, value.d1, value.d2, value.d3] - .iter() - .any(|v| *v >= ::MODULUS) - { + if [value.d0, value.d1, value.d2, value.d3].iter().any(|v| *v >= Felt::ORDER) { return Err(ConversionError::NotAValidFelt); } diff --git a/crates/proto/src/domain/mempool.rs b/crates/proto/src/domain/mempool.rs index c9bf76bfc9..e6b01bd61c 100644 --- a/crates/proto/src/domain/mempool.rs +++ b/crates/proto/src/domain/mempool.rs @@ -4,7 +4,7 @@ use miden_protocol::account::delta::AccountUpdateDetails; use miden_protocol::block::BlockHeader; use miden_protocol::note::Nullifier; use miden_protocol::transaction::TransactionId; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_standards::note::AccountTargetNetworkNote; use crate::errors::{ConversionError, MissingFieldHelper}; diff --git a/crates/proto/src/domain/merkle.rs b/crates/proto/src/domain/merkle.rs index ed14d523ba..992e115629 100644 --- a/crates/proto/src/domain/merkle.rs +++ b/crates/proto/src/domain/merkle.rs @@ -130,7 +130,7 @@ impl From for proto::primitives::SmtLeaf { use proto::primitives::smt_leaf::Leaf; let leaf = match smt_leaf { - SmtLeaf::Empty(leaf_index) => Leaf::EmptyLeafIndex(leaf_index.value()), + SmtLeaf::Empty(leaf_index) => Leaf::EmptyLeafIndex(leaf_index.position()), SmtLeaf::Single(entry) => Leaf::Single(entry.into()), SmtLeaf::Multiple(entries) => Leaf::Multiple(proto::primitives::SmtLeafEntryList { entries: convert(entries).collect(), diff --git a/crates/proto/src/domain/note.rs b/crates/proto/src/domain/note.rs index 6a750a6582..7fbe698ffa 100644 --- a/crates/proto/src/domain/note.rs +++ b/crates/proto/src/domain/note.rs @@ -13,7 +13,7 @@ use miden_protocol::note::{ NoteTag, NoteType, }; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_protocol::{MastForest, MastNodeId, Word}; use miden_standards::note::AccountTargetNetworkNote; @@ -156,7 +156,7 @@ impl From<(&NoteId, &NoteInclusionProof)> for proto::note::NoteInclusionInBlockP Self { note_id: Some(note_id.into()), block_num: proof.location().block_num().as_u32(), - note_index_in_block: proof.location().node_index_in_block().into(), + note_index_in_block: proof.location().block_note_tree_index().into(), inclusion_path: Some(proof.note_path().clone().into()), } } diff --git a/crates/proto/src/domain/proof_request.rs b/crates/proto/src/domain/proof_request.rs index f6a40d7537..2b92bb935e 100644 --- a/crates/proto/src/domain/proof_request.rs +++ b/crates/proto/src/domain/proof_request.rs @@ -3,7 +3,7 @@ use miden_protocol::batch::OrderedBatches; use miden_protocol::block::{BlockHeader, BlockInputs}; -use miden_protocol::utils::{ +use miden_protocol::utils::serde::{ ByteReader, ByteWriter, Deserializable, diff --git a/crates/proto/src/domain/transaction.rs b/crates/proto/src/domain/transaction.rs index 62052eb633..0da1a05762 100644 --- a/crates/proto/src/domain/transaction.rs +++ b/crates/proto/src/domain/transaction.rs @@ -1,7 +1,6 @@ use miden_protocol::Word; use miden_protocol::note::Nullifier; use miden_protocol::transaction::{InputNoteCommitment, TransactionId}; -use miden_protocol::utils::{Deserializable, Serializable}; use crate::errors::{ConversionError, MissingFieldHelper}; use crate::generated as proto; @@ -85,13 +84,6 @@ impl TryFrom for InputNoteCommitment { let header: Option = value.header.map(TryInto::try_into).transpose()?; - // TODO: https://github.com/0xMiden/node/issues/1783 - // InputNoteCommitment has private fields, so we reconstruct it via - // serialization roundtrip using its Serializable/Deserializable impls. - let mut bytes = Vec::new(); - nullifier.write_into(&mut bytes); - header.write_into(&mut bytes); - InputNoteCommitment::read_from_bytes(&bytes) - .map_err(|err| ConversionError::deserialization_error("InputNoteCommitment", err)) + Ok(InputNoteCommitment::from_parts_unchecked(nullifier, header)) } } diff --git a/crates/proto/src/errors/mod.rs b/crates/proto/src/errors/mod.rs index 04493e6960..75d5bf8701 100644 --- a/crates/proto/src/errors/mod.rs +++ b/crates/proto/src/errors/mod.rs @@ -5,7 +5,7 @@ use std::num::TryFromIntError; pub use miden_node_grpc_error_macro::GrpcError; use miden_protocol::crypto::merkle::smt::{SmtLeafError, SmtProofError}; use miden_protocol::errors::{AccountError, AssetError, FeeError, NoteError, StorageSlotNameError}; -use miden_protocol::utils::DeserializationError; +use miden_protocol::utils::serde::DeserializationError; use miden_standards::note::NetworkAccountTargetError; use thiserror::Error; diff --git a/crates/remote-prover-client/src/remote_prover/batch_prover.rs b/crates/remote-prover-client/src/remote_prover/batch_prover.rs index b0d472656a..c5c100f3e1 100644 --- a/crates/remote-prover-client/src/remote_prover/batch_prover.rs +++ b/crates/remote-prover-client/src/remote_prover/batch_prover.rs @@ -10,7 +10,7 @@ use miden_protocol::transaction::{ TransactionHeader, TransactionId, }; -use miden_protocol::utils::{Deserializable, DeserializationError, Serializable}; +use miden_protocol::utils::serde::{Deserializable, DeserializationError, Serializable}; use tokio::sync::Mutex; use super::generated::api_client::ApiClient; @@ -110,7 +110,6 @@ impl RemoteBatchProver { &self, proposed_batch: ProposedBatch, ) -> Result { - use miden_protocol::utils::Serializable; self.connect().await?; let mut client = self diff --git a/crates/remote-prover-client/src/remote_prover/block_prover.rs b/crates/remote-prover-client/src/remote_prover/block_prover.rs index c1562e5975..e59d605d74 100644 --- a/crates/remote-prover-client/src/remote_prover/block_prover.rs +++ b/crates/remote-prover-client/src/remote_prover/block_prover.rs @@ -6,7 +6,7 @@ use core::time::Duration; use miden_protocol::batch::{OrderedBatches, ProvenBatch}; use miden_protocol::block::{BlockHeader, BlockInputs, BlockProof, ProposedBlock, ProvenBlock}; use miden_protocol::transaction::{OrderedTransactionHeaders, TransactionHeader}; -use miden_protocol::utils::{Deserializable, DeserializationError, Serializable}; +use miden_protocol::utils::serde::{Deserializable, DeserializationError, Serializable}; use tokio::sync::Mutex; use super::generated::api_client::ApiClient; @@ -108,7 +108,6 @@ impl RemoteBlockProver { block_header: &BlockHeader, block_inputs: BlockInputs, ) -> Result { - use miden_protocol::utils::Serializable; self.connect().await?; let mut client = self diff --git a/crates/remote-prover-client/src/remote_prover/tx_prover.rs b/crates/remote-prover-client/src/remote_prover/tx_prover.rs index 3bee6199fa..be213904c2 100644 --- a/crates/remote-prover-client/src/remote_prover/tx_prover.rs +++ b/crates/remote-prover-client/src/remote_prover/tx_prover.rs @@ -4,7 +4,7 @@ use alloc::sync::Arc; use core::time::Duration; use miden_protocol::transaction::{ProvenTransaction, TransactionInputs}; -use miden_protocol::utils::{Deserializable, DeserializationError, Serializable}; +use miden_protocol::utils::serde::{Deserializable, DeserializationError, Serializable}; use miden_protocol::vm::FutureMaybeSend; use miden_tx::TransactionProverError; use tokio::sync::Mutex; @@ -107,7 +107,6 @@ impl RemoteTransactionProver { tx_inputs: &TransactionInputs, ) -> impl FutureMaybeSend> { async move { - use miden_protocol::utils::Serializable; self.connect().await.map_err(|err| { TransactionProverError::other_with_source( "failed to connect to the remote prover", diff --git a/crates/rpc/Cargo.toml b/crates/rpc/Cargo.toml index 537173e67d..60e48c3ded 100644 --- a/crates/rpc/Cargo.toml +++ b/crates/rpc/Cargo.toml @@ -37,7 +37,6 @@ tracing = { workspace = true } url = { workspace = true } [dev-dependencies] -miden-air = { features = ["testing"], workspace = true } miden-node-store = { features = ["rocksdb"], workspace = true } miden-node-utils = { features = ["testing", "tracing-forest"], workspace = true } miden-protocol = { default-features = true, features = ["testing"], workspace = true } diff --git a/crates/rpc/src/server/api.rs b/crates/rpc/src/server/api.rs index 01fc0566e4..8f2b8e34ae 100644 --- a/crates/rpc/src/server/api.rs +++ b/crates/rpc/src/server/api.rs @@ -1,4 +1,4 @@ -use std::sync::{Arc, LazyLock}; +use std::sync::LazyLock; use std::time::Duration; use anyhow::Context; @@ -25,8 +25,12 @@ use miden_node_utils::limiter::{ }; use miden_protocol::batch::ProvenBatch; use miden_protocol::block::{BlockHeader, BlockNumber}; -use miden_protocol::note::{Note, NoteRecipient, NoteScript}; -use miden_protocol::transaction::{OutputNote, ProvenTransaction, ProvenTransactionBuilder}; +use miden_protocol::transaction::{ + OutputNote, + ProvenTransaction, + PublicOutputNote, + TxAccountUpdate, +}; use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_protocol::{MIN_PROOF_SECURITY_LEVEL, Word}; use miden_tx::TransactionVerifier; @@ -365,23 +369,27 @@ impl api_server::Api for RpcService { })?; // Rebuild a new ProvenTransaction with decorators removed from output notes - let mut builder = ProvenTransactionBuilder::new( + let account_update = TxAccountUpdate::new( tx.account_id(), tx.account_update().initial_state_commitment(), tx.account_update().final_state_commitment(), tx.account_update().account_delta_commitment(), + tx.account_update().details().clone(), + ) + .map_err(|e| Status::invalid_argument(e.to_string()))?; + + let stripped_outputs = strip_output_note_decorators(tx.output_notes().iter()); + let rebuilt_tx = ProvenTransaction::new( + account_update, + tx.input_notes().iter().cloned(), + stripped_outputs, tx.ref_block_num(), tx.ref_block_commitment(), tx.fee(), tx.expiration_block_num(), tx.proof().clone(), ) - .account_update_details(tx.account_update().details().clone()) - .add_input_notes(tx.input_notes().iter().cloned()); - - let stripped_outputs = strip_output_note_decorators(tx.output_notes().iter()); - builder = builder.add_output_notes(stripped_outputs); - let rebuilt_tx = builder.build().map_err(|e| Status::invalid_argument(e.to_string()))?; + .map_err(|e| Status::invalid_argument(e.to_string()))?; let mut request = request; request.transaction = rebuilt_tx.to_bytes(); @@ -541,23 +549,24 @@ impl api_server::Api for RpcService { // HELPERS // ================================================================================================ -/// Strips decorators from full output notes' scripts. +/// Strips decorators from public output notes' scripts. /// /// This removes MAST decorators from note scripts before forwarding to the block producer, /// as decorators are not needed for transaction processing. +/// +/// Note: `PublicOutputNote::new()` already calls `note.minify_script()` internally, so +/// reconstructing the public note through it handles decorator stripping automatically. fn strip_output_note_decorators<'a>( notes: impl Iterator + 'a, ) -> impl Iterator + 'a { notes.map(|note| match note { - OutputNote::Full(note) => { - let mut mast = note.script().mast().clone(); - Arc::make_mut(&mut mast).strip_decorators(); - let script = NoteScript::from_parts(mast, note.script().entrypoint()); - let recipient = NoteRecipient::new(note.serial_num(), script, note.storage().clone()); - let new_note = Note::new(note.assets().clone(), note.metadata().clone(), recipient); - OutputNote::Full(new_note) + OutputNote::Public(public_note) => { + // Reconstruct via PublicOutputNote::new which calls minify_script() internally. + let rebuilt = PublicOutputNote::new(public_note.as_note().clone()) + .expect("rebuilding an already-valid public output note should not fail"); + OutputNote::Public(rebuilt) }, - other => other.clone(), + OutputNote::Private(header) => OutputNote::Private(header.clone()), }) } diff --git a/crates/rpc/src/tests.rs b/crates/rpc/src/tests.rs index cab49f3273..9d18ab689c 100644 --- a/crates/rpc/src/tests.rs +++ b/crates/rpc/src/tests.rs @@ -30,8 +30,8 @@ use miden_protocol::account::{ }; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; use miden_protocol::testing::noop_auth_component::NoopAuthComponent; -use miden_protocol::transaction::{ProvenTransaction, ProvenTransactionBuilder}; -use miden_protocol::utils::Serializable; +use miden_protocol::transaction::{ProvenTransaction, TxAccountUpdate}; +use miden_protocol::utils::serde::Serializable; use miden_protocol::vm::ExecutionProof; use miden_standards::account::wallets::BasicWallet; use tempfile::TempDir; @@ -74,19 +74,25 @@ fn build_test_proven_tx(account: &Account, delta: &AccountDelta) -> ProvenTransa AccountStorageMode::Public, ); - ProvenTransactionBuilder::new( + let account_update = TxAccountUpdate::new( account_id, [8; 32].try_into().unwrap(), account.to_commitment(), delta.to_commitment(), + AccountUpdateDetails::Delta(delta.clone()), + ) + .unwrap(); + + ProvenTransaction::new( + account_update, + Vec::::new(), + Vec::::new(), 0.into(), Word::default(), test_fee(), u32::MAX.into(), ExecutionProof::new_dummy(), ) - .account_update_details(AccountUpdateDetails::Delta(delta.clone())) - .build() .unwrap() } diff --git a/crates/store/Cargo.toml b/crates/store/Cargo.toml index e6ec70f794..4685f2fd8d 100644 --- a/crates/store/Cargo.toml +++ b/crates/store/Cargo.toml @@ -26,7 +26,7 @@ hex = { version = "0.4" } indexmap = { workspace = true } libsqlite3-sys = { workspace = true } miden-block-prover = { workspace = true } -miden-crypto = { features = ["concurrent", "hashmaps"], workspace = true } +miden-crypto = { features = ["concurrent"], workspace = true } miden-large-smt-backend-rocksdb = { optional = true, workspace = true } miden-node-db = { workspace = true } miden-node-proto = { workspace = true } @@ -51,9 +51,10 @@ tracing = { workspace = true } url = { workspace = true } [build-dependencies] -build-rs = { workspace = true } -fs-err = { workspace = true } -miden-agglayer = { features = ["testing"], version = "=0.14.0-alpha.2" } +build-rs = { workspace = true } +fs-err = { workspace = true } +# TODO: consider removing the `testing` from relevant functions in miden-agglayer +miden-agglayer = { features = ["testing"], workspace = true } miden-protocol = { features = ["std"], workspace = true } miden-standards = { workspace = true } diff --git a/crates/store/benches/account_tree.rs b/crates/store/benches/account_tree.rs index e69da7714d..005a3780ec 100644 --- a/crates/store/benches/account_tree.rs +++ b/crates/store/benches/account_tree.rs @@ -8,7 +8,7 @@ use miden_node_store::AccountTreeWithHistory; use miden_protocol::Word; use miden_protocol::account::AccountId; use miden_protocol::block::BlockNumber; -use miden_protocol::block::account_tree::{AccountTree, account_id_to_smt_key}; +use miden_protocol::block::account_tree::{AccountIdKey, AccountTree}; use miden_protocol::crypto::hash::rpo::Rpo256; use miden_protocol::crypto::merkle::smt::LargeSmt; use miden_protocol::testing::account_id::AccountIdBuilder; @@ -79,7 +79,7 @@ fn setup_vanilla_account_tree( let account_id = generate_account_id(&mut seed); let commitment = generate_word(&mut seed); account_ids.push(account_id); - entries.push((account_id_to_smt_key(account_id), commitment)); + entries.push((AccountIdKey::from(account_id).as_word(), commitment)); } let storage = setup_storage(base_path); diff --git a/crates/store/build.rs b/crates/store/build.rs index 5cc15e4db0..dfd6ee5c69 100644 --- a/crates/store/build.rs +++ b/crates/store/build.rs @@ -5,14 +5,15 @@ use std::path::PathBuf; use std::sync::Arc; use miden_agglayer::{ - EthAddressFormat, + EthAddress, + MetadataHash, create_existing_agglayer_faucet, create_existing_bridge_account, }; use miden_protocol::account::auth::AuthScheme; use miden_protocol::account::{Account, AccountCode, AccountFile, AccountStorageMode, AccountType}; -use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey; -use miden_protocol::crypto::rand::RpoRandomCoin; +use miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey; +use miden_protocol::crypto::rand::RandomCoin; use miden_protocol::{Felt, Word}; use miden_standards::AuthMethod; use miden_standards::account::wallets::create_basic_wallet; @@ -52,14 +53,14 @@ fn generate_agglayer_sample_accounts() { // Create bridge admin and GER manager as proper wallet accounts. // WARNING: DO NOT USE THESE IN PRODUCTION let bridge_admin_key = - SecretKey::with_rng(&mut RpoRandomCoin::new(Word::new([Felt::new(4u64); 4]))); + SecretKey::with_rng(&mut RandomCoin::new(Word::new([Felt::new(4u64); 4]))); let ger_manager_key = - SecretKey::with_rng(&mut RpoRandomCoin::new(Word::new([Felt::new(5u64); 4]))); + SecretKey::with_rng(&mut RandomCoin::new(Word::new([Felt::new(5u64); 4]))); let bridge_admin = create_basic_wallet( [4u8; 32], AuthMethod::SingleSig { - approver: (bridge_admin_key.public_key().into(), AuthScheme::Falcon512Rpo), + approver: (bridge_admin_key.public_key().into(), AuthScheme::Falcon512Poseidon2), }, AccountType::RegularAccountImmutableCode, AccountStorageMode::Public, @@ -69,7 +70,7 @@ fn generate_agglayer_sample_accounts() { let ger_manager = create_basic_wallet( [5u8; 32], AuthMethod::SingleSig { - approver: (ger_manager_key.public_key().into(), AuthScheme::Falcon512Rpo), + approver: (ger_manager_key.public_key().into(), AuthScheme::Falcon512Poseidon2), }, AccountType::RegularAccountImmutableCode, AccountStorageMode::Public, @@ -87,8 +88,8 @@ fn generate_agglayer_sample_accounts() { // Placeholder Ethereum addresses for sample faucets. // WARNING: DO NOT USE THESE ADDRESSES IN PRODUCTION - let eth_origin_address = EthAddressFormat::new([1u8; 20]); - let usdc_origin_address = EthAddressFormat::new([2u8; 20]); + let eth_origin_address = EthAddress::new([1u8; 20]); + let usdc_origin_address = EthAddress::new([2u8; 20]); // Create AggLayer faucets using "existing" variant // ETH: 8 decimals (protocol max is 12), max supply of 1 billion tokens @@ -102,6 +103,7 @@ fn generate_agglayer_sample_accounts() { ð_origin_address, 0u32, 10u8, + MetadataHash::from_token_info("Ether", "ETH", 8), ); // USDC: 6 decimals, max supply of 10 billion tokens @@ -115,6 +117,7 @@ fn generate_agglayer_sample_accounts() { &usdc_origin_address, 0u32, 10u8, + MetadataHash::from_token_info("USD Coin", "USDC", 6), ); // Strip source location decorators from account code to ensure deterministic output. @@ -139,17 +142,17 @@ fn generate_agglayer_sample_accounts() { .expect("Failed to write agglayer_faucet_usdc.mac"); } -/// Strips source location decorators from an account's code MAST forest. +/// Clears debug info from an account's code MAST forest. /// /// This is necessary because the MAST forest embeds absolute file paths from the Cargo build -/// directory, which include a hash that differs between `cargo check` and `cargo build`. Stripping -/// decorators ensures the serialized `.mac` files are identical regardless of which cargo command +/// directory, which include a hash that differs between `cargo check` and `cargo build`. Clearing +/// debug info ensures the serialized `.mac` files are identical regardless of which cargo command /// is used (CI or local builds or tests). fn strip_code_decorators(account: Account) -> Account { let (id, vault, storage, code, nonce, seed) = account.into_parts(); let mut mast = code.mast(); - Arc::make_mut(&mut mast).strip_decorators(); + Arc::make_mut(&mut mast).clear_debug_info(); let code = AccountCode::from_parts(mast, code.procedures().to_vec()); Account::new_unchecked(id, vault, storage, code, nonce, seed) diff --git a/crates/store/src/account_state_forest/mod.rs b/crates/store/src/account_state_forest/mod.rs index 58026cfe23..558c79df70 100644 --- a/crates/store/src/account_state_forest/mod.rs +++ b/crates/store/src/account_state_forest/mod.rs @@ -12,7 +12,7 @@ use miden_protocol::account::{ StorageMapWitness, StorageSlotName, }; -use miden_protocol::asset::{Asset, AssetVaultKey, AssetWitness, FungibleAsset}; +use miden_protocol::asset::{AssetVaultKey, AssetWitness, FungibleAsset}; use miden_protocol::block::BlockNumber; use miden_protocol::crypto::merkle::smt::{ ForestOperation, @@ -26,7 +26,7 @@ use miden_protocol::crypto::merkle::smt::{ }; use miden_protocol::crypto::merkle::{EmptySubtreeRoots, MerkleError}; use miden_protocol::errors::{AssetError, StorageMapError}; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use miden_protocol::{EMPTY_WORD, Word}; use thiserror::Error; use tracing::instrument; @@ -409,18 +409,20 @@ impl AccountStateForest { let mut entries: Vec<(Word, Word)> = Vec::new(); - for (faucet_id, amount_delta) in vault_delta.fungible().iter() { + for (vault_key, amount_delta) in vault_delta.fungible().iter() { let amount = (*amount_delta).try_into().expect("full-state amount should be non-negative"); - let asset = FungibleAsset::new(*faucet_id, amount)?; - entries.push((asset.vault_key().into(), asset.into())); + let asset = FungibleAsset::new(vault_key.faucet_id(), amount)?; + entries.push((asset.to_key_word(), asset.to_value_word())); } // process non-fungible assets for (&asset, action) in vault_delta.non_fungible().iter() { - let asset_vault_key = asset.vault_key().into(); + let asset_vault_key: Word = asset.vault_key().into(); match action { - NonFungibleDeltaAction::Add => entries.push((asset_vault_key, asset.into())), + NonFungibleDeltaAction::Add => { + entries.push((asset_vault_key, asset.to_value_word())); + }, NonFungibleDeltaAction::Remove => entries.push((asset_vault_key, EMPTY_WORD)), } } @@ -458,11 +460,7 @@ impl AccountStateForest { let raw_map_entries: Vec<(StorageMapKey, Word)> = Vec::from_iter(map_delta.entries().iter().filter_map(|(&key, &value)| { - if value == EMPTY_WORD { - None - } else { - Some((key.into_inner(), value)) - } + if value == EMPTY_WORD { None } else { Some((key, value)) } })); if raw_map_entries.is_empty() { @@ -506,11 +504,6 @@ impl AccountStateForest { /// Processes both fungible and non-fungible asset changes, building entries for the vault SMT /// and tracking the new root. /// - /// # Arguments - /// - /// * `is_full_state` - If `true`, delta values are absolute (new account or DB reconstruction). - /// If `false`, delta values are relative changes applied to previous state. - /// /// # Returns /// /// The new vault root after applying the delta. @@ -534,16 +527,17 @@ impl AccountStateForest { let mut entries: Vec<(Word, Word)> = Vec::new(); // Process fungible assets - for (faucet_id, amount_delta) in vault_delta.fungible().iter() { + for (vault_key, amount_delta) in vault_delta.fungible().iter() { + let faucet_id = vault_key.faucet_id(); let delta_abs = amount_delta.unsigned_abs(); - let delta = FungibleAsset::new(*faucet_id, delta_abs)?; + let delta = FungibleAsset::new(faucet_id, delta_abs)?; let key = Word::from(delta.vault_key()); - let empty = FungibleAsset::new(*faucet_id, 0)?; + let empty = FungibleAsset::new(faucet_id, 0)?; let asset = if let Some(tree) = prev_tree { self.forest .get(tree, key)? - .map(FungibleAsset::try_from) + .map(|value| FungibleAsset::from_key_value(*vault_key, value)) .transpose()? .unwrap_or(empty) } else { @@ -559,7 +553,7 @@ impl AccountStateForest { let value = if updated.amount() == 0 { EMPTY_WORD } else { - Word::from(updated) + updated.to_value_word() }; entries.push((key, value)); } @@ -567,7 +561,7 @@ impl AccountStateForest { // Process non-fungible assets for (asset, action) in vault_delta.non_fungible().iter() { let value = match action { - NonFungibleDeltaAction::Add => Word::from(Asset::NonFungible(*asset)), + NonFungibleDeltaAction::Add => asset.to_value_word(), NonFungibleDeltaAction::Remove => EMPTY_WORD, }; entries.push((asset.vault_key().into(), value)); @@ -605,11 +599,6 @@ impl AccountStateForest { /// Updates the forest with storage map changes from a delta. /// - /// # Arguments - /// - /// * `is_full_state` - If `true`, delta values are absolute (new account or DB reconstruction). - /// If `false`, delta values are relative changes applied to previous state. - /// /// # Returns /// /// A map from slot name to the new storage map root for that slot. @@ -627,9 +616,8 @@ impl AccountStateForest { // update the storage map tree in the forest and add an entry to the storage map roots let lineage = Self::storage_lineage_id(account_id, slot_name); - let delta_entries: Vec<(StorageMapKey, Word)> = Vec::from_iter( - map_delta.entries().iter().map(|(key, value)| (key.into_inner(), *value)), - ); + let delta_entries: Vec<(StorageMapKey, Word)> = + Vec::from_iter(map_delta.entries().iter().map(|(key, value)| (*key, *value))); let hashed_entries = Vec::from_iter( delta_entries.iter().map(|(raw_key, value)| (raw_key.hash().into(), *value)), diff --git a/crates/store/src/account_state_forest/tests.rs b/crates/store/src/account_state_forest/tests.rs index 9d72151bc6..ed931f03a4 100644 --- a/crates/store/src/account_state_forest/tests.rs +++ b/crates/store/src/account_state_forest/tests.rs @@ -1,14 +1,14 @@ use assert_matches::assert_matches; use miden_node_proto::domain::account::StorageMapEntries; +use miden_protocol::Felt; use miden_protocol::account::{AccountCode, StorageMapKey}; -use miden_protocol::asset::{Asset, AssetVault, AssetVaultKey, FungibleAsset}; +use miden_protocol::asset::{Asset, AssetVault, FungibleAsset}; use miden_protocol::crypto::merkle::smt::SmtProof; use miden_protocol::testing::account_id::{ ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE, ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE_2, }; -use miden_protocol::{Felt, FieldElement}; use super::*; @@ -324,7 +324,7 @@ fn vault_shared_root_retained_when_one_entry_pruned() { let asset_amount = u64::from(HISTORICAL_BLOCK_RETENTION); let amount_increment = asset_amount / u64::from(HISTORICAL_BLOCK_RETENTION); let asset = dummy_fungible_asset(faucet_id, asset_amount); - let asset_key = AssetVaultKey::new_unchecked(asset.vault_key().into()); + let asset_key = asset.vault_key(); let mut vault_delta_1 = AccountVaultDelta::default(); vault_delta_1.add_asset(asset).unwrap(); @@ -545,7 +545,7 @@ fn storage_map_empty_entries_query() { let account_component = AccountComponent::new( component_code, component_storage, - AccountComponentMetadata::new("test").with_supports_all_types(), + AccountComponentMetadata::new("test", AccountType::all()), ) .unwrap(); @@ -555,7 +555,7 @@ fn storage_map_empty_entries_query() { .with_component(account_component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -953,7 +953,7 @@ fn shared_vault_root_retained_when_one_account_changes() { let block_1 = BlockNumber::GENESIS.child(); let initial_amount = 1000u64; let asset = dummy_fungible_asset(faucet_id, initial_amount); - let asset_key = AssetVaultKey::new_unchecked(asset.vault_key().into()); + let asset_key = asset.vault_key(); let mut vault_delta_1 = AccountVaultDelta::default(); vault_delta_1.add_asset(asset).unwrap(); diff --git a/crates/store/src/accounts/tests.rs b/crates/store/src/accounts/tests.rs index 9f7b5dcbd8..68cf0e1988 100644 --- a/crates/store/src/accounts/tests.rs +++ b/crates/store/src/accounts/tests.rs @@ -8,7 +8,7 @@ mod account_tree_with_history_tests { use miden_protocol::Word; use miden_protocol::account::AccountId; use miden_protocol::block::BlockNumber; - use miden_protocol::block::account_tree::{AccountTree, account_id_to_smt_key}; + use miden_protocol::block::account_tree::{AccountIdKey, AccountTree}; use miden_protocol::crypto::merkle::smt::{LargeSmt, MemoryStorage}; use miden_protocol::testing::account_id::AccountIdBuilder; @@ -20,7 +20,7 @@ mod account_tree_with_history_tests { ) -> InMemoryAccountTree { let smt_entries = entries .into_iter() - .map(|(id, commitment)| (account_id_to_smt_key(id), commitment)); + .map(|(id, commitment)| (AccountIdKey::from(id).as_word(), commitment)); let smt = LargeSmt::with_entries(MemoryStorage::default(), smt_entries) .expect("Failed to create LargeSmt from entries"); AccountTree::new(smt).expect("Failed to create AccountTree") @@ -30,7 +30,7 @@ mod account_tree_with_history_tests { fn assert_verify(root: Word, witness: AccountWitness) { let proof = witness.into_proof(); let (path, leaf) = proof.into_parts(); - path.verify(leaf.index().value(), leaf.hash(), &root).unwrap(); + path.verify(leaf.index().position(), leaf.hash(), &root).unwrap(); } #[test] @@ -491,7 +491,7 @@ mod account_tree_with_history_tests { let (path, leaf) = proof.into_parts(); // Verify the Merkle proof - this tests the historical reconstruction code path - path.verify(leaf.index().value(), leaf.hash(), &root) + path.verify(leaf.index().position(), leaf.hash(), &root) .expect("Proof verification should succeed"); } @@ -516,7 +516,7 @@ mod account_tree_with_history_tests { let (path, leaf) = proof.into_parts(); // Verify the Merkle proof - path.verify(leaf.index().value(), leaf.hash(), &root) + path.verify(leaf.index().position(), leaf.hash(), &root) .expect("Proof verification should succeed"); } } diff --git a/crates/store/src/blocks.rs b/crates/store/src/blocks.rs index e771332ba9..10319214ac 100644 --- a/crates/store/src/blocks.rs +++ b/crates/store/src/blocks.rs @@ -3,7 +3,7 @@ use std::ops::Not; use std::path::PathBuf; use miden_protocol::block::BlockNumber; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use tracing::instrument; use crate::COMPONENT; diff --git a/crates/store/src/db/mod.rs b/crates/store/src/db/mod.rs index 43df59d5e3..6fb5fd35cb 100644 --- a/crates/store/src/db/mod.rs +++ b/crates/store/src/db/mod.rs @@ -24,7 +24,7 @@ use miden_protocol::note::{ Nullifier, }; use miden_protocol::transaction::{InputNoteCommitment, TransactionId}; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use tokio::sync::oneshot; use tracing::{info, instrument}; @@ -117,7 +117,7 @@ impl AccountVaultValue { let vault_key = Word::read_from_bytes(&vault_key)?; Ok(Self { block_num: BlockNumber::from_raw_sql(block_num)?, - vault_key: AssetVaultKey::new_unchecked(vault_key), + vault_key: AssetVaultKey::try_from(vault_key)?, asset: asset.map(|b| Asset::read_from_bytes(&b)).transpose()?, }) } diff --git a/crates/store/src/db/models/conv.rs b/crates/store/src/db/models/conv.rs index 2176ea0d46..25b6047f9e 100644 --- a/crates/store/src/db/models/conv.rs +++ b/crates/store/src/db/models/conv.rs @@ -204,7 +204,7 @@ pub(crate) fn raw_sql_to_nonce(raw: i64) -> Felt { } #[inline(always)] pub(crate) fn nonce_to_raw_sql(nonce: Felt) -> i64 { - nonce.as_int() as i64 + nonce.as_canonical_u64() as i64 } #[inline(always)] diff --git a/crates/store/src/db/models/queries/accounts.rs b/crates/store/src/db/models/queries/accounts.rs index 0e8ae47b60..d0e3fa8243 100644 --- a/crates/store/src/db/models/queries/accounts.rs +++ b/crates/store/src/db/models/queries/accounts.rs @@ -36,7 +36,7 @@ use miden_protocol::account::{ }; use miden_protocol::asset::{Asset, AssetVault, AssetVaultKey, FungibleAsset}; use miden_protocol::block::{BlockAccountUpdate, BlockNumber}; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_protocol::{Felt, Word}; use crate::COMPONENT; @@ -298,8 +298,6 @@ pub(crate) fn select_account_commitments_paged( page_size: NonZeroUsize, after_account_id: Option, ) -> Result { - use miden_protocol::utils::Serializable; - // Fetch one extra to determine if there are more results #[expect(clippy::cast_possible_wrap)] let limit = (page_size.get() + 1) as i64; @@ -374,8 +372,6 @@ pub(crate) fn select_public_account_ids_paged( page_size: NonZeroUsize, after_account_id: Option, ) -> Result { - use miden_protocol::utils::Serializable; - #[expect(clippy::cast_possible_wrap)] let limit = (page_size.get() + 1) as i64; @@ -441,7 +437,7 @@ pub(crate) fn select_account_vault_assets( ) -> Result<(BlockNumber, Vec), DatabaseError> { use schema::account_vault_assets as t; // TODO: These limits should be given by the protocol. - // See miden-base/issues/1770 for more details + // See miden-protocol/issues/1770 for more details const ROW_OVERHEAD_BYTES: usize = 2 * size_of::() + size_of::(); // key + asset + block_num const MAX_ROWS: usize = MAX_RESPONSE_PAYLOAD_BYTES / ROW_OVERHEAD_BYTES; @@ -901,7 +897,7 @@ impl TryFrom for AccountVaultValue { type Error = DatabaseError; fn try_from(raw: AccountVaultUpdateRaw) -> Result { - let vault_key = AssetVaultKey::new_unchecked(Word::read_from_bytes(&raw.vault_key)?); + let vault_key = AssetVaultKey::try_from(Word::read_from_bytes(&raw.vault_key)?)?; let asset = raw.asset.map(|bytes| Asset::read_from_bytes(&bytes)).transpose()?; let block_num = BlockNumber::from_raw_sql(raw.block_num)?; @@ -1081,18 +1077,19 @@ fn prepare_partial_account_update( // --- Process asset updates. --------------------------------- // Only query balances for faucet_ids that are being updated. let faucet_ids = - Vec::from_iter(delta.vault().fungible().iter().map(|(faucet_id, _)| *faucet_id)); + Vec::from_iter(delta.vault().fungible().iter().map(|(vault_key, _)| vault_key.faucet_id())); let prev_balances = select_vault_balances_by_faucet_ids(conn, account_id, &faucet_ids)?; // Encode `Some` as update and `None` as removal. let mut assets = Vec::new(); // Update fungible assets. - for (faucet_id, amount_delta) in delta.vault().fungible().iter() { - let prev_amount = prev_balances.get(faucet_id).copied().unwrap_or(0); - let prev_asset = FungibleAsset::new(*faucet_id, prev_amount)?; + for (vault_key, amount_delta) in delta.vault().fungible().iter() { + let faucet_id = vault_key.faucet_id(); + let prev_amount = prev_balances.get(&faucet_id).copied().unwrap_or(0); + let prev_asset = FungibleAsset::new(faucet_id, prev_amount)?; let amount_abs = amount_delta.unsigned_abs(); - let delta = FungibleAsset::new(*faucet_id, amount_abs)?; + let delta = FungibleAsset::new(faucet_id, amount_abs)?; let new_balance = if *amount_delta < 0 { prev_asset.sub(delta)? } else { @@ -1120,7 +1117,7 @@ fn prepare_partial_account_update( let mut storage = Vec::new(); for (slot_name, map_delta) in delta.storage().maps() { for (key, value) in map_delta.entries() { - storage.push((account_id, slot_name.clone(), (*key).into_inner(), *value)); + storage.push((account_id, slot_name.clone(), *key, *value)); } } @@ -1151,8 +1148,8 @@ fn prepare_partial_account_update( // Apply nonce delta. let new_nonce_value = state_headers .nonce - .as_int() - .checked_add(delta.nonce_delta().as_int()) + .as_canonical_u64() + .checked_add(delta.nonce_delta().as_canonical_u64()) .ok_or_else(|| { DatabaseError::DataCorrupted(format!("Nonce overflow for account {account_id}")) })?; diff --git a/crates/store/src/db/models/queries/accounts/at_block.rs b/crates/store/src/db/models/queries/accounts/at_block.rs index 41ec035f3f..fc2ddb00e6 100644 --- a/crates/store/src/db/models/queries/accounts/at_block.rs +++ b/crates/store/src/db/models/queries/accounts/at_block.rs @@ -4,8 +4,8 @@ use diesel::{ExpressionMethods, OptionalExtension, QueryDsl, RunQueryDsl, Sqlite use miden_protocol::account::{AccountHeader, AccountId, AccountStorageHeader}; use miden_protocol::asset::Asset; use miden_protocol::block::BlockNumber; -use miden_protocol::utils::{Deserializable, Serializable}; -use miden_protocol::{Felt, FieldElement, Word}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; +use miden_protocol::{Felt, Word}; use crate::db::models::conv::{SqlTypeConvert, raw_sql_to_nonce}; use crate::db::schema; diff --git a/crates/store/src/db/models/queries/accounts/delta.rs b/crates/store/src/db/models/queries/accounts/delta.rs index 4f39352397..e01ba6c3fa 100644 --- a/crates/store/src/db/models/queries/accounts/delta.rs +++ b/crates/store/src/db/models/queries/accounts/delta.rs @@ -23,7 +23,7 @@ use miden_protocol::account::{ StorageSlotName, }; use miden_protocol::asset::{Asset, FungibleAsset}; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_protocol::{EMPTY_WORD, Felt, Word}; use crate::db::models::conv::raw_sql_to_nonce; @@ -246,9 +246,9 @@ pub(super) fn apply_storage_delta( let mut entries = map_entries.get(slot_name).cloned().unwrap_or_default(); for (key, value) in map_delta.entries() { if *value == EMPTY_WORD { - entries.remove(&(*key).into_inner()); + entries.remove(key); } else { - entries.insert((*key).into_inner(), *value); + entries.insert(*key, *value); } } diff --git a/crates/store/src/db/models/queries/accounts/delta/tests.rs b/crates/store/src/db/models/queries/accounts/delta/tests.rs index 986c5204b3..1e73ab4ebe 100644 --- a/crates/store/src/db/models/queries/accounts/delta/tests.rs +++ b/crates/store/src/db/models/queries/accounts/delta/tests.rs @@ -35,7 +35,7 @@ use miden_protocol::testing::account_id::{ ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_1, }; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use miden_protocol::{EMPTY_WORD, Felt, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::code_builder::CodeBuilder; @@ -142,8 +142,7 @@ fn optimized_delta_matches_full_account_method() { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -153,7 +152,7 @@ fn optimized_delta_matches_full_account_method() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -227,7 +226,8 @@ fn optimized_delta_matches_full_account_method() { assert!(!partial_delta.is_full_state(), "Delta should be partial, not full state"); // Construct the expected final account by applying the delta - let expected_nonce = Felt::new(full_account_before.nonce().as_int() + nonce_delta.as_int()); + let expected_nonce = + Felt::new(full_account_before.nonce().as_canonical_u64() + nonce_delta.as_canonical_u64()); let expected_code_commitment = full_account_before.code().commitment(); let mut expected_account = full_account_before.clone(); @@ -342,8 +342,7 @@ fn optimized_delta_updates_non_empty_vault() { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -353,7 +352,7 @@ fn optimized_delta_updates_non_empty_vault() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .with_assets([initial_asset]) .build_existing() @@ -510,8 +509,7 @@ fn optimized_delta_updates_storage_map_header() { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -521,7 +519,7 @@ fn optimized_delta_updates_storage_map_header() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -684,8 +682,7 @@ fn upsert_full_state_delta() { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -695,7 +692,7 @@ fn upsert_full_state_delta() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); diff --git a/crates/store/src/db/models/queries/accounts/tests.rs b/crates/store/src/db/models/queries/accounts/tests.rs index 39c7d55dde..f660efc4f9 100644 --- a/crates/store/src/db/models/queries/accounts/tests.rs +++ b/crates/store/src/db/models/queries/accounts/tests.rs @@ -40,8 +40,8 @@ use miden_protocol::account::{ }; use miden_protocol::block::{BlockAccountUpdate, BlockHeader, BlockNumber}; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; -use miden_protocol::utils::{Deserializable, Serializable}; -use miden_protocol::{EMPTY_WORD, Felt, FieldElement, Word}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; +use miden_protocol::{EMPTY_WORD, Felt, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::code_builder::CodeBuilder; @@ -154,8 +154,7 @@ fn create_test_account_with_storage() -> (Account, AccountId) { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -165,7 +164,7 @@ fn create_test_account_with_storage() -> (Account, AccountId) { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -218,8 +217,7 @@ fn create_account_with_map_storage( let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -229,7 +227,7 @@ fn create_account_with_map_storage( .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap() @@ -474,8 +472,7 @@ fn test_upsert_accounts_updates_is_latest_flag() { let component_2 = AccountComponent::new( account_component_code, component_storage_modified, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -485,7 +482,7 @@ fn test_upsert_accounts_updates_is_latest_flag() { .with_component(component_2) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -574,8 +571,7 @@ fn test_upsert_accounts_with_multiple_storage_slots() { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -585,7 +581,7 @@ fn test_upsert_accounts_with_multiple_storage_slots() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -644,8 +640,7 @@ fn test_upsert_accounts_with_empty_storage() { let component = AccountComponent::new( account_component_code, vec![], - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -655,7 +650,7 @@ fn test_upsert_accounts_with_empty_storage() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -781,8 +776,7 @@ fn test_select_latest_account_storage_multiple_slots() { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountImmutableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountImmutableCode]), ) .unwrap(); @@ -792,7 +786,7 @@ fn test_select_latest_account_storage_multiple_slots() { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -883,8 +877,11 @@ fn test_select_latest_account_storage_slot_updates() { #[test] fn test_select_account_vault_at_block_historical_with_updates() { use assert_matches::assert_matches; - use miden_protocol::asset::{AssetVaultKey, FungibleAsset}; - use miden_protocol::testing::account_id::ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET; + use miden_protocol::asset::FungibleAsset; + use miden_protocol::testing::account_id::{ + ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, + ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_1, + }; let mut conn = setup_test_db(); let (account, _) = create_test_account_with_storage(); @@ -915,13 +912,8 @@ fn test_select_account_vault_at_block_historical_with_updates() { } // Insert vault asset at block 1: vault_key_1 = 1000 tokens - let vault_key_1 = AssetVaultKey::new_unchecked(Word::from([ - Felt::new(1), - Felt::ZERO, - Felt::ZERO, - Felt::ZERO, - ])); let asset_v1 = Asset::Fungible(FungibleAsset::new(faucet_id, 1000).unwrap()); + let vault_key_1 = asset_v1.vault_key(); insert_account_vault_asset(&mut conn, account_id, block_1, vault_key_1, Some(asset_v1)) .expect("insert vault asset failed"); @@ -931,14 +923,10 @@ fn test_select_account_vault_at_block_historical_with_updates() { insert_account_vault_asset(&mut conn, account_id, block_2, vault_key_1, Some(asset_v2)) .expect("insert vault asset update failed"); - // Add a second vault_key at block 2 - let vault_key_2 = AssetVaultKey::new_unchecked(Word::from([ - Felt::new(2), - Felt::ZERO, - Felt::ZERO, - Felt::ZERO, - ])); - let asset_key2 = Asset::Fungible(FungibleAsset::new(faucet_id, 500).unwrap()); + // Add a second vault_key at block 2 (different faucet for different vault key) + let faucet_id_2 = AccountId::try_from(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_1).unwrap(); + let asset_key2 = Asset::Fungible(FungibleAsset::new(faucet_id_2, 500).unwrap()); + let vault_key_2 = asset_key2.vault_key(); insert_account_vault_asset(&mut conn, account_id, block_2, vault_key_2, Some(asset_key2)) .expect("insert second vault asset failed"); @@ -1017,12 +1005,7 @@ fn test_select_account_vault_at_block_exponential_updates() { .expect("upsert_accounts failed"); } - let vault_key = AssetVaultKey::new_unchecked(Word::from([ - Felt::new(3), - Felt::ZERO, - Felt::ZERO, - Felt::ZERO, - ])); + let vault_key = AssetVaultKey::new_fungible(faucet_id).unwrap(); for (index, block) in blocks.iter().enumerate() { let amount = 1u64 << index; @@ -1049,7 +1032,7 @@ fn test_select_account_vault_at_block_exponential_updates() { #[test] fn test_select_account_vault_at_block_with_deletion() { use assert_matches::assert_matches; - use miden_protocol::asset::{AssetVaultKey, FungibleAsset}; + use miden_protocol::asset::FungibleAsset; use miden_protocol::testing::account_id::ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET; let mut conn = setup_test_db(); @@ -1081,13 +1064,8 @@ fn test_select_account_vault_at_block_with_deletion() { } // Insert vault asset at block 1 - let vault_key = AssetVaultKey::new_unchecked(Word::from([ - Felt::new(1), - Felt::ZERO, - Felt::ZERO, - Felt::ZERO, - ])); let asset = Asset::Fungible(FungibleAsset::new(faucet_id, 1000).unwrap()); + let vault_key = asset.vault_key(); insert_account_vault_asset(&mut conn, account_id, block_1, vault_key, Some(asset)) .expect("insert vault asset failed"); @@ -1172,8 +1150,10 @@ fn build_account_with_code(push_value: u32) -> Account { StorageSlotName::mock(0), Word::from([Felt::new(1), Felt::ZERO, Felt::ZERO, Felt::ZERO]), )], - AccountComponentMetadata::new("code_prune_test") - .with_supported_type(AccountType::RegularAccountUpdatableCode), + AccountComponentMetadata::new( + "code_prune_test", + [AccountType::RegularAccountUpdatableCode], + ), ) .unwrap(); @@ -1184,7 +1164,7 @@ fn build_account_with_code(push_value: u32) -> Account { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap() diff --git a/crates/store/src/db/models/queries/block_headers.rs b/crates/store/src/db/models/queries/block_headers.rs index bfcd34ee7a..59c4ce530b 100644 --- a/crates/store/src/db/models/queries/block_headers.rs +++ b/crates/store/src/db/models/queries/block_headers.rs @@ -15,7 +15,7 @@ use miden_crypto::Word; use miden_crypto::dsa::ecdsa_k256_keccak::Signature; use miden_node_utils::limiter::{QueryParamBlockLimit, QueryParamLimiter}; use miden_protocol::block::{BlockHeader, BlockNumber}; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use super::DatabaseError; use crate::COMPONENT; diff --git a/crates/store/src/db/models/queries/notes.rs b/crates/store/src/db/models/queries/notes.rs index ecc7b71f85..b05ae4fee2 100644 --- a/crates/store/src/db/models/queries/notes.rs +++ b/crates/store/src/db/models/queries/notes.rs @@ -49,7 +49,7 @@ use miden_protocol::note::{ NoteType, Nullifier, }; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_standards::note::NetworkAccountTarget; use crate::COMPONENT; diff --git a/crates/store/src/db/models/queries/nullifiers.rs b/crates/store/src/db/models/queries/nullifiers.rs index 84e89ebad5..89f62b4ab3 100644 --- a/crates/store/src/db/models/queries/nullifiers.rs +++ b/crates/store/src/db/models/queries/nullifiers.rs @@ -20,7 +20,7 @@ use miden_node_utils::limiter::{ }; use miden_protocol::block::BlockNumber; use miden_protocol::note::Nullifier; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use super::DatabaseError; use crate::COMPONENT; diff --git a/crates/store/src/db/models/queries/transactions.rs b/crates/store/src/db/models/queries/transactions.rs index 69b3986f15..79d2bdfeb0 100644 --- a/crates/store/src/db/models/queries/transactions.rs +++ b/crates/store/src/db/models/queries/transactions.rs @@ -21,7 +21,7 @@ use miden_protocol::account::AccountId; use miden_protocol::block::BlockNumber; use miden_protocol::note::NoteHeader; use miden_protocol::transaction::{InputNoteCommitment, OrderedTransactionHeaders, TransactionId}; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use super::DatabaseError; use crate::COMPONENT; diff --git a/crates/store/src/db/models/utils.rs b/crates/store/src/db/models/utils.rs index ef74e86fac..80dc1e9197 100644 --- a/crates/store/src/db/models/utils.rs +++ b/crates/store/src/db/models/utils.rs @@ -1,6 +1,6 @@ use diesel::{Connection, RunQueryDsl, SqliteConnection}; use miden_protocol::note::Nullifier; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use crate::errors::DatabaseError; @@ -23,7 +23,7 @@ pub(crate) fn serialize_vec<'a, D: Serializable + 'a>( /// Returns the high 16 bits of the provided nullifier. pub fn get_nullifier_prefix(nullifier: &Nullifier) -> u16 { - (nullifier.most_significant_felt().as_int() >> 48) as u16 + (nullifier.most_significant_felt().as_canonical_u64() >> 48) as u16 } /// Converts a slice of length `N` to an array, returns `None` if invariant diff --git a/crates/store/src/db/tests.rs b/crates/store/src/db/tests.rs index a9f72b99a3..f3dd1c1d2f 100644 --- a/crates/store/src/db/tests.rs +++ b/crates/store/src/db/tests.rs @@ -26,7 +26,7 @@ use miden_protocol::account::{ StorageSlotDelta, StorageSlotName, }; -use miden_protocol::asset::{Asset, AssetVaultKey, FungibleAsset}; +use miden_protocol::asset::{Asset, FungibleAsset}; use miden_protocol::block::{ BlockAccountUpdate, BlockHeader, @@ -37,7 +37,7 @@ use miden_protocol::block::{ use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey; use miden_protocol::crypto::merkle::SparseMerklePath; use miden_protocol::crypto::merkle::smt::SmtProof; -use miden_protocol::crypto::rand::RpoRandomCoin; +use miden_protocol::crypto::rand::RandomCoin; use miden_protocol::note::{ Note, NoteAttachment, @@ -52,6 +52,9 @@ use miden_protocol::note::{ use miden_protocol::testing::account_id::{ ACCOUNT_ID_PRIVATE_SENDER, ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, + ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_1, + ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_2, + ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_3, ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE, ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE_2, }; @@ -63,8 +66,8 @@ use miden_protocol::transaction::{ TransactionHeader, TransactionId, }; -use miden_protocol::utils::{Deserializable, Serializable}; -use miden_protocol::{EMPTY_WORD, Felt, FieldElement, Word}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; +use miden_protocol::{EMPTY_WORD, Felt, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::code_builder::CodeBuilder; use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint, P2idNote}; @@ -191,7 +194,7 @@ fn sql_select_nullifiers() { pub fn create_note(account_id: AccountId) -> Note { let coin_seed: [u64; 4] = rand::rng().random(); - let rng = Arc::new(Mutex::new(RpoRandomCoin::new(coin_seed.map(Felt::new).into()))); + let rng = Arc::new(Mutex::new(RandomCoin::new(coin_seed.map(Felt::new).into()))); let mut rng = rng.lock().unwrap(); P2idNote::create( account_id, @@ -476,11 +479,12 @@ fn sync_account_vault_basic_validation() { .unwrap(); } - // Create some test vault assets - let vault_key_1 = AssetVaultKey::new_unchecked(num_to_word(100)); - let vault_key_2 = AssetVaultKey::new_unchecked(num_to_word(200)); + // Create test vault assets from two different faucets to get different vault keys. + let faucet_id_2 = AccountId::try_from(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_1).unwrap(); let fungible_asset_1 = Asset::Fungible(FungibleAsset::new(public_account_id, 1000).unwrap()); - let fungible_asset_2 = Asset::Fungible(FungibleAsset::new(public_account_id, 2000).unwrap()); + let fungible_asset_2 = Asset::Fungible(FungibleAsset::new(faucet_id_2, 2000).unwrap()); + let vault_key_1 = fungible_asset_1.vault_key(); + let vault_key_2 = fungible_asset_2.vault_key(); // Insert vault assets for the public account at different blocks queries::insert_account_vault_asset( @@ -921,7 +925,7 @@ fn insert_account_delta( account_id, block_number, slot_name.clone(), - *k.inner(), + *k, *v, ) .unwrap(); @@ -1317,8 +1321,7 @@ fn create_account_with_code(code_str: &str, seed: [u8; 32]) -> Account { let component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test") - .with_supported_type(AccountType::RegularAccountUpdatableCode), + AccountComponentMetadata::new("test", [AccountType::RegularAccountUpdatableCode]), ) .unwrap(); @@ -1328,7 +1331,7 @@ fn create_account_with_code(code_str: &str, seed: [u8; 32]) -> Account { .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap() @@ -1351,19 +1354,21 @@ fn mock_block_transaction(account_id: AccountId, num: u64) -> TransactionHeader NoteMetadata::new(account_id, NoteType::Public).with_tag(NoteTag::new(num as u32)), )]; + let fee = test_fee(); TransactionHeader::new_unchecked( TransactionId::new( initial_state_commitment, final_account_commitment, input_notes_commitment, output_notes_commitment, + fee, ), account_id, initial_state_commitment, final_account_commitment, input_notes, output_notes, - test_fee(), + fee, ) } @@ -1418,7 +1423,7 @@ fn mock_account_code_and_storage( let account_component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("counter_contract").with_supports_all_types(), + AccountComponentMetadata::new("counter_contract", AccountType::all()), ) .unwrap(); @@ -1429,7 +1434,7 @@ fn mock_account_code_and_storage( .with_component(account_component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap() @@ -1582,7 +1587,7 @@ async fn genesis_with_account_assets() { let account_component = AccountComponent::new( account_component_code, Vec::new(), - AccountComponentMetadata::new("foo").with_supports_all_types(), + AccountComponentMetadata::new("foo", AccountType::all()), ) .unwrap(); @@ -1596,7 +1601,7 @@ async fn genesis_with_account_assets() { .with_assets([fungible_asset.into()]) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -1641,7 +1646,7 @@ async fn genesis_with_account_storage_map() { let account_component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("foo").with_supports_all_types(), + AccountComponentMetadata::new("foo", AccountType::all()), ) .unwrap(); @@ -1651,7 +1656,7 @@ async fn genesis_with_account_storage_map() { .with_component(account_component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -1693,7 +1698,7 @@ async fn genesis_with_account_assets_and_storage() { let account_component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("foo").with_supports_all_types(), + AccountComponentMetadata::new("foo", AccountType::all()), ) .unwrap(); @@ -1704,7 +1709,7 @@ async fn genesis_with_account_assets_and_storage() { .with_assets([fungible_asset.into()]) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -1731,7 +1736,7 @@ async fn genesis_with_multiple_accounts() { let account_component1 = AccountComponent::new( account_component_code, Vec::new(), - AccountComponentMetadata::new("foo").with_supports_all_types(), + AccountComponentMetadata::new("foo", AccountType::all()), ) .unwrap(); @@ -1741,7 +1746,7 @@ async fn genesis_with_multiple_accounts() { .with_component(account_component1) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -1755,7 +1760,7 @@ async fn genesis_with_multiple_accounts() { let account_component2 = AccountComponent::new( account_component_code, Vec::new(), - AccountComponentMetadata::new("bar").with_supports_all_types(), + AccountComponentMetadata::new("bar", AccountType::all()), ) .unwrap(); @@ -1766,7 +1771,7 @@ async fn genesis_with_multiple_accounts() { .with_assets([fungible_asset.into()]) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -1785,7 +1790,7 @@ async fn genesis_with_multiple_accounts() { let account_component3 = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("baz").with_supports_all_types(), + AccountComponentMetadata::new("baz", AccountType::all()), ) .unwrap(); @@ -1795,7 +1800,7 @@ async fn genesis_with_multiple_accounts() { .with_component(account_component3) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -1885,7 +1890,13 @@ fn serialization_symmetry_core_types() { assert_eq!(nullifier, restored, "Nullifier serialization must be symmetric"); // TransactionId - let tx_id = TransactionId::new(num_to_word(1), num_to_word(2), num_to_word(3), num_to_word(4)); + let tx_id = TransactionId::new( + num_to_word(1), + num_to_word(2), + num_to_word(3), + num_to_word(4), + test_fee(), + ); let bytes = tx_id.to_bytes(); let restored = TransactionId::read_from_bytes(&bytes).unwrap(); assert_eq!(tx_id, restored, "TransactionId serialization must be symmetric"); @@ -2253,7 +2264,7 @@ fn db_roundtrip_account_storage_with_maps() { let account_component = AccountComponent::new( account_component_code, component_storage, - AccountComponentMetadata::new("test").with_supports_all_types(), + AccountComponentMetadata::new("test", AccountType::all()), ) .unwrap(); @@ -2263,7 +2274,7 @@ fn db_roundtrip_account_storage_with_maps() { .with_component(account_component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(EMPTY_WORD), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap(); @@ -2416,13 +2427,15 @@ fn test_prune_history() { .unwrap(); } - // Insert vault assets at different blocks - let vault_key_old = AssetVaultKey::new_unchecked(num_to_word(100)); - let vault_key_cutoff = AssetVaultKey::new_unchecked(num_to_word(200)); - let vault_key_recent = AssetVaultKey::new_unchecked(num_to_word(300)); + // Insert vault assets at different blocks - use different faucets for different vault keys. + let faucet_2 = AccountId::try_from(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_1).unwrap(); + let faucet_3 = AccountId::try_from(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_2).unwrap(); let asset_1 = Asset::Fungible(FungibleAsset::new(public_account_id, 1000).unwrap()); - let asset_2 = Asset::Fungible(FungibleAsset::new(public_account_id, 2000).unwrap()); - let asset_3 = Asset::Fungible(FungibleAsset::new(public_account_id, 3000).unwrap()); + let asset_2 = Asset::Fungible(FungibleAsset::new(faucet_2, 2000).unwrap()); + let asset_3 = Asset::Fungible(FungibleAsset::new(faucet_3, 3000).unwrap()); + let vault_key_old = asset_1.vault_key(); + let vault_key_cutoff = asset_2.vault_key(); + let vault_key_recent = asset_3.vault_key(); // Old entry at block_old (should be deleted when cutoff is at block_cutoff for // chain_tip=block_tip) @@ -2608,8 +2621,9 @@ fn test_prune_history() { // Test that is_latest=true entries are never deleted, even if old // Insert an old entry marked as latest - let vault_key_old_latest = AssetVaultKey::new_unchecked(num_to_word(999)); - let asset_old = Asset::Fungible(FungibleAsset::new(public_account_id, 9999).unwrap()); + let faucet_4 = AccountId::try_from(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_3).unwrap(); + let asset_old = Asset::Fungible(FungibleAsset::new(faucet_4, 9999).unwrap()); + let vault_key_old_latest = asset_old.vault_key(); queries::insert_account_vault_asset( conn, public_account_id, @@ -3152,11 +3166,7 @@ fn account_state_forest_preserves_most_recent_vault_only() { // Verify we can get witnesses for the vault and verify against vault root let witnesses = forest - .get_vault_asset_witnesses( - account_id, - block_1, - [AssetVaultKey::new_unchecked(asset.vault_key().into())].into(), - ) + .get_vault_asset_witnesses(account_id, block_1, [asset.vault_key()].into()) .expect("Should be able to get vault witness after pruning"); assert_eq!(witnesses.len(), 1, "Should have one witness"); diff --git a/crates/store/src/genesis/config/errors.rs b/crates/store/src/genesis/config/errors.rs index 3ea497d547..3a9721c8b4 100644 --- a/crates/store/src/genesis/config/errors.rs +++ b/crates/store/src/genesis/config/errors.rs @@ -8,7 +8,7 @@ use miden_protocol::errors::{ FeeError, TokenSymbolError, }; -use miden_protocol::utils::DeserializationError; +use miden_protocol::utils::serde::DeserializationError; use miden_standards::account::faucets::FungibleFaucetError; use miden_standards::account::wallets::BasicWalletError; diff --git a/crates/store/src/genesis/config/mod.rs b/crates/store/src/genesis/config/mod.rs index f2cfe40b8f..c6b669d35e 100644 --- a/crates/store/src/genesis/config/mod.rs +++ b/crates/store/src/genesis/config/mod.rs @@ -23,9 +23,9 @@ use miden_protocol::account::{ }; use miden_protocol::asset::{FungibleAsset, TokenSymbol}; use miden_protocol::block::FeeParameters; -use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey as RpoSecretKey; +use miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey as RpoSecretKey; use miden_protocol::errors::TokenSymbolError; -use miden_protocol::{Felt, FieldElement, ONE}; +use miden_protocol::{Felt, ONE}; use miden_standards::AuthMethod; use miden_standards::account::auth::AuthSingleSig; use miden_standards::account::faucets::{BasicFungibleFaucet, TokenMetadata}; @@ -222,7 +222,7 @@ impl GenesisConfig { let mut rng = ChaCha20Rng::from_seed(rand::random()); let secret_key = RpoSecretKey::with_rng(&mut get_rpo_random_coin(&mut rng)); let auth = AuthMethod::SingleSig { - approver: (secret_key.public_key().into(), AuthScheme::Falcon512Rpo), + approver: (secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2), }; let init_seed: [u8; 32] = rng.random(); @@ -311,7 +311,7 @@ impl GenesisConfig { // sanity check the total issuance against let basic = BasicFungibleFaucet::try_from(&faucet_account)?; - let max_supply = basic.max_supply().inner(); + let max_supply = basic.max_supply().as_canonical_u64(); if max_supply < total_issuance { return Err(GenesisConfigError::MaxIssuanceExceeded { max_supply, @@ -395,7 +395,7 @@ impl NativeFaucetConfig { let faucet = BasicFungibleFaucet::try_from(&account) .expect("validated as fungible faucet above"); - let symbol = TokenSymbolStr::from(faucet.symbol()); + let symbol = TokenSymbolStr::from(faucet.symbol().clone()); Ok((account, symbol, None)) }, } @@ -431,13 +431,14 @@ impl FungibleFaucetConfig { } = self; let mut rng = ChaCha20Rng::from_seed(rand::random()); let secret_key = RpoSecretKey::with_rng(&mut get_rpo_random_coin(&mut rng)); - let auth = AuthSingleSig::new(secret_key.public_key().into(), AuthScheme::Falcon512Rpo); + let auth = + AuthSingleSig::new(secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2); let init_seed: [u8; 32] = rng.random(); let max_supply = Felt::try_from(max_supply) .expect("The `Felt::MODULUS` is _always_ larger than the `max_supply`"); - let component = BasicFungibleFaucet::new(*symbol.as_ref(), decimals, max_supply)?; + let component = BasicFungibleFaucet::new(symbol.as_ref().clone(), decimals, max_supply)?; // It's similar to `fn create_basic_fungible_faucet`, but we need to cover more cases. let faucet_account = AccountBuilder::new(init_seed) @@ -477,7 +478,7 @@ struct AssetEntry { // STORAGE MODE // ================================================================================================ -/// See the [full description](https://0xmiden.github.io/miden-base/account.html?highlight=Accoun#account-storage-mode) +/// See the [full description](https://0xmiden.github.io/miden-protocol/account.html?highlight=Accoun#account-storage-mode) /// for details #[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, Default)] pub enum StorageMode { @@ -535,8 +536,10 @@ impl AccountSecrets { let account = account_lut .get(&account_id) .ok_or(GenesisConfigError::MissingGenesisAccount { account_id })?; - let account_file = - AccountFile::new(account.clone(), vec![AuthSecretKey::Falcon512Rpo(secret_key)]); + let account_file = AccountFile::new( + account.clone(), + vec![AuthSecretKey::Falcon512Poseidon2(secret_key)], + ); Ok(AccountFileWithName { name, account_file }) }) } @@ -566,8 +569,9 @@ fn prepare_fungible_asset_update( .into_iter() .try_for_each(|fungible_asset| wallet_asset_delta.add(fungible_asset))?; - wallet_asset_delta.iter().try_for_each(|(faucet_id, amount)| { - let issuance: &mut u64 = faucet_issuance.entry(*faucet_id).or_default(); + wallet_asset_delta.iter().try_for_each(|(vault_key, amount)| { + let faucet_id = vault_key.faucet_id(); + let issuance: &mut u64 = faucet_issuance.entry(faucet_id).or_default(); tracing::debug!( "Updating faucet issuance {faucet} with {issuance} += {amount}", faucet = faucet_id.to_hex() @@ -632,8 +636,7 @@ impl From for TokenSymbol { impl From for TokenSymbolStr { fn from(symbol: TokenSymbol) -> Self { - // SAFETY: TokenSymbol guarantees valid format, so to_string should not fail - let raw = symbol.to_string().expect("TokenSymbol should always produce valid string"); + let raw = symbol.to_string(); Self { raw, encoded: symbol } } } diff --git a/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_eth.mac b/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_eth.mac index b76116b574..d20f2d85fc 100644 Binary files a/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_eth.mac and b/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_eth.mac differ diff --git a/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_usdc.mac b/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_usdc.mac index 8e0c2650be..89d1231c98 100644 Binary files a/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_usdc.mac and b/crates/store/src/genesis/config/samples/02-with-account-files/agglayer_faucet_usdc.mac differ diff --git a/crates/store/src/genesis/config/samples/02-with-account-files/bridge.mac b/crates/store/src/genesis/config/samples/02-with-account-files/bridge.mac index 9bab86857e..4e6b5be524 100644 Binary files a/crates/store/src/genesis/config/samples/02-with-account-files/bridge.mac and b/crates/store/src/genesis/config/samples/02-with-account-files/bridge.mac differ diff --git a/crates/store/src/genesis/config/tests.rs b/crates/store/src/genesis/config/tests.rs index 0e02125cbf..acc1b94465 100644 --- a/crates/store/src/genesis/config/tests.rs +++ b/crates/store/src/genesis/config/tests.rs @@ -48,7 +48,7 @@ fn parsing_yields_expected_default_values() -> TestResult { assert_eq!(faucet.max_supply(), Felt::new(100_000_000_000_000_000)); assert_eq!(faucet.decimals(), 6); - assert_eq!(faucet.symbol(), TokenSymbol::new("MIDEN").unwrap()); + assert_eq!(*faucet.symbol(), TokenSymbol::new("MIDEN").unwrap()); } // check account balance, and ensure ordering is retained @@ -96,11 +96,11 @@ fn parsing_account_from_file() -> TestResult { // Create a test wallet account and save it to a .mac file let init_seed: [u8; 32] = rand::random(); let mut rng = rand_chacha::ChaCha20Rng::from_seed(rand::random()); - let secret_key = miden_protocol::crypto::dsa::falcon512_rpo::SecretKey::with_rng( + let secret_key = miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey::with_rng( &mut miden_node_utils::crypto::get_rpo_random_coin(&mut rng), ); let auth = AuthMethod::SingleSig { - approver: (secret_key.public_key().into(), AuthScheme::Falcon512Rpo), + approver: (secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2), }; let test_account = create_basic_wallet( @@ -154,10 +154,10 @@ fn parsing_native_faucet_from_file() -> TestResult { // Create a faucet account and save it to a .mac file let init_seed: [u8; 32] = rand::random(); let mut rng = rand_chacha::ChaCha20Rng::from_seed(rand::random()); - let secret_key = miden_protocol::crypto::dsa::falcon512_rpo::SecretKey::with_rng( + let secret_key = miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey::with_rng( &mut miden_node_utils::crypto::get_rpo_random_coin(&mut rng), ); - let auth = AuthSingleSig::new(secret_key.public_key().into(), AuthScheme::Falcon512Rpo); + let auth = AuthSingleSig::new(secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2); let faucet_component = BasicFungibleFaucet::new(TokenSymbol::new("MIDEN").unwrap(), 6, Felt::new(1_000_000_000))?; @@ -216,11 +216,11 @@ fn native_faucet_from_file_must_be_faucet_type() -> TestResult { // Create a regular wallet account (not a faucet) and try to use it as native faucet let init_seed: [u8; 32] = rand::random(); let mut rng = rand_chacha::ChaCha20Rng::from_seed(rand::random()); - let secret_key = miden_protocol::crypto::dsa::falcon512_rpo::SecretKey::with_rng( + let secret_key = miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey::with_rng( &mut miden_node_utils::crypto::get_rpo_random_coin(&mut rng), ); let auth = AuthMethod::SingleSig { - approver: (secret_key.public_key().into(), AuthScheme::Falcon512Rpo), + approver: (secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2), }; let regular_account = create_basic_wallet( @@ -328,7 +328,7 @@ async fn parsing_agglayer_sample_with_account_files() -> TestResult { // Verify native faucet symbol { let faucet = BasicFungibleFaucet::try_from(native_faucet.clone()).unwrap(); - assert_eq!(faucet.symbol(), TokenSymbol::new("MIDEN").unwrap()); + assert_eq!(*faucet.symbol(), TokenSymbol::new("MIDEN").unwrap()); } // Bridge account is a regular account (not a faucet) diff --git a/crates/store/src/genesis/mod.rs b/crates/store/src/genesis/mod.rs index eb101e1d48..6c4624fb00 100644 --- a/crates/store/src/genesis/mod.rs +++ b/crates/store/src/genesis/mod.rs @@ -2,7 +2,7 @@ use miden_node_utils::signer::BlockSigner; use miden_protocol::Word; use miden_protocol::account::delta::AccountUpdateDetails; use miden_protocol::account::{Account, AccountDelta}; -use miden_protocol::block::account_tree::{AccountTree, account_id_to_smt_key}; +use miden_protocol::block::account_tree::{AccountIdKey, AccountTree}; use miden_protocol::block::{ BlockAccountUpdate, BlockBody, @@ -110,7 +110,10 @@ impl GenesisState { // Convert account updates to SMT entries using account_id_to_smt_key let smt_entries = accounts.iter().map(|update| { - (account_id_to_smt_key(update.account_id()), update.final_state_commitment()) + ( + AccountIdKey::from(update.account_id()).as_word(), + update.final_state_commitment(), + ) }); // Create LargeSmt with MemoryStorage diff --git a/crates/store/src/server/api.rs b/crates/store/src/server/api.rs index 56bfcafb49..8440cb691b 100644 --- a/crates/store/src/server/api.rs +++ b/crates/store/src/server/api.rs @@ -42,8 +42,8 @@ impl StoreApi { Ok(Response::new(proto::rpc::BlockHeaderByNumberResponse { block_header: block_header.map(Into::into), - chain_length: mmr_proof.as_ref().map(|p| p.forest.num_leaves() as u32), - mmr_path: mmr_proof.map(|p| Into::into(&p.merkle_path)), + chain_length: mmr_proof.as_ref().map(|p| p.forest().num_leaves() as u32), + mmr_path: mmr_proof.map(|p| Into::into(p.merkle_path())), })) } @@ -65,7 +65,7 @@ impl StoreApi { for note in batch.input_notes().iter() { if let Some(header) = note.header() { - unauthenticated_note_commitments.insert(header.commitment()); + unauthenticated_note_commitments.insert(header.to_commitment()); } } } diff --git a/crates/store/src/server/block_producer.rs b/crates/store/src/server/block_producer.rs index 25f6b05f60..92b3652cd8 100644 --- a/crates/store/src/server/block_producer.rs +++ b/crates/store/src/server/block_producer.rs @@ -11,7 +11,7 @@ use miden_node_utils::tracing::OpenTelemetrySpanExt; use miden_protocol::Word; use miden_protocol::batch::OrderedBatches; use miden_protocol::block::{BlockBody, BlockHeader, BlockNumber, SignedBlock}; -use miden_protocol::utils::Deserializable; +use miden_protocol::utils::serde::Deserializable; use tonic::{Request, Response, Status}; use tracing::Instrument; diff --git a/crates/store/src/server/ntx_builder.rs b/crates/store/src/server/ntx_builder.rs index f6e8d4a7a5..4c6251d131 100644 --- a/crates/store/src/server/ntx_builder.rs +++ b/crates/store/src/server/ntx_builder.rs @@ -3,6 +3,7 @@ use std::num::{NonZero, TryFromIntError}; use miden_crypto::merkle::smt::SmtProof; use miden_node_proto::domain::account::AccountInfo; +use miden_node_proto::errors::ConversionError; use miden_node_proto::generated as proto; use miden_node_proto::generated::rpc::BlockRange; use miden_node_proto::generated::store::ntx_builder_server; @@ -216,7 +217,11 @@ impl ntx_builder_server::NtxBuilder for StoreApi { .map(|key_digest| { let word = read_root::(Some(key_digest), "VaultKey") .map_err(invalid_argument)?; - Ok(AssetVaultKey::new_unchecked(word)) + AssetVaultKey::try_from(word).map_err(|e| { + invalid_argument(GetWitnessesError::DeserializationFailed( + ConversionError::from(e), + )) + }) }) .collect::, Status>>()?; diff --git a/crates/store/src/server/rpc_api.rs b/crates/store/src/server/rpc_api.rs index a12fcafae7..2e70876826 100644 --- a/crates/store/src/server/rpc_api.rs +++ b/crates/store/src/server/rpc_api.rs @@ -148,7 +148,7 @@ impl rpc_server::Rpc for StoreApi { block_num: last_block_included.as_u32(), }), block_header: Some(state.block_header.into()), - mmr_path: Some(mmr_proof.merkle_path.into()), + mmr_path: Some(mmr_proof.merkle_path().clone().into()), notes, })) } diff --git a/crates/store/src/state/apply_block.rs b/crates/store/src/state/apply_block.rs index 7949fcbeb6..43d3d406a5 100644 --- a/crates/store/src/state/apply_block.rs +++ b/crates/store/src/state/apply_block.rs @@ -5,7 +5,7 @@ use miden_protocol::account::delta::AccountUpdateDetails; use miden_protocol::block::SignedBlock; use miden_protocol::note::NoteDetails; use miden_protocol::transaction::OutputNote; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use tokio::sync::oneshot; use tracing::{Instrument, info, info_span, instrument}; @@ -179,15 +179,10 @@ impl State { .output_notes() .map(|(note_index, note)| { let (details, nullifier) = match note { - OutputNote::Full(note) => { - (Some(NoteDetails::from(note)), Some(note.nullifier())) - }, - OutputNote::Header(_) => (None, None), - note @ OutputNote::Partial(_) => { - return Err(InvalidBlockError::InvalidOutputNoteType(Box::new( - note.clone(), - ))); + OutputNote::Public(note) => { + (Some(NoteDetails::from(note.as_note())), Some(note.as_note().nullifier())) }, + OutputNote::Private(_) => (None, None), }; let inclusion_path = note_tree.open(note_index); @@ -196,7 +191,7 @@ impl State { block_num, note_index, note_id: note.id().as_word(), - note_commitment: note.commitment(), + note_commitment: note.to_commitment(), metadata: note.metadata().clone(), details, inclusion_path, diff --git a/crates/store/src/state/loader.rs b/crates/store/src/state/loader.rs index 20ef9cdc04..3863f4afbc 100644 --- a/crates/store/src/state/loader.rs +++ b/crates/store/src/state/loader.rs @@ -16,13 +16,13 @@ use miden_crypto::merkle::mmr::Mmr; #[cfg(feature = "rocksdb")] use miden_large_smt_backend_rocksdb::RocksDbStorage; use miden_node_utils::clap::RocksDbOptions; -use miden_protocol::block::account_tree::{AccountTree, account_id_to_smt_key}; +use miden_protocol::block::account_tree::{AccountIdKey, AccountTree}; use miden_protocol::block::nullifier_tree::NullifierTree; use miden_protocol::block::{BlockNumber, Blockchain}; #[cfg(not(feature = "rocksdb"))] use miden_protocol::crypto::merkle::smt::MemoryStorage; use miden_protocol::crypto::merkle::smt::{LargeSmt, LargeSmtError, SmtStorage}; -use miden_protocol::{Felt, FieldElement, Word}; +use miden_protocol::{Felt, Word}; #[cfg(feature = "rocksdb")] use tracing::info; use tracing::instrument; @@ -76,6 +76,9 @@ pub fn account_tree_large_smt_error_to_init_error(e: LargeSmtError) -> StateInit LargeSmtError::Storage(err) => { StateInitializationError::AccountTreeIoError(err.as_report()) }, + err @ (LargeSmtError::RootMismatch { .. } | LargeSmtError::StorageNotEmpty) => { + StateInitializationError::AccountTreeIoError(err.as_report()) + }, } } @@ -158,7 +161,7 @@ impl StorageLoader for MemoryStorage { let entries = page .commitments .into_iter() - .map(|(id, commitment)| (account_id_to_smt_key(id), commitment)); + .map(|(id, commitment)| (AccountIdKey::from(id).as_word(), commitment)); let mutations = smt .compute_mutations(entries) @@ -268,7 +271,7 @@ impl StorageLoader for RocksDbStorage { let entries = page .commitments .into_iter() - .map(|(id, commitment)| (account_id_to_smt_key(id), commitment)); + .map(|(id, commitment)| (AccountIdKey::from(id).as_word(), commitment)); let mutations = smt .compute_mutations(entries) @@ -338,7 +341,7 @@ impl StorageLoader for RocksDbStorage { /// Loads an SMT from persistent storage. #[cfg(feature = "rocksdb")] pub fn load_smt(storage: S) -> Result, StateInitializationError> { - LargeSmt::new(storage).map_err(account_tree_large_smt_error_to_init_error) + LargeSmt::load(storage).map_err(account_tree_large_smt_error_to_init_error) } // TREE LOADING FUNCTIONS diff --git a/crates/utils/src/crypto.rs b/crates/utils/src/crypto.rs index 44eac3f87b..d203ff75a0 100644 --- a/crates/utils/src/crypto.rs +++ b/crates/utils/src/crypto.rs @@ -1,11 +1,11 @@ -use miden_protocol::crypto::rand::RpoRandomCoin; +use miden_protocol::crypto::rand::RandomCoin; use miden_protocol::{Felt, Word}; use rand::Rng; /// Creates a new RPO Random Coin with random seed -pub fn get_rpo_random_coin(rng: &mut T) -> RpoRandomCoin { +pub fn get_rpo_random_coin(rng: &mut T) -> RandomCoin { let auth_seed: [u64; 4] = rng.random(); let rng_seed = Word::from(auth_seed.map(Felt::new)); - RpoRandomCoin::new(rng_seed) + RandomCoin::new(rng_seed) } diff --git a/crates/validator/src/db/mod.rs b/crates/validator/src/db/mod.rs index 01364847c2..96c210f8a3 100644 --- a/crates/validator/src/db/mod.rs +++ b/crates/validator/src/db/mod.rs @@ -10,7 +10,7 @@ use diesel::prelude::*; use miden_node_db::{DatabaseError, Db, SqlTypeConvert}; use miden_protocol::block::{BlockHeader, BlockNumber}; use miden_protocol::transaction::TransactionId; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use tracing::instrument; use crate::COMPONENT; diff --git a/crates/validator/src/db/models.rs b/crates/validator/src/db/models.rs index 417880dce2..fd10445338 100644 --- a/crates/validator/src/db/models.rs +++ b/crates/validator/src/db/models.rs @@ -1,6 +1,6 @@ use diesel::prelude::*; use miden_node_db::SqlTypeConvert; -use miden_tx::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use crate::db::schema; use crate::tx_validation::ValidatedTransaction; diff --git a/crates/validator/src/server/mod.rs b/crates/validator/src/server/mod.rs index af4bb82ce4..6471784792 100644 --- a/crates/validator/src/server/mod.rs +++ b/crates/validator/src/server/mod.rs @@ -14,7 +14,7 @@ use miden_node_utils::tracing::OpenTelemetrySpanExt; use miden_node_utils::tracing::grpc::grpc_trace_fn; use miden_protocol::block::ProposedBlock; use miden_protocol::transaction::{ProvenTransaction, TransactionInputs}; -use miden_tx::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use tokio::net::TcpListener; use tokio::sync::Semaphore; use tokio_stream::wrappers::TcpListenerStream; diff --git a/crates/validator/src/signers/kms.rs b/crates/validator/src/signers/kms.rs index d6bd285679..e84576ac1e 100644 --- a/crates/validator/src/signers/kms.rs +++ b/crates/validator/src/signers/kms.rs @@ -5,7 +5,7 @@ use miden_node_utils::signer::BlockSigner; use miden_protocol::block::BlockHeader; use miden_protocol::crypto::dsa::ecdsa_k256_keccak::{PublicKey, Signature}; use miden_protocol::crypto::hash::keccak::Keccak256; -use miden_tx::utils::{DeserializationError, Serializable}; +use miden_protocol::utils::serde::{DeserializationError, Serializable}; // KMS SIGNER ERROR // ================================================================================================ diff --git a/crates/validator/src/tx_validation/validated_tx.rs b/crates/validator/src/tx_validation/validated_tx.rs index 0233c7e8f3..301ac2be28 100644 --- a/crates/validator/src/tx_validation/validated_tx.rs +++ b/crates/validator/src/tx_validation/validated_tx.rs @@ -6,7 +6,7 @@ use miden_protocol::transaction::{ ExecutedTransaction, InputNote, InputNotes, - OutputNotes, + RawOutputNotes, TransactionId, }; @@ -49,7 +49,7 @@ impl ValidatedTransaction { } /// Returns the notes created in this transaction. - pub fn output_notes(&self) -> &OutputNotes { + pub fn output_notes(&self) -> &RawOutputNotes { self.0.output_notes() } diff --git a/docs/internal/src/codebase.md b/docs/internal/src/codebase.md index 0680d0209e..1a31c87f0d 100644 --- a/docs/internal/src/codebase.md +++ b/docs/internal/src/codebase.md @@ -22,7 +22,7 @@ instead simply serve to enforce code organisation and decoupling. --- -> [!NOTE] > [`miden-base`](https://github.com/0xMiden/miden-base) is an important dependency which +> [!NOTE] > [`miden-protocol`](https://github.com/0xMiden/miden-protocol) is an important dependency which > contains the core Miden protocol definitions e.g. accounts, notes, transactions etc. [![workspace dependency tree](assets/workspace_tree.svg)](assets/workspace_tree.svg) diff --git a/proto/proto/internal/block_producer.proto b/proto/proto/internal/block_producer.proto index e81f5c2452..6e34083561 100644 --- a/proto/proto/internal/block_producer.proto +++ b/proto/proto/internal/block_producer.proto @@ -71,7 +71,7 @@ message MempoolEvent { repeated note.NetworkNote network_notes = 3; // Changes to a network account, if any. This includes creation of new network accounts. // - // The account delta is encoded using [winter_utils::Serializable] implementation + // The account delta is encoded using [miden_serde_utils::Serializable] implementation // for [miden_protocol::account::delta::AccountDelta]. optional bytes network_account_delta = 4; } diff --git a/proto/proto/internal/store.proto b/proto/proto/internal/store.proto index 3720991a04..311c1482d6 100644 --- a/proto/proto/internal/store.proto +++ b/proto/proto/internal/store.proto @@ -103,7 +103,7 @@ service BlockProducer { // Applies a block to the state. message ApplyBlockRequest { - // Ordered batches encoded using [winter_utils::Serializable] implementation for + // Ordered batches encoded using [miden_serde_utils::Serializable] implementation for // [miden_objects::batch::OrderedBatches]. bytes ordered_batches = 1; // Block signed by the Validator. diff --git a/proto/proto/types/account.proto b/proto/proto/types/account.proto index e61db64ae2..8fd9729a51 100644 --- a/proto/proto/types/account.proto +++ b/proto/proto/types/account.proto @@ -11,7 +11,7 @@ import "types/primitives.proto"; // A Miden account ID is a 120-bit value derived from the commitments to account code and storage, // and a random user-provided seed. message AccountId { - // 15 bytes (120 bits) encoded using [winter_utils::Serializable] implementation for + // 15 bytes (120 bits) encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::account::account_id::AccountId]. bytes id = 1; } @@ -53,7 +53,7 @@ message AccountDetails { // Account summary. AccountSummary summary = 1; - // Account details encoded using [winter_utils::Serializable] implementation for + // Account details encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::account::Account]. optional bytes details = 2; } diff --git a/proto/proto/types/blockchain.proto b/proto/proto/types/blockchain.proto index 43828d4dc9..e87a3648da 100644 --- a/proto/proto/types/blockchain.proto +++ b/proto/proto/types/blockchain.proto @@ -16,14 +16,14 @@ message SignedBlock { // Represents a proposed block. message ProposedBlock { - // Block data encoded using [winter_utils::Serializable] implementation for + // Block data encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::block::ProposedBlock]. bytes proposed_block = 1; } // Represents a block or nothing. message MaybeBlock { - // The requested block data encoded using [winter_utils::Serializable] implementation for + // The requested block data encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::block::Block]. optional bytes block = 1; } @@ -84,7 +84,7 @@ message BlockHeader { // Validator ECDSA public key. message ValidatorPublicKey { - // Signature encoded using [winter_utils::Serializable] implementation for + // Signature encoded using [miden_serde_utils::Serializable] implementation for // [crypto::dsa::ecdsa_k256_keccak::PublicKey]. bytes validator_key = 1; } @@ -94,7 +94,7 @@ message ValidatorPublicKey { // Block ECDSA Signature. message BlockSignature { - // Signature encoded using [winter_utils::Serializable] implementation for + // Signature encoded using [miden_serde_utils::Serializable] implementation for // [crypto::dsa::ecdsa_k256_keccak::Signature]. bytes signature = 1; } @@ -116,7 +116,7 @@ message FeeParameters { // Represents a block body. message BlockBody { - // Block body data encoded using [winter_utils::Serializable] implementation for + // Block body data encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::block::BlockBody]. bytes block_body = 1; } diff --git a/proto/proto/types/primitives.proto b/proto/proto/types/primitives.proto index 3c8d279b02..a0c30b812a 100644 --- a/proto/proto/types/primitives.proto +++ b/proto/proto/types/primitives.proto @@ -5,8 +5,10 @@ package primitives; // ================================================================================================ message Asset { - // Asset represented as a word. - primitives.Digest asset = 1; + // Asset vault key represented as a word. + primitives.Digest key = 1; + // Asset value represented as a word. + primitives.Digest value = 2; } // SMT (Sparse Merkle Tree) diff --git a/proto/proto/types/transaction.proto b/proto/proto/types/transaction.proto index 8be04946d7..54f1bdbb7e 100644 --- a/proto/proto/types/transaction.proto +++ b/proto/proto/types/transaction.proto @@ -10,16 +10,16 @@ import "types/primitives.proto"; // Submits proven transaction to the Miden network. message ProvenTransaction { - // Transaction encoded using [winter_utils::Serializable] implementation for + // Transaction encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::transaction::proven_tx::ProvenTransaction]. bytes transaction = 1; - // Transaction inputs encoded using [winter_utils::Serializable] implementation for + // Transaction inputs encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::transaction::TransactionInputs]. optional bytes transaction_inputs = 2; } message ProvenTransactionBatch { - // Encoded using [winter_utils::Serializable] implementation for + // Encoded using [miden_serde_utils::Serializable] implementation for // [miden_protocol::transaction::proven_tx::ProvenTransaction]. bytes encoded = 1; }