diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c6fc7e8d8..1ac405b7c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.14.2 (2026-03-31) + +### Changes + +- Changed felt-to-word layout in the type registry from `[0, 0, 0, felt]` to `[felt, 0, 0, 0]` to match the actual MASM storage layout ([#2711](https://github.com/0xMiden/protocol/pull/2711)). + +## 0.14.1 (2026-03-30) + +### Changes + +- Integrated various AggLayer-related cleanups ([#2695](https://github.com/0xMiden/protocol/pull/2695)). + ## 0.14.0 (2026-03-23) ### Features diff --git a/Cargo.lock b/Cargo.lock index 49fe4de828..9226a9ebb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -329,16 +329,16 @@ checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "blake3" -version = "1.8.3" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +checksum = "4d2d5991425dfd0785aed03aedcf0b321d61975c9b5b3689c774a2610ae0b51e" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "cpufeatures", + "cpufeatures 0.3.0", ] [[package]] @@ -382,9 +382,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.57" +version = "1.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" dependencies = [ "find-msvc-tools", "jobserver", @@ -406,7 +406,7 @@ checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", "cipher", - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -525,7 +525,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "proptest", "serde_core", ] @@ -560,6 +560,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "criterion" version = "0.5.1" @@ -681,7 +690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "curve25519-dalek-derive", "digest", "fiat-crypto", @@ -1358,9 +1367,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" dependencies = [ "once_cell", "wasm-bindgen", @@ -1386,7 +1395,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" dependencies = [ - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -1514,7 +1523,7 @@ dependencies = [ [[package]] name = "miden-agglayer" -version = "0.14.1" +version = "0.14.2" dependencies = [ "alloy-sol-types", "fs-err", @@ -1588,7 +1597,7 @@ dependencies = [ [[package]] name = "miden-block-prover" -version = "0.14.1" +version = "0.14.2" dependencies = [ "miden-protocol", "thiserror", @@ -1799,7 +1808,7 @@ dependencies = [ [[package]] name = "miden-protocol" -version = "0.14.1" +version = "0.14.2" dependencies = [ "anyhow", "assert_matches", @@ -1835,7 +1844,7 @@ dependencies = [ [[package]] name = "miden-protocol-macros" -version = "0.14.1" +version = "0.14.2" dependencies = [ "miden-protocol", "proc-macro2", @@ -1873,7 +1882,7 @@ dependencies = [ [[package]] name = "miden-standards" -version = "0.14.1" +version = "0.14.2" dependencies = [ "anyhow", "assert_matches", @@ -1892,7 +1901,7 @@ dependencies = [ [[package]] name = "miden-testing" -version = "0.14.1" +version = "0.14.2" dependencies = [ "anyhow", "assert_matches", @@ -1920,7 +1929,7 @@ dependencies = [ [[package]] name = "miden-tx" -version = "0.14.1" +version = "0.14.2" dependencies = [ "anyhow", "assert_matches", @@ -1937,7 +1946,7 @@ dependencies = [ [[package]] name = "miden-tx-batch-prover" -version = "0.14.1" +version = "0.14.2" dependencies = [ "miden-protocol", "miden-tx", @@ -2204,9 +2213,9 @@ checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" [[package]] name = "p3-air" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ebc58ec27a174420348b3f04dba836fa2e5b5fe8df74601087417352757c643" +checksum = "9f2ec9cbfc642fc5173817287c3f8b789d07743b5f7e812d058b7a03e344f9ab" dependencies = [ "p3-field", "p3-matrix", @@ -2215,9 +2224,9 @@ dependencies = [ [[package]] name = "p3-blake3" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3cacb38c29fbee71fe3e5c6c0a1073632e46dc3e93fbdc50ab4e4fac137b525" +checksum = "b667f43b19499dd939c9e2553aa95688936a88360d50117dae3c8848d07dbc70" dependencies = [ "blake3", "p3-symmetric", @@ -2226,9 +2235,9 @@ dependencies = [ [[package]] name = "p3-challenger" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9bbcb18fe90271668259aacfc43455e328673c2b5c926cff0663edc8653e4d" +checksum = "4a0b490c745a7d2adeeafff06411814c8078c432740162332b3cd71be0158a76" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -2240,9 +2249,9 @@ dependencies = [ [[package]] name = "p3-commit" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d07b50c6f6d3bc89ed7c54ae0c569fb4caaa58263fd389dc02fb1b0a6378fa" +checksum = "916ae7989d5c3b49f887f5c55b2f9826bdbb81aaebf834503c4145d8b267c829" dependencies = [ "itertools 0.14.0", "p3-field", @@ -2253,9 +2262,9 @@ dependencies = [ [[package]] name = "p3-dft" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e7ba0dc20be075eab3f88f0cb820a0901f86218a1c46134e7c817d41597989" +checksum = "55301e91544440254977108b85c32c09d7ea05f2f0dd61092a2825339906a4a7" dependencies = [ "itertools 0.14.0", "p3-field", @@ -2268,9 +2277,9 @@ dependencies = [ [[package]] name = "p3-field" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b8533e6c2f4d0cc61fd2ae5299bb83316898e535f47291808d37e4d666ba088" +checksum = "85affca7fc983889f260655c4cf74163eebb94605f702e4b6809ead707cba54f" dependencies = [ "itertools 0.14.0", "num-bigint", @@ -2284,9 +2293,9 @@ dependencies = [ [[package]] name = "p3-goldilocks" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8102a8c85acee1f896c3764bef5fac908e6026dadfc557c185294970cce0746" +checksum = "0ca1081f5c47b940f2d75a11c04f62ea1cc58a5d480dd465fef3861c045c63cd" dependencies = [ "num-bigint", "p3-challenger", @@ -2304,9 +2313,9 @@ dependencies = [ [[package]] name = "p3-keccak" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65d30dd586d2855906a01c3414c155c2d564f6677d1b51f04186dcac080f757" +checksum = "ebcf27615ece1995e4fcf4c69740f1cf515d1481367a20b4b3ce7f4f1b8d70f7" dependencies = [ "p3-symmetric", "p3-util", @@ -2315,9 +2324,9 @@ dependencies = [ [[package]] name = "p3-matrix" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72bb78444459155c2e4711d71abbfef7b04cc2ba1fa83751ccab241b01957095" +checksum = "53428126b009071563d1d07305a9de8be0d21de00b57d2475289ee32ffca6577" dependencies = [ "itertools 0.14.0", "p3-field", @@ -2330,18 +2339,18 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a0a54345917f500130a9986fa5ff9ecbc26f0c6313080b35b713e26ddc8053" +checksum = "082bf467011c06c768c579ec6eb9accb5e1e62108891634cc770396e917f978a" dependencies = [ "rayon", ] [[package]] name = "p3-mds" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd514bf3e9bf9f1b7db2db96e5bd2972d9963dd62430de1e193d74522ae96a6" +checksum = "35209e6214102ea6ec6b8cb1b9c15a9b8e597a39f9173597c957f123bced81b3" dependencies = [ "p3-dft", "p3-field", @@ -2448,9 +2457,9 @@ dependencies = [ [[package]] name = "p3-monty-31" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d9340a650f07a6cd42a4e877017ba7b206df87fe50dfc3cf110f01a3c370bd1" +checksum = "ffa8c99ec50c035020bbf5457c6a729ba6a975719c1a8dd3f16421081e4f650c" dependencies = [ "itertools 0.14.0", "num-bigint", @@ -2472,9 +2481,9 @@ dependencies = [ [[package]] name = "p3-poseidon1" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd56ae3a51ded1b77f7b1b21d0b157ae82b9d5ca8f2cba347c0b821fe771a79" +checksum = "6a018b618e3fa0aec8be933b1d8e404edd23f46991f6bf3f5c2f3f95e9413fe9" dependencies = [ "p3-field", "p3-symmetric", @@ -2483,9 +2492,9 @@ dependencies = [ [[package]] name = "p3-poseidon2" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "858aa1c33ec983dfbb8cfc553a213de19d8fde96485e54e6e952b9ac5e70bd4e" +checksum = "256a668a9ba916f8767552f13d0ba50d18968bc74a623bfdafa41e2970c944d0" dependencies = [ "p3-field", "p3-mds", @@ -2496,9 +2505,9 @@ dependencies = [ [[package]] name = "p3-symmetric" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9a3b20bb8104e52d45219a78d80654c8ac6a4781be0eaa3f3e999f5ae4b9b2" +checksum = "6c60a71a1507c13611b0f2b0b6e83669fd5b76f8e3115bcbced5ccfdf3ca7807" dependencies = [ "itertools 0.14.0", "p3-field", @@ -2508,9 +2517,9 @@ dependencies = [ [[package]] name = "p3-util" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f24495d9cd64693165a9f1b3da0758395ad6d25d2d44dd740bdb34c2bce0c53" +checksum = "f8b766b9e9254bf3fa98d76e42cf8a5b30628c182dfd5272d270076ee12f0fc0" dependencies = [ "rayon", "serde", @@ -2615,7 +2624,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "cpufeatures", + "cpufeatures 0.2.17", "opaque-debug", "universal-hash", ] @@ -2735,9 +2744,9 @@ dependencies = [ [[package]] name = "proptest" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" dependencies = [ "bitflags 2.11.0", "num-traits", @@ -3019,9 +3028,9 @@ checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustc_version" @@ -3177,9 +3186,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] @@ -3191,7 +3200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -3533,9 +3542,9 @@ dependencies = [ [[package]] name = "toml" -version = "1.1.0+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc" +checksum = "994b95d9e7bae62b34bab0e2a4510b801fa466066a6a8b2b57361fa1eba068ee" dependencies = [ "indexmap", "serde_core", @@ -3548,18 +3557,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.1.0+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.25.8+spec-1.1.0" +version = "0.25.9+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16bff38f1d86c47f9ff0647e6838d7bb362522bdf44006c7068c2b1e606f1f3c" +checksum = "da053d28fe57e2c9d21b48261e14e7b4c8b670b54d2c684847b91feaf4c7dac5" dependencies = [ "indexmap", "toml_datetime", @@ -3569,18 +3578,18 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.0+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" +checksum = "39ca317ebc49f06bd748bfba29533eac9485569dc9bf80b849024b025e814fb9" dependencies = [ "winnow", ] [[package]] name = "toml_writer" -version = "1.1.0+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tracing" @@ -3728,9 +3737,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" [[package]] name = "unicode-width" @@ -3768,9 +3777,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" dependencies = [ "js-sys", "wasm-bindgen", @@ -3833,9 +3842,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" dependencies = [ "cfg-if", "once_cell", @@ -3846,9 +3855,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3856,9 +3865,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" dependencies = [ "bumpalo", "proc-macro2", @@ -3869,9 +3878,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" dependencies = [ "unicode-ident", ] @@ -3912,9 +3921,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" dependencies = [ "js-sys", "wasm-bindgen", @@ -3977,9 +3986,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" dependencies = [ "memchr", ] @@ -4084,18 +4093,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.47" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.47" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 3da7d13644..aace353325 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ homepage = "https://miden.xyz" license = "MIT" repository = "https://github.com/0xMiden/protocol" rust-version = "1.90" -version = "0.14.1" +version = "0.14.2" [profile.release] codegen-units = 1 diff --git a/crates/miden-protocol/src/account/component/storage/init_storage_data.rs b/crates/miden-protocol/src/account/component/storage/init_storage_data.rs index 6a0f560d55..8eaa214894 100644 --- a/crates/miden-protocol/src/account/component/storage/init_storage_data.rs +++ b/crates/miden-protocol/src/account/component/storage/init_storage_data.rs @@ -47,9 +47,9 @@ impl From<&str> for WordValue { } impl From for WordValue { - /// Converts a [`Felt`] to a [`WordValue`] as a Word in the form `[0, 0, 0, felt]`. + /// Converts a [`Felt`] to a [`WordValue`] as a Word in the form `[felt, 0, 0, 0]`. fn from(value: Felt) -> Self { - WordValue::FullyTyped(Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, value])) + WordValue::FullyTyped(Word::from([value, Felt::ZERO, Felt::ZERO, Felt::ZERO])) } } diff --git a/crates/miden-protocol/src/account/component/storage/schema/tests.rs b/crates/miden-protocol/src/account/component/storage/schema/tests.rs index 99161c5994..5ec22680ea 100644 --- a/crates/miden-protocol/src/account/component/storage/schema/tests.rs +++ b/crates/miden-protocol/src/account/component/storage/schema/tests.rs @@ -97,7 +97,7 @@ fn value_slot_schema_accepts_felt_typed_word_init_value() { init_data.set_value("demo::u8_word", 6u8).unwrap(); let built = slot.try_build_word(&init_data, &slot_name).unwrap(); - assert_eq!(built, Word::from([Felt::new(0), Felt::new(0), Felt::new(0), Felt::new(6)])); + assert_eq!(built, Word::from([Felt::new(6), Felt::new(0), Felt::new(0), Felt::new(0)])); } #[test] diff --git a/crates/miden-protocol/src/account/component/storage/toml/tests.rs b/crates/miden-protocol/src/account/component/storage/toml/tests.rs index 221c18c0a6..f445fad344 100644 --- a/crates/miden-protocol/src/account/component/storage/toml/tests.rs +++ b/crates/miden-protocol/src/account/component/storage/toml/tests.rs @@ -752,7 +752,7 @@ fn extensive_schema_metadata_and_init_toml_example() { }; assert_eq!( protocol_version_word, - &Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::from(7u8)]) + &Word::from([Felt::from(7u8), Felt::ZERO, Felt::ZERO, Felt::ZERO]) ); let static_word_name = StorageSlotName::new("demo::static_word").unwrap(); @@ -831,7 +831,7 @@ fn extensive_schema_metadata_and_init_toml_example() { assert_eq!( typed_map_new_contents.get(&StorageMapKey::from_array([1, 2, 0, 0])), - Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::new(16)]) + Word::from([Felt::new(16), Felt::ZERO, Felt::ZERO, Felt::ZERO]) ); let token_metadata_slot = @@ -941,6 +941,6 @@ fn typed_map_supports_non_numeric_value_types() { let key = Word::parse("0x1").unwrap(); let symbol_felt: Felt = TokenSymbol::new("BTC").unwrap().into(); - let expected_value = Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, symbol_felt]); + let expected_value = Word::from([symbol_felt, Felt::ZERO, Felt::ZERO, Felt::ZERO]); assert_eq!(map.get(&StorageMapKey::from_raw(key)), expected_value); } diff --git a/crates/miden-protocol/src/account/component/storage/type_registry.rs b/crates/miden-protocol/src/account/component/storage/type_registry.rs index 6db8c9716c..88c884e9ec 100644 --- a/crates/miden-protocol/src/account/component/storage/type_registry.rs +++ b/crates/miden-protocol/src/account/component/storage/type_registry.rs @@ -280,17 +280,17 @@ where fn parse_str(input: &str) -> Result { let felt = ::parse_str(input)?; - Ok(Word::from([Felt::new(0), Felt::new(0), Felt::new(0), felt])) + Ok(Word::from([felt, Felt::new(0), Felt::new(0), Felt::new(0)])) } fn display_word(value: Word) -> Result { - if value[0] != Felt::new(0) || value[1] != Felt::new(0) || value[2] != Felt::new(0) { + if value[1] != Felt::new(0) || value[2] != Felt::new(0) || value[3] != Felt::new(0) { return Err(SchemaTypeError::ConversionError(format!( - "expected a word of the form [0, 0, 0, ] for type `{}`", + "expected a word of the form [, 0, 0, 0] for type `{}`", Self::type_name() ))); } - ::display_felt(value[3]) + ::display_felt(value[0]) } } @@ -676,13 +676,13 @@ impl SchemaTypeRegistry { match self.type_kind(type_name) { TypeKind::Word => Ok(()), TypeKind::Felt => { - // Felt types stored as words must have the form [0, 0, 0, ] - if word[0] != Felt::ZERO || word[1] != Felt::ZERO || word[2] != Felt::ZERO { + // Felt types stored as words must have the form [, 0, 0, 0] + if word[1] != Felt::ZERO || word[2] != Felt::ZERO || word[3] != Felt::ZERO { return Err(SchemaTypeError::ConversionError(format!( - "expected a word of the form [0, 0, 0, ] for type `{type_name}`" + "expected a word of the form [, 0, 0, 0] for type `{type_name}`" ))); } - self.validate_felt_value(type_name, word[3]) + self.validate_felt_value(type_name, word[0]) }, } } @@ -707,7 +707,7 @@ impl SchemaTypeRegistry { // Treat any registered felt type as a word type by zero-padding the remaining felts. if self.contains_felt_type(type_name) { - let value = self.display_felt(type_name, word[3]); + let value = self.display_felt(type_name, word[0]); return WordDisplay::Felt(value); } @@ -737,7 +737,7 @@ impl SchemaTypeRegistry { // Treat any registered felt type as a word type by zero-padding the remaining felts. if let Some(converter) = self.felt.get(type_name) { let felt = converter(value)?; - return Ok(Word::from([Felt::new(0), Felt::new(0), Felt::new(0), felt])); + return Ok(Word::from([felt, Felt::new(0), Felt::new(0), Felt::new(0)])); } Err(SchemaTypeError::WordTypeNotFound(type_name.clone())) @@ -776,12 +776,12 @@ mod tests { let numeric_word = SCHEMA_TYPE_REGISTRY .try_parse_word(&auth_scheme_type, "2") .expect("numeric auth scheme id should parse"); - assert_eq!(numeric_word, Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::from(2u8)])); + assert_eq!(numeric_word, Word::from([Felt::from(2u8), Felt::ZERO, Felt::ZERO, Felt::ZERO])); let named_word = SCHEMA_TYPE_REGISTRY .try_parse_word(&auth_scheme_type, "EcdsaK256Keccak") .expect("named auth scheme should parse"); - assert_eq!(named_word, Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::from(1u8)])); + assert_eq!(named_word, Word::from([Felt::from(1u8), Felt::ZERO, Felt::ZERO, Felt::ZERO])); let displayed = SCHEMA_TYPE_REGISTRY.display_word(&auth_scheme_type, numeric_word); assert!( @@ -798,7 +798,7 @@ mod tests { assert!(SCHEMA_TYPE_REGISTRY.try_parse_word(&auth_scheme_type, "9").is_err()); assert!(SCHEMA_TYPE_REGISTRY.try_parse_word(&auth_scheme_type, "invalid").is_err()); - let invalid_word = Word::from([Felt::ZERO, Felt::ZERO, Felt::ZERO, Felt::from(9u8)]); + let invalid_word = Word::from([Felt::from(9u8), Felt::ZERO, Felt::ZERO, Felt::ZERO]); assert!( SCHEMA_TYPE_REGISTRY .validate_word_value(&auth_scheme_type, invalid_word) diff --git a/deny.toml b/deny.toml index 29b7c11c46..af17464860 100644 --- a/deny.toml +++ b/deny.toml @@ -45,6 +45,7 @@ highlight = "all" multiple-versions = "deny" skip = [ #{ name = "ansi_term", version = "=0.11.0" }, + { name = "cpufeatures" }, # Allow duplicate rand versions - miden-field uses 0.10, miden-vm uses 0.9 { name = "rand" }, { name = "rand_core" }, diff --git a/docs/src/account/components.md b/docs/src/account/components.md index 4adcbcb6e3..769e0c5925 100644 --- a/docs/src/account/components.md +++ b/docs/src/account/components.md @@ -98,7 +98,7 @@ In TOML, these are declared using dotted array keys: **Value-slot** entries describe their schema via `WordSchema`. A value type can be either: -- **Simple**: defined through the `type = ""` field, indicating the expected `SchemaType` for the entire word. The value is supplied at instantiation time via `InitStorageData`. Felt types are stored as full words in the following layout: `[0, 0, 0, ]`. +- **Simple**: defined through the `type = ""` field, indicating the expected `SchemaType` for the entire word. The value is supplied at instantiation time via `InitStorageData`. Felt types are stored as full words in the following layout: `[, 0, 0, 0]`. - **Composite**: provided through `type = [ ... ]`, which contains exactly four `FeltSchema` descriptors. Each element is either a named typed field (optionally with `default-value`) or a `void` element for reserved/padding zeros. Composite schema entries reuse the existing TOML structure for four-element words, while simple schemas rely on `type`. In our example, the `token_metadata` slot uses a composite schema (`type = [...]`) mixing typed fields (`max_supply`, `decimals`) with defaults (`symbol`) and a reserved/padding `void` element.