diff --git a/Cargo.lock b/Cargo.lock index 883c7e78cd..4646279c72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -693,6 +693,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" @@ -1575,7 +1584,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin", + "spin 0.9.8", ] [[package]] @@ -2681,18 +2690,17 @@ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "miden-agglayer" -version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e492a6044cf8875a64d7eec130d260f2eda1c783795261f00d5d52837ed027bd" +version = "0.14.0-alpha.2" +source = "git+https://github.com/0xMiden/protocol?branch=agglayer#ecb6359a6b60680c6737b3a7236f48bb681a21b6" dependencies = [ "fs-err", - "miden-assembly", - "miden-core", - "miden-core-lib", - "miden-crypto", - "miden-protocol", - "miden-standards", - "miden-utils-sync", + "miden-assembly 0.20.6", + "miden-core 0.20.6", + "miden-core-lib 0.20.6", + "miden-crypto 0.19.8", + "miden-protocol 0.14.0-alpha.2", + "miden-standards 0.14.0-alpha.2", + "miden-utils-sync 0.20.6", "primitive-types", "regex", "thiserror 2.0.18", @@ -2705,24 +2713,51 @@ version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cca9632323bd4e32ae5b21b101ed417a646f5d72196b1bf3f1ca889a148322a" dependencies = [ - "miden-core", - "miden-utils-indexing", + "miden-core 0.20.6", + "miden-utils-indexing 0.20.6", "thiserror 2.0.18", "winter-air", "winter-prover", ] +[[package]] +name = "miden-air" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8aa2b3bc95d9eece8b47edbc6621b5742e212b359ff6b82ebb813b3d9b28985" +dependencies = [ + "miden-core 0.21.2", + "miden-crypto 0.22.4", + "miden-utils-indexing 0.21.2", + "thiserror 2.0.18", + "tracing", +] + [[package]] name = "miden-assembly" version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2395b2917aea613a285d3425d1ca07e6c45442e2b34febdea2081db555df62fc" +dependencies = [ + "log", + "miden-assembly-syntax 0.20.6", + "miden-core 0.20.6", + "miden-mast-package 0.20.6", + "smallvec", + "thiserror 2.0.18", +] + +[[package]] +name = "miden-assembly" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89369e85051e14e21c52f8e38456b4db958151afb32a3cef0a522e04163ec5c2" dependencies = [ "env_logger", "log", - "miden-assembly-syntax", - "miden-core", - "miden-mast-package", + "miden-assembly-syntax 0.21.2", + "miden-core 0.21.2", + "miden-mast-package 0.21.2", "smallvec", "thiserror 2.0.18", ] @@ -2732,15 +2767,37 @@ name = "miden-assembly-syntax" version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f9bed037d137f209b9e7b28811ec78c0536b3f9259d6f4ceb5823c87513b346" +dependencies = [ + "aho-corasick", + "lalrpop", + "lalrpop-util", + "log", + "miden-core 0.20.6", + "miden-debug-types 0.20.6", + "miden-utils-diagnostics 0.20.6", + "midenc-hir-type", + "proptest", + "regex", + "rustc_version 0.4.1", + "semver 1.0.27", + "smallvec", + "thiserror 2.0.18", +] + +[[package]] +name = "miden-assembly-syntax" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069e6fa110d918662ce77eecfc3d7f906050023fad899f414fc63122e31b771" dependencies = [ "aho-corasick", "env_logger", "lalrpop", "lalrpop-util", "log", - "miden-core", - "miden-debug-types", - "miden-utils-diagnostics", + "miden-core 0.21.2", + "miden-debug-types 0.21.2", + "miden-utils-diagnostics 0.21.2", "midenc-hir-type", "proptest", "proptest-derive", @@ -2754,10 +2811,9 @@ dependencies = [ [[package]] name = "miden-block-prover" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9564dfb23c529aad68369845b6897a6f62bacdeab7c00db432a5f16670764d4" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" dependencies = [ - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "thiserror 2.0.18", ] @@ -2769,20 +2825,39 @@ checksum = "8714aa5f86c59e647b7417126b32adc4ef618f835964464f5425549df76b6d03" dependencies = [ "derive_more", "itertools 0.14.0", - "miden-crypto", - "miden-debug-types", + "miden-crypto 0.19.8", + "miden-debug-types 0.20.6", "miden-formatting", - "miden-utils-core-derive", - "miden-utils-indexing", + "miden-utils-core-derive 0.20.6", + "miden-utils-indexing 0.20.6", "num-derive", "num-traits", - "proptest", - "proptest-derive", "thiserror 2.0.18", "winter-math", "winter-utils", ] +[[package]] +name = "miden-core" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a9ebf937ab3ebc6d540cc7c48dd5cfc08da8b19e38757f71229d6b50414268b" +dependencies = [ + "derive_more", + "itertools 0.14.0", + "miden-crypto 0.22.4", + "miden-debug-types 0.21.2", + "miden-formatting", + "miden-utils-core-derive 0.21.2", + "miden-utils-indexing 0.21.2", + "miden-utils-sync 0.21.2", + "num-derive", + "num-traits", + "proptest", + "proptest-derive", + "thiserror 2.0.18", +] + [[package]] name = "miden-core-lib" version = "0.20.6" @@ -2791,15 +2866,31 @@ checksum = "1bb16a4d39202c59a7964d3585cd5af21a46a759ff6452cb5f20723ed5af4362" dependencies = [ "env_logger", "fs-err", - "miden-assembly", - "miden-core", - "miden-crypto", - "miden-processor", - "miden-utils-sync", + "miden-assembly 0.20.6", + "miden-core 0.20.6", + "miden-crypto 0.19.8", + "miden-processor 0.20.6", + "miden-utils-sync 0.20.6", "sha2", "thiserror 2.0.18", ] +[[package]] +name = "miden-core-lib" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa496b3a7546c0022e8d5a92d88726907e380074f1fb634859b5e2094270dacf" +dependencies = [ + "env_logger", + "fs-err", + "miden-assembly 0.21.2", + "miden-core 0.21.2", + "miden-crypto 0.22.4", + "miden-processor 0.21.2", + "miden-utils-sync 0.21.2", + "thiserror 2.0.18", +] + [[package]] name = "miden-crypto" version = "0.19.8" @@ -2813,17 +2904,15 @@ dependencies = [ "ed25519-dalek", "flume", "glob", - "hashbrown 0.16.1", "hkdf", "k256", - "miden-crypto-derive", + "miden-crypto-derive 0.19.8", "num", "num-complex", "rand", "rand_chacha", "rand_core 0.9.5", "rand_hc", - "rayon", "sha2", "sha3", "subtle", @@ -2834,11 +2923,70 @@ dependencies = [ "x25519-dalek", ] +[[package]] +name = "miden-crypto" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8fc3ec2033d3e17a40611f3ab7c20b0578ccf5e6ddcc9a1df9f26599e6ebdd" +dependencies = [ + "blake3", + "cc", + "chacha20poly1305", + "curve25519-dalek", + "ed25519-dalek", + "flume", + "glob", + "hashbrown 0.16.1", + "hkdf", + "k256", + "miden-crypto-derive 0.22.4", + "miden-field", + "miden-serde-utils", + "num", + "num-complex", + "p3-air", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-goldilocks", + "p3-keccak", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-miden-air", + "p3-miden-fri", + "p3-miden-prover", + "p3-symmetric", + "p3-util", + "rand", + "rand_chacha", + "rand_core 0.9.5", + "rand_hc", + "rayon", + "sha2", + "sha3", + "subtle", + "thiserror 2.0.18", + "x25519-dalek", +] + [[package]] name = "miden-crypto-derive" -version = "0.19.6" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550b5656b791fec59c0b6089b4d0368db746a34749ccd47e59afb01aa877e9e" +checksum = "06f2e7a7ac7d01e03a7340224722e75494826fe6b61a3796b77fbb044d018287" +dependencies = [ + "quote", + "syn 2.0.114", +] + +[[package]] +name = "miden-crypto-derive" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "207828f24e358b4e1e0641c37802816b8730816ff92ddb4d271ef3a00f8696bb" dependencies = [ "quote", "syn 2.0.114", @@ -2851,17 +2999,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd1494f102ad5b9fa43e391d2601186dc601f41ab7dcd8a23ecca9bf3ef930f4" dependencies = [ "memchr", - "miden-crypto", + "miden-crypto 0.19.8", + "miden-formatting", + "miden-miette", + "miden-utils-indexing 0.20.6", + "miden-utils-sync 0.20.6", + "paste", + "serde", + "serde_spanned", + "thiserror 2.0.18", +] + +[[package]] +name = "miden-debug-types" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbdee85c103fe0979ed05f888da8c0b078446b2feee17a67f56d75d6189adae" +dependencies = [ + "memchr", + "miden-crypto 0.22.4", "miden-formatting", "miden-miette", - "miden-utils-indexing", - "miden-utils-sync", + "miden-utils-indexing 0.21.2", + "miden-utils-sync 0.21.2", "paste", "serde", "serde_spanned", "thiserror 2.0.18", ] +[[package]] +name = "miden-field" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f821a07c16cfa6e500d5a56d05c11523984e3cd562cfc80ef657e4264d708067" +dependencies = [ + "miden-serde-utils", + "num-bigint", + "p3-challenger", + "p3-field", + "p3-goldilocks", + "paste", + "rand", + "serde", + "thiserror 2.0.18", +] + [[package]] name = "miden-formatting" version = "0.1.1" @@ -2873,11 +3056,11 @@ dependencies = [ [[package]] name = "miden-large-smt-backend-rocksdb" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ - "miden-crypto", + "miden-crypto 0.22.4", "miden-node-rocksdb-cxx-linkage-fix", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "rayon", "rocksdb", "winter-utils", @@ -2890,8 +3073,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692185bfbe0ecdb28bf623f1f8c88282cd6727ba081a28e23b301bdde1b45be4" dependencies = [ "derive_more", - "miden-assembly-syntax", - "miden-core", + "miden-assembly-syntax 0.20.6", + "miden-core 0.20.6", + "thiserror 2.0.18", +] + +[[package]] +name = "miden-mast-package" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47f6dfbe2e3a2ca9977a46551d378cf4c5232624d50bd604c644eaa95342a5c1" +dependencies = [ + "derive_more", + "miden-assembly-syntax 0.21.2", + "miden-core 0.21.2", + "miden-debug-types 0.21.2", "thiserror 2.0.18", ] @@ -2913,7 +3109,7 @@ dependencies = [ "rustc_version 0.2.3", "rustversion", "serde_json", - "spin", + "spin 0.9.8", "strip-ansi-escapes", "supports-color", "supports-hyperlinks", @@ -2939,7 +3135,7 @@ dependencies = [ [[package]] name = "miden-network-monitor" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "axum", @@ -2948,8 +3144,8 @@ dependencies = [ "humantime", "miden-node-proto", "miden-node-utils", - "miden-protocol", - "miden-standards", + "miden-protocol 0.14.0-alpha.1", + "miden-standards 0.14.0-alpha.1", "miden-testing", "miden-tx", "rand", @@ -2967,7 +3163,7 @@ dependencies = [ [[package]] name = "miden-node" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "clap", @@ -2980,14 +3176,14 @@ dependencies = [ "miden-node-store", "miden-node-utils", "miden-node-validator", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "tokio", "url", ] [[package]] name = "miden-node-block-producer" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "assert_matches", @@ -2999,9 +3195,9 @@ dependencies = [ "miden-node-test-macro", "miden-node-utils", "miden-node-validator", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "miden-remote-prover-client", - "miden-standards", + "miden-standards 0.14.0-alpha.1", "miden-tx", "miden-tx-batch-prover", "pretty_assertions", @@ -3023,20 +3219,20 @@ dependencies = [ [[package]] name = "miden-node-db" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "deadpool", "deadpool-diesel", "deadpool-sync", "diesel", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "thiserror 2.0.18", "tracing", ] [[package]] name = "miden-node-grpc-error-macro" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "quote", "syn 2.0.114", @@ -3044,7 +3240,7 @@ dependencies = [ [[package]] name = "miden-node-ntx-builder" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "build-rs", @@ -3056,9 +3252,9 @@ dependencies = [ "miden-node-proto", "miden-node-test-macro", "miden-node-utils", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "miden-remote-prover-client", - "miden-standards", + "miden-standards 0.14.0-alpha.1", "miden-tx", "rand_chacha", "rstest", @@ -3074,7 +3270,7 @@ dependencies = [ [[package]] name = "miden-node-proto" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "assert_matches", @@ -3085,8 +3281,8 @@ dependencies = [ "miden-node-grpc-error-macro", "miden-node-proto-build", "miden-node-utils", - "miden-protocol", - "miden-standards", + "miden-protocol 0.14.0-alpha.1", + "miden-standards 0.14.0-alpha.1", "miette", "proptest", "prost", @@ -3099,7 +3295,7 @@ dependencies = [ [[package]] name = "miden-node-proto-build" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "build-rs", "fs-err", @@ -3110,23 +3306,23 @@ dependencies = [ [[package]] name = "miden-node-rocksdb-cxx-linkage-fix" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" [[package]] name = "miden-node-rpc" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "futures", "http 1.4.0", "mediatype", - "miden-air", + "miden-air 0.21.2", "miden-node-proto", "miden-node-proto-build", "miden-node-store", "miden-node-utils", - "miden-protocol", - "miden-standards", + "miden-protocol 0.14.0-alpha.1", + "miden-standards 0.14.0-alpha.1", "miden-tx", "reqwest", "rstest", @@ -3146,7 +3342,7 @@ dependencies = [ [[package]] name = "miden-node-store" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "assert_matches", @@ -3163,16 +3359,16 @@ dependencies = [ "libsqlite3-sys", "miden-agglayer", "miden-block-prover", - "miden-crypto", + "miden-crypto 0.22.4", "miden-large-smt-backend-rocksdb", "miden-node-db", "miden-node-proto", "miden-node-proto-build", "miden-node-test-macro", "miden-node-utils", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "miden-remote-prover-client", - "miden-standards", + "miden-standards 0.14.0-alpha.1", "pretty_assertions", "rand", "rand_chacha", @@ -3193,18 +3389,18 @@ dependencies = [ [[package]] name = "miden-node-stress-test" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "clap", "fs-err", "futures", - "miden-air", + "miden-air 0.21.2", "miden-node-block-producer", "miden-node-proto", "miden-node-store", "miden-node-utils", - "miden-protocol", - "miden-standards", + "miden-protocol 0.14.0-alpha.1", + "miden-standards 0.14.0-alpha.1", "rand", "rayon", "tokio", @@ -3222,7 +3418,7 @@ dependencies = [ [[package]] name = "miden-node-utils" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "bytes", @@ -3233,7 +3429,7 @@ dependencies = [ "humantime", "itertools 0.14.0", "lru", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "opentelemetry", "opentelemetry-otlp", "opentelemetry_sdk", @@ -3253,7 +3449,7 @@ dependencies = [ [[package]] name = "miden-node-validator" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "aws-config", @@ -3265,7 +3461,7 @@ dependencies = [ "miden-node-proto", "miden-node-proto-build", "miden-node-utils", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "miden-tx", "thiserror 2.0.18", "tokio", @@ -3283,11 +3479,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e09f7916b1e7505f74a50985a185fdea4c0ceb8f854a34c90db28e3f7da7ab6" dependencies = [ "itertools 0.14.0", - "miden-air", - "miden-core", - "miden-debug-types", - "miden-utils-diagnostics", - "miden-utils-indexing", + "miden-air 0.20.6", + "miden-core 0.20.6", + "miden-debug-types 0.20.6", + "miden-utils-diagnostics 0.20.6", + "miden-utils-indexing 0.20.6", "paste", "rayon", "thiserror 2.0.18", @@ -3296,25 +3492,43 @@ dependencies = [ "winter-prover", ] +[[package]] +name = "miden-processor" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c83cc2f87364c88f6b7d7acb0c7908b63064ed94e0b2b68a0f5990f74a42c5" +dependencies = [ + "itertools 0.14.0", + "miden-air 0.21.2", + "miden-core 0.21.2", + "miden-debug-types 0.21.2", + "miden-utils-diagnostics 0.21.2", + "miden-utils-indexing 0.21.2", + "paste", + "rayon", + "thiserror 2.0.18", + "tokio", + "tracing", +] + [[package]] name = "miden-protocol" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a88effeac994eb55b8dc4f93fbfd71a5d916dfaba1099896e27a0ee42c488c1" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" dependencies = [ "bech32", "fs-err", "getrandom 0.3.4", - "miden-assembly", - "miden-assembly-syntax", - "miden-core", - "miden-core-lib", - "miden-crypto", - "miden-mast-package", - "miden-processor", - "miden-protocol-macros", - "miden-utils-sync", - "miden-verifier", + "miden-assembly 0.21.2", + "miden-assembly-syntax 0.21.2", + "miden-core 0.21.2", + "miden-core-lib 0.21.2", + "miden-crypto 0.22.4", + "miden-mast-package 0.21.2", + "miden-processor 0.21.2", + "miden-protocol-macros 0.14.0-alpha.1", + "miden-utils-sync 0.21.2", + "miden-verifier 0.21.2", "rand", "rand_chacha", "rand_xoshiro", @@ -3322,7 +3536,34 @@ dependencies = [ "semver 1.0.27", "serde", "thiserror 2.0.18", - "toml 0.9.11+spec-1.1.0", + "toml 1.0.3+spec-1.1.0", + "walkdir", +] + +[[package]] +name = "miden-protocol" +version = "0.14.0-alpha.2" +source = "git+https://github.com/0xMiden/protocol?branch=agglayer#ecb6359a6b60680c6737b3a7236f48bb681a21b6" +dependencies = [ + "bech32", + "fs-err", + "getrandom 0.3.4", + "miden-assembly 0.20.6", + "miden-assembly-syntax 0.20.6", + "miden-core 0.20.6", + "miden-core-lib 0.20.6", + "miden-crypto 0.19.8", + "miden-mast-package 0.20.6", + "miden-processor 0.20.6", + "miden-protocol-macros 0.14.0-alpha.2", + "miden-utils-sync 0.20.6", + "miden-verifier 0.20.6", + "rand", + "rand_chacha", + "rand_xoshiro", + "regex", + "semver 1.0.27", + "thiserror 2.0.18", "walkdir", "winter-rand-utils", ] @@ -3330,8 +3571,17 @@ dependencies = [ [[package]] name = "miden-protocol-macros" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb28b730005e5f8b08d615ea9216f8cab77b3a7439fa54d5e39d2ec43ef53a3" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "miden-protocol-macros" +version = "0.14.0-alpha.2" +source = "git+https://github.com/0xMiden/protocol?branch=agglayer#ecb6359a6b60680c6737b3a7236f48bb681a21b6" dependencies = [ "proc-macro2", "quote", @@ -3340,21 +3590,24 @@ dependencies = [ [[package]] name = "miden-prover" -version = "0.20.6" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d45e30526be72b8af0fd1d8b24c9cba8ac1187ca335dcee38b8e5e20234e7698" +checksum = "d0fe4c03cc2a5c0404596f10c076e8e265d87fb7a9c5fbe21b15bc12874f7855" dependencies = [ - "miden-air", - "miden-debug-types", - "miden-processor", + "bincode", + "miden-air 0.21.2", + "miden-core 0.21.2", + "miden-crypto 0.22.4", + "miden-debug-types 0.21.2", + "miden-processor 0.21.2", + "serde", + "tokio", "tracing", - "winter-maybe-async", - "winter-prover", ] [[package]] name = "miden-remote-prover" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "anyhow", "assert_matches", @@ -3368,8 +3621,8 @@ dependencies = [ "miden-node-proto", "miden-node-proto-build", "miden-node-utils", - "miden-protocol", - "miden-standards", + "miden-protocol 0.14.0-alpha.1", + "miden-standards 0.14.0-alpha.1", "miden-testing", "miden-tx", "miden-tx-batch-prover", @@ -3391,13 +3644,13 @@ dependencies = [ [[package]] name = "miden-remote-prover-client" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" dependencies = [ "build-rs", "fs-err", "getrandom 0.4.1", "miden-node-proto-build", - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "miden-tx", "miette", "prost", @@ -3410,69 +3663,89 @@ dependencies = [ "tonic-web-wasm-client", ] +[[package]] +name = "miden-serde-utils" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe74c2e7d8a8b8758e067de10665816928222c1d0561d95c12ac4bcaefc2a2a" +dependencies = [ + "p3-field", + "p3-goldilocks", +] + [[package]] name = "miden-standards" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cef036bbfec29acba92751a13d05844bbcf080140201097b419c9ad1927e367" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" dependencies = [ "fs-err", - "miden-assembly", - "miden-core", - "miden-core-lib", - "miden-processor", - "miden-protocol", + "miden-assembly 0.21.2", + "miden-core 0.21.2", + "miden-core-lib 0.21.2", + "miden-processor 0.21.2", + "miden-protocol 0.14.0-alpha.1", "rand", "regex", "thiserror 2.0.18", "walkdir", ] +[[package]] +name = "miden-standards" +version = "0.14.0-alpha.2" +source = "git+https://github.com/0xMiden/protocol?branch=agglayer#ecb6359a6b60680c6737b3a7236f48bb681a21b6" +dependencies = [ + "fs-err", + "miden-assembly 0.20.6", + "miden-core 0.20.6", + "miden-core-lib 0.20.6", + "miden-processor 0.20.6", + "miden-protocol 0.14.0-alpha.2", + "regex", + "thiserror 2.0.18", + "walkdir", +] + [[package]] name = "miden-testing" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e980777d0f7e6069942b14d4e7cb3d4d137b323ddfa15722a3bd21e9d13fdd2e" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" dependencies = [ "anyhow", "itertools 0.14.0", - "miden-agglayer", - "miden-assembly", + "miden-assembly 0.21.2", "miden-block-prover", - "miden-core-lib", - "miden-crypto", - "miden-processor", - "miden-protocol", - "miden-standards", + "miden-core-lib 0.21.2", + "miden-crypto 0.22.4", + "miden-processor 0.21.2", + "miden-protocol 0.14.0-alpha.1", + "miden-standards 0.14.0-alpha.1", "miden-tx", "miden-tx-batch-prover", "rand", "rand_chacha", "thiserror 2.0.18", - "winterfell", ] [[package]] name = "miden-tx" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67e0df9adcf29c9111df65acf408ae05952b8bc6569f571963676f97668d83f" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" dependencies = [ - "miden-processor", - "miden-protocol", + "miden-processor 0.21.2", + "miden-protocol 0.14.0-alpha.1", "miden-prover", - "miden-standards", - "miden-verifier", + "miden-standards 0.14.0-alpha.1", + "miden-verifier 0.21.2", "thiserror 2.0.18", ] [[package]] name = "miden-tx-batch-prover" version = "0.14.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba29f8f6ecae671eff8b52b4c19eca8db5964c0b45b5d68c3ce38a57a8367931" +source = "git+https://github.com/0xMiden/protocol?branch=next#af46e09e01faac65e0ec31ac8c48d5175733a1d8" dependencies = [ - "miden-protocol", + "miden-protocol 0.14.0-alpha.1", "miden-tx", ] @@ -3487,14 +3760,38 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "miden-utils-core-derive" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad5c364abe484d43d171afc320e7560db37ece00fe625569068c1053ed186540" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "miden-utils-diagnostics" version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52658f6dc091c1c78e8b35ee3e7ff3dad53051971a3c514e461f581333758fe7" dependencies = [ - "miden-crypto", - "miden-debug-types", + "miden-crypto 0.19.8", + "miden-debug-types 0.20.6", + "miden-miette", + "paste", + "tracing", +] + +[[package]] +name = "miden-utils-diagnostics" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d8eafd735ab1e0db7bf6a6a8b5bcf4c31a56c0cd7f80cba1932d4bb984b12" +dependencies = [ + "miden-crypto 0.22.4", + "miden-debug-types 0.21.2", "miden-miette", "paste", "tracing", @@ -3509,6 +3806,16 @@ dependencies = [ "thiserror 2.0.18", ] +[[package]] +name = "miden-utils-indexing" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc42cfa3aef68d21238b3ce4c2db00a1278f8075ef492c23c035ab6c75774790" +dependencies = [ + "miden-crypto 0.22.4", + "thiserror 2.0.18", +] + [[package]] name = "miden-utils-sync" version = "0.20.6" @@ -3520,19 +3827,45 @@ dependencies = [ "parking_lot", ] +[[package]] +name = "miden-utils-sync" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e09bb239449e63e9a81f9b4ca5db1762327f44fb50777527fdba6fdbcab890" +dependencies = [ + "lock_api", + "loom", + "once_cell", + "parking_lot", +] + [[package]] name = "miden-verifier" version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b13816663794beb15c8a4721c15252eb21f3b3233525684f60c7888837a98ff4" dependencies = [ - "miden-air", - "miden-core", + "miden-air 0.20.6", + "miden-core 0.20.6", "thiserror 2.0.18", "tracing", "winter-verifier", ] +[[package]] +name = "miden-verifier" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb4d3120e2c9cce41b5dac7507cd86154951938b9effbc322c57983065bfa4a" +dependencies = [ + "bincode", + "miden-air 0.21.2", + "miden-core 0.21.2", + "miden-crypto 0.22.4", + "thiserror 2.0.18", + "tracing", +] + [[package]] name = "midenc-hir-type" version = "0.4.3" @@ -3891,6 +4224,338 @@ version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" +[[package]] +name = "p3-air" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0141a56ed9924ce0265e7e91cd29bbcd230262744b7a7f0c448bfbf212f73182" +dependencies = [ + "p3-field", + "p3-matrix", +] + +[[package]] +name = "p3-blake3" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006330bae15fdda0d460e73e03e7ebf06e8848dfda8355f9d568a7fed7c37719" +dependencies = [ + "blake3", + "p3-symmetric", + "p3-util", +] + +[[package]] +name = "p3-challenger" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20e42ba74a49c08c6e99f74cd9b343bfa31aa5721fea55079b18e3fd65f1dcbc" +dependencies = [ + "p3-field", + "p3-maybe-rayon", + "p3-monty-31", + "p3-symmetric", + "p3-util", + "tracing", +] + +[[package]] +name = "p3-commit" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498211e7b9a0f8366b410b4a9283ae82ff2fc91f473b1c5816aa6e90e74b125d" +dependencies = [ + "itertools 0.14.0", + "p3-challenger", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-util", + "serde", +] + +[[package]] +name = "p3-dft" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63fa5eb1bd12a240089e72ae3fe10350944d9c166d00a3bfd2a1794db65cf5c" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "spin 0.10.0", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ebfdb6ef992ae64e9e8f449ac46516ffa584f11afbdf9ee244288c2a633cdf4" +dependencies = [ + "itertools 0.14.0", + "num-bigint", + "p3-maybe-rayon", + "p3-util", + "paste", + "rand", + "serde", + "tracing", +] + +[[package]] +name = "p3-goldilocks" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64716244b5612622d4e78a4f48b74f6d3bb7b4085b7b6b25364b1dfca7198c66" +dependencies = [ + "num-bigint", + "p3-challenger", + "p3-dft", + "p3-field", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "paste", + "rand", + "serde", +] + +[[package]] +name = "p3-interpolation" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d877565a94a527c89459fc8ccb0eb58769d8c86456575d1315a1651bd24616d" +dependencies = [ + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", +] + +[[package]] +name = "p3-keccak" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57334537d10316e0f1cda622f0a5b3239f219a5dcd2a95ea87e41e00df6a92" +dependencies = [ + "p3-field", + "p3-symmetric", + "p3-util", + "tiny-keccak", +] + +[[package]] +name = "p3-matrix" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5542f96504dae8100c91398fb1e3f5ec669eb9c73d9e0b018a93b5fe32bad230" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand", + "serde", + "tracing", + "transpose", +] + +[[package]] +name = "p3-maybe-rayon" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e5669ca75645f99cd001e9d0289a4eeff2bc2cd9dc3c6c3aaf22643966e83df" +dependencies = [ + "rayon", +] + +[[package]] +name = "p3-mds" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038763af23df9da653065867fd85b38626079031576c86fd537097e5be6a0da0" +dependencies = [ + "p3-dft", + "p3-field", + "p3-symmetric", + "p3-util", + "rand", +] + +[[package]] +name = "p3-merkle-tree" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d93625a3041effddc72ee2511c919f710b7f91fd0f9931ab8a70aeba586fd6e" +dependencies = [ + "itertools 0.14.0", + "p3-commit", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "p3-miden-air" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a88e6ee9c92ff6c0b64f1ec0d61eda72fb432bda45337d876c46bd43748508" +dependencies = [ + "p3-air", + "p3-field", + "p3-matrix", +] + +[[package]] +name = "p3-miden-fri" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e282998bc1d12dceaa0ed8979fa507b8369d663fa377da695d578f5f3a035935" +dependencies = [ + "itertools 0.14.0", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-interpolation", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "rand", + "serde", + "tracing", +] + +[[package]] +name = "p3-miden-prover" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05a61c10cc2d6a73e192ac34a9884e4f26bd877f3eaea441d7b7ebfdffdf6c7" +dependencies = [ + "itertools 0.14.0", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-interpolation", + "p3-matrix", + "p3-maybe-rayon", + "p3-miden-air", + "p3-miden-uni-stark", + "p3-util", + "serde", + "tracing", +] + +[[package]] +name = "p3-miden-uni-stark" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a78b6a5b5f6bdc55439d343d2a0a2a8e7cb6544b03296f54d2214a84e91e130" +dependencies = [ + "itertools 0.14.0", + "p3-air", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-uni-stark", + "p3-util", + "serde", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "p3-monty-31" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a981d60da3d8cbf8561014e2c186068578405fd69098fa75b43d4afb364a47" +dependencies = [ + "itertools 0.14.0", + "num-bigint", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "paste", + "rand", + "serde", + "spin 0.10.0", + "tracing", + "transpose", +] + +[[package]] +name = "p3-poseidon2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903b73e4f9a7781a18561c74dc169cf03333497b57a8dd02aaeb130c0f386599" +dependencies = [ + "p3-field", + "p3-mds", + "p3-symmetric", + "p3-util", + "rand", +] + +[[package]] +name = "p3-symmetric" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd788f04e86dd5c35dd87cad29eefdb6371d2fd5f7664451382eeacae3c3ed0" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "serde", +] + +[[package]] +name = "p3-uni-stark" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d409704a8cbdb6c77f6b83a05c6b16a3c8a2c00d880146fa34181977a0d3ac" +dependencies = [ + "itertools 0.14.0", + "p3-air", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "serde", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "p3-util" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "663b16021930bc600ecada915c6c3965730a3b9d6a6c23434ccf70bfc29d6881" +dependencies = [ + "rayon", + "serde", +] + [[package]] name = "page_size" version = "0.6.0" @@ -5134,6 +5799,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" @@ -5177,6 +5851,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" @@ -5448,6 +6128,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" @@ -5943,6 +6632,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" @@ -6785,9 +7484,6 @@ 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" diff --git a/Cargo.toml b/Cargo.toml index c263e4fdd3..229eb18343 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ license = "MIT" readme = "README.md" repository = "https://github.com/0xMiden/node" rust-version = "1.91" -version = "0.14.0-alpha.1" +version = "0.14.0-alpha.2" # Optimize the cryptography for faster tests involving account creation. [profile.test.package.miden-crypto] @@ -46,35 +46,35 @@ debug = true [workspace.dependencies] # Workspace crates. -miden-large-smt-backend-rocksdb = { path = "crates/large-smt-backend-rocksdb", version = "=0.14.0-alpha.1" } -miden-node-block-producer = { path = "crates/block-producer", version = "=0.14.0-alpha.1" } -miden-node-db = { path = "crates/db", version = "=0.14.0-alpha.1" } -miden-node-grpc-error-macro = { path = "crates/grpc-error-macro", version = "=0.14.0-alpha.1" } -miden-node-ntx-builder = { path = "crates/ntx-builder", version = "=0.14.0-alpha.1" } -miden-node-proto = { path = "crates/proto", version = "=0.14.0-alpha.1" } -miden-node-proto-build = { path = "proto", version = "=0.14.0-alpha.1" } -miden-node-rpc = { path = "crates/rpc", version = "=0.14.0-alpha.1" } -miden-node-store = { path = "crates/store", version = "=0.14.0-alpha.1" } +miden-large-smt-backend-rocksdb = { path = "crates/large-smt-backend-rocksdb", version = "=0.14.0-alpha.2" } +miden-node-block-producer = { path = "crates/block-producer", version = "=0.14.0-alpha.2" } +miden-node-db = { path = "crates/db", version = "=0.14.0-alpha.2" } +miden-node-grpc-error-macro = { path = "crates/grpc-error-macro", version = "=0.14.0-alpha.2" } +miden-node-ntx-builder = { path = "crates/ntx-builder", version = "=0.14.0-alpha.2" } +miden-node-proto = { path = "crates/proto", version = "=0.14.0-alpha.2" } +miden-node-proto-build = { path = "proto", version = "=0.14.0-alpha.2" } +miden-node-rpc = { path = "crates/rpc", version = "=0.14.0-alpha.2" } +miden-node-store = { path = "crates/store", version = "=0.14.0-alpha.2" } miden-node-test-macro = { path = "crates/test-macro" } -miden-node-utils = { path = "crates/utils", version = "=0.14.0-alpha.1" } -miden-node-validator = { path = "crates/validator", version = "=0.14.0-alpha.1" } -miden-remote-prover-client = { path = "crates/remote-prover-client", version = "=0.14.0-alpha.1" } +miden-node-utils = { path = "crates/utils", version = "=0.14.0-alpha.2" } +miden-node-validator = { path = "crates/validator", version = "=0.14.0-alpha.2" } +miden-remote-prover-client = { path = "crates/remote-prover-client", version = "=0.14.0-alpha.2" } # 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.1" } +miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "=0.14.0-alpha.2" } -# miden-base aka protocol dependencies. These should be updated in sync. -miden-block-prover = { version = "=0.14.0-alpha.1" } -miden-protocol = { default-features = false, version = "=0.14.0-alpha.1" } -miden-standards = { version = "=0.14.0-alpha.1" } -miden-testing = { version = "=0.14.0-alpha.1" } -miden-tx = { default-features = false, version = "=0.14.0-alpha.1" } -miden-tx-batch-prover = { version = "=0.14.0-alpha.1" } +# miden protocol dependencies. These should be updated in sync. +miden-block-prover = { git = "https://github.com/0xMiden/protocol", branch = "next" } +miden-protocol = { default-features = false, git = "https://github.com/0xMiden/protocol", branch = "next" } +miden-standards = { git = "https://github.com/0xMiden/protocol", branch = "next" } +miden-testing = { git = "https://github.com/0xMiden/protocol", branch = "next" } +miden-tx = { default-features = false, git = "https://github.com/0xMiden/protocol", branch = "next" } +miden-tx-batch-prover = { git = "https://github.com/0xMiden/protocol", branch = "next" } # Other miden dependencies. These should align with those expected by miden-base. -miden-air = { features = ["std", "testing"], version = "0.20" } +miden-air = { features = ["std", "testing"], version = "0.21" } -miden-crypto = { version = "0.19.7" } +miden-crypto = { version = "0.22" } # External dependencies anyhow = { version = "1.0" } diff --git a/bin/network-monitor/src/counter.rs b/bin/network-monitor/src/counter.rs index dd004ff0d0..918bbb9850 100644 --- a/bin/network-monitor/src/counter.rs +++ b/bin/network-monitor/src/counter.rs @@ -28,7 +28,7 @@ use miden_protocol::note::{ NoteType, }; use miden_protocol::transaction::{InputNotes, PartialBlockchain, TransactionArgs}; -use miden_protocol::utils::Deserializable; +use miden_protocol::utils::serde::Deserializable; use miden_protocol::{Felt, Word}; use miden_standards::account::interface::{AccountInterface, AccountInterfaceExt}; use miden_standards::code_builder::CodeBuilder; @@ -130,7 +130,7 @@ 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().last().expect("Word has 4 elements").as_canonical_u64(); Ok(Some(value)) } @@ -321,7 +321,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 +821,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); diff --git a/bin/network-monitor/src/deploy/wallet.rs b/bin/network-monitor/src/deploy/wallet.rs index ba074a60f8..31a928c924 100644 --- a/bin/network-monitor/src/deploy/wallet.rs +++ b/bin/network-monitor/src/deploy/wallet.rs @@ -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..68e0954533 100644 --- a/bin/network-monitor/src/remote_prover.rs +++ b/bin/network-monitor/src/remote_prover.rs @@ -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 4f20d812bf..eba5343a3a 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; 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 9d3951cf0c..5b49ecaf6f 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/validator.rs b/bin/node/src/commands/validator.rs index 5659e55fb0..0917041a1c 100644 --- a/bin/node/src/commands/validator.rs +++ b/bin/node/src/commands/validator.rs @@ -6,7 +6,7 @@ use miden_node_utils::clap::GrpcOptionsInternal; 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 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..c8f4207e83 100644 --- a/bin/remote-prover/src/server/prover.rs +++ b/bin/remote-prover/src/server/prover.rs @@ -74,7 +74,7 @@ trait ProveRequest { #[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,7 +83,7 @@ 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() } } diff --git a/bin/remote-prover/src/server/tests.rs b/bin/remote-prover/src/server/tests.rs index f1d526b16d..0136740826 100644 --- a/bin/remote-prover/src/server/tests.rs +++ b/bin/remote-prover/src/server/tests.rs @@ -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 = diff --git a/bin/stress-test/src/seeding/mod.rs b/bin/stress-test/src/seeding/mod.rs index 6621bf227d..9a9fbcbb28 100644 --- a/bin/stress-test/src/seeding/mod.rs +++ b/bin/stress-test/src/seeding/mod.rs @@ -46,7 +46,7 @@ use miden_protocol::transaction::{ ProvenTransactionBuilder, TransactionHeader, }; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use miden_protocol::{Felt, ONE, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::account::faucets::BasicFungibleFaucet; @@ -327,7 +327,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() @@ -347,7 +347,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() diff --git a/bin/stress-test/src/store/mod.rs b/bin/stress-test/src/store/mod.rs index 314a5e95d0..ce5bf89452 100644 --- a/bin/stress-test/src/store/mod.rs +++ b/bin/stress-test/src/store/mod.rs @@ -8,7 +8,7 @@ use miden_node_store::state::State; 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/src/store/mod.rs b/crates/block-producer/src/store/mod.rs index fb20bc160e..6b010df7e9 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; 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/src/helpers.rs b/crates/large-smt-backend-rocksdb/src/helpers.rs index 23f3c8d88f..670519499f 100644 --- a/crates/large-smt-backend-rocksdb/src/helpers.rs +++ b/crates/large-smt-backend-rocksdb/src/helpers.rs @@ -2,7 +2,7 @@ use miden_crypto::merkle::smt::{MAX_LEAF_ENTRIES, SmtLeaf, SmtLeafError}; use miden_crypto::word::LexicographicWord; use rocksdb::Error as RocksDbError; -use crate::{StorageError, Word}; +use crate::Word; pub(crate) fn map_rocksdb_err(err: RocksDbError) -> StorageError { StorageError::Backend(Box::new(err)) diff --git a/crates/large-smt-backend-rocksdb/src/lib.rs b/crates/large-smt-backend-rocksdb/src/lib.rs index 563439c9f4..3d65c582df 100644 --- a/crates/large-smt-backend-rocksdb/src/lib.rs +++ b/crates/large-smt-backend-rocksdb/src/lib.rs @@ -39,13 +39,15 @@ pub use miden_protocol::crypto::merkle::smt::{ SmtLeafError, SmtProof, SmtStorage, - StorageError, StorageUpdateParts, StorageUpdates, Subtree, SubtreeError, - SubtreeUpdate, }; + +// Re-export from miden-crypto +pub use miden_crypto::merkle::smt::{StorageError, SubtreeUpdate}; + // Also re-export commonly used types for convenience pub use miden_protocol::{ EMPTY_WORD, diff --git a/crates/large-smt-backend-rocksdb/src/rocksdb.rs b/crates/large-smt-backend-rocksdb/src/rocksdb.rs index 92f187c4d9..cb13bcc78a 100644 --- a/crates/large-smt-backend-rocksdb/src/rocksdb.rs +++ b/crates/large-smt-backend-rocksdb/src/rocksdb.rs @@ -20,7 +20,7 @@ use rocksdb::{ ReadOptions, WriteBatch, }; -use winter_utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use super::{SmtStorage, StorageError, StorageUpdateParts, StorageUpdates, SubtreeUpdate}; use crate::helpers::{insert_into_leaf, map_rocksdb_err, remove_from_leaf}; diff --git a/crates/ntx-builder/src/db/models/queries/tests.rs b/crates/ntx-builder/src/db/models/queries/tests.rs index 83c62426b7..b369898279 100644 --- a/crates/ntx-builder/src/db/models/queries/tests.rs +++ b/crates/ntx-builder/src/db/models/queries/tests.rs @@ -566,7 +566,7 @@ fn mock_account(_account_id: NetworkAccountId) -> miden_protocol::account::Accou .with_component(component) .with_auth_component(AuthSingleSig::new( PublicKeyCommitment::from(Word::default()), - AuthScheme::Falcon512Rpo, + AuthScheme::Falcon512Poseidon2, )) .build_existing() .unwrap() diff --git a/crates/proto/src/domain/account.rs b/crates/proto/src/domain/account.rs index aeec888328..3f627565d3 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(), } } } @@ -375,11 +375,18 @@ impl TryFrom for AccountVaultDetails { } 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 key = asset + .key + .ok_or(proto::primitives::Asset::missing_field(stringify!(key)))?; + let asset_key = Word::try_from(key)?; + + let value = asset + .value + .ok_or(proto::primitives::Asset::missing_field(stringify!(value)))?; + + let asset_value = Word::try_from(value)?; + + Asset::from_key_value_words(asset_key, asset_value).map_err(ConversionError::AssetError) }))?; Ok(Self::Assets(parsed_assets)) } @@ -396,7 +403,8 @@ 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))), + key: Some(proto::primitives::Digest::from(asset.to_key_word())), + value: Some(proto::primitives::Digest::from(asset.to_value_word())), })), }, } 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..015ad650e4 100644 --- a/crates/proto/src/domain/digest.rs +++ b/crates/proto/src/domain/digest.rs @@ -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(), } } } 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/note.rs b/crates/proto/src/domain/note.rs index f92ac75179..e076a1b1d8 100644 --- a/crates/proto/src/domain/note.rs +++ b/crates/proto/src/domain/note.rs @@ -12,7 +12,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; 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/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..dd9d4cab5b 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,7 @@ impl RemoteBatchProver { &self, proposed_batch: ProposedBatch, ) -> Result { - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::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..fff6bcc092 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,7 @@ impl RemoteBlockProver { block_header: &BlockHeader, block_inputs: BlockInputs, ) -> Result { - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::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..360798b09f 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,7 @@ impl RemoteTransactionProver { tx_inputs: &TransactionInputs, ) -> impl FutureMaybeSend> { async move { - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::Serializable; self.connect().await.map_err(|err| { TransactionProverError::other_with_source( "failed to connect to the remote prover", diff --git a/crates/rpc/src/tests.rs b/crates/rpc/src/tests.rs index 4e2b4a5074..6e7c9f9543 100644 --- a/crates/rpc/src/tests.rs +++ b/crates/rpc/src/tests.rs @@ -31,7 +31,7 @@ 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::utils::serde::Serializable; use miden_protocol::vm::ExecutionProof; use miden_standards::account::wallets::BasicWallet; use tempfile::TempDir; diff --git a/crates/store/Cargo.toml b/crates/store/Cargo.toml index f22555e10a..459e37e6b3 100644 --- a/crates/store/Cargo.toml +++ b/crates/store/Cargo.toml @@ -53,7 +53,7 @@ url = { workspace = true } [build-dependencies] build-rs = { workspace = true } fs-err = { workspace = true } -miden-agglayer = { features = ["testing"], version = "=0.14.0-alpha.1" } +miden-agglayer = { features = ["testing"], git = "https://github.com/0xMiden/protocol", branch = "agglayer" } miden-protocol = { features = ["std"], workspace = true } miden-standards = { workspace = true } diff --git a/crates/store/build.rs b/crates/store/build.rs index 5cc15e4db0..cc756080e5 100644 --- a/crates/store/build.rs +++ b/crates/store/build.rs @@ -11,7 +11,7 @@ use miden_agglayer::{ }; 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::dsa::falcon512_poseidon2::SecretKey; use miden_protocol::crypto::rand::RpoRandomCoin; use miden_protocol::{Felt, Word}; use miden_standards::AuthMethod; @@ -59,7 +59,7 @@ fn generate_agglayer_sample_accounts() { 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 +69,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, 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 c402842975..04d6035b87 100644 --- a/crates/store/src/db/mod.rs +++ b/crates/store/src/db/mod.rs @@ -23,7 +23,7 @@ use miden_protocol::note::{ Nullifier, }; use miden_protocol::transaction::TransactionId; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use tokio::sync::oneshot; use tracing::{info, instrument}; 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 514bad31f3..020f8385ac 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; @@ -297,7 +297,7 @@ pub(crate) fn select_account_commitments_paged( page_size: NonZeroUsize, after_account_id: Option, ) -> Result { - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::Serializable; // Fetch one extra to determine if there are more results #[expect(clippy::cast_possible_wrap)] @@ -373,7 +373,7 @@ pub(crate) fn select_public_account_ids_paged( page_size: NonZeroUsize, after_account_id: Option, ) -> Result { - use miden_protocol::utils::Serializable; + use miden_protocol::utils::serde::Serializable; #[expect(clippy::cast_possible_wrap)] let limit = (page_size.get() + 1) as i64; @@ -1153,8 +1153,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..091acfb0a9 100644 --- a/crates/store/src/db/models/queries/accounts/at_block.rs +++ b/crates/store/src/db/models/queries/accounts/at_block.rs @@ -4,7 +4,7 @@ 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::utils::serde::{Deserializable, Serializable}; use miden_protocol::{Felt, FieldElement, Word}; use crate::db::models::conv::{SqlTypeConvert, raw_sql_to_nonce}; diff --git a/crates/store/src/db/models/queries/accounts/delta.rs b/crates/store/src/db/models/queries/accounts/delta.rs index 8bab2b1220..460e3fbbd4 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; 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 7f31003259..d56676cc7a 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; @@ -153,7 +153,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 +227,7 @@ 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(); @@ -347,7 +347,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() @@ -472,7 +472,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(); @@ -646,7 +646,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 572cab258c..730b743c19 100644 --- a/crates/store/src/db/models/queries/accounts/tests.rs +++ b/crates/store/src/db/models/queries/accounts/tests.rs @@ -40,7 +40,7 @@ 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::utils::serde::{Deserializable, Serializable}; use miden_protocol::{EMPTY_WORD, Felt, FieldElement, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::code_builder::CodeBuilder; @@ -165,7 +165,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(); @@ -229,7 +229,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() @@ -485,7 +485,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(); @@ -585,7 +585,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(); @@ -655,7 +655,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(); @@ -792,7 +792,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(); 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 49bdce4198..cf42ceb58d 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 1095fc1899..ff9fb828a4 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::{NoteId, Nullifier}; use miden_protocol::transaction::{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 875b9a043a..c7eafa33df 100644 --- a/crates/store/src/db/tests.rs +++ b/crates/store/src/db/tests.rs @@ -63,7 +63,7 @@ use miden_protocol::transaction::{ TransactionHeader, TransactionId, }; -use miden_protocol::utils::{Deserializable, Serializable}; +use miden_protocol::utils::serde::{Deserializable, Serializable}; use miden_protocol::{EMPTY_WORD, Felt, FieldElement, Word}; use miden_standards::account::auth::AuthSingleSig; use miden_standards::code_builder::CodeBuilder; @@ -1328,7 +1328,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() @@ -1429,7 +1429,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() @@ -1596,7 +1596,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(); @@ -1651,7 +1651,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(); @@ -1704,7 +1704,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(); @@ -1741,7 +1741,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(); @@ -1766,7 +1766,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(); @@ -1795,7 +1795,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(); @@ -2263,7 +2263,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(); diff --git a/crates/store/src/errors.rs b/crates/store/src/errors.rs index 397c173866..238c84fb27 100644 --- a/crates/store/src/errors.rs +++ b/crates/store/src/errors.rs @@ -136,6 +136,15 @@ pub enum StateInitializationError { PublicAccountMissingDetails(AccountId), #[error("failed to convert account to delta: {0}")] AccountToDeltaConversionFailed(String), + #[error("root mismatch: expected {expected:?}, got {actual:?}")] + RootMismatch { + /// The expected root hash. + expected: Word, + /// The actual reconstructed root hash. + actual: Word, + }, + #[error("storage is not empty")] + StorageNotEmpty, } // ENDPOINT ERRORS 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..1a0250ff2a 100644 --- a/crates/store/src/genesis/config/mod.rs +++ b/crates/store/src/genesis/config/mod.rs @@ -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(); @@ -431,7 +431,8 @@ 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) @@ -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 }) }) } diff --git a/crates/store/src/genesis/config/tests.rs b/crates/store/src/genesis/config/tests.rs index ebcb61e8e8..0b1b1d47c6 100644 --- a/crates/store/src/genesis/config/tests.rs +++ b/crates/store/src/genesis/config/tests.rs @@ -99,7 +99,7 @@ fn parsing_account_from_file() -> TestResult { &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( @@ -156,7 +156,7 @@ fn parsing_native_faucet_from_file() -> TestResult { let secret_key = miden_protocol::crypto::dsa::falcon512_rpo::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))?; @@ -219,7 +219,7 @@ fn native_faucet_from_file_must_be_faucet_type() -> TestResult { &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( diff --git a/crates/store/src/inner_forest/mod.rs b/crates/store/src/inner_forest/mod.rs index 988c3a9a81..5ec1b13e83 100644 --- a/crates/store/src/inner_forest/mod.rs +++ b/crates/store/src/inner_forest/mod.rs @@ -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; diff --git a/crates/store/src/inner_forest/tests.rs b/crates/store/src/inner_forest/tests.rs index ce30745385..a1467b2fc1 100644 --- a/crates/store/src/inner_forest/tests.rs +++ b/crates/store/src/inner_forest/tests.rs @@ -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(); 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/state/apply_block.rs b/crates/store/src/state/apply_block.rs index 7949fcbeb6..f6aab1fff5 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}; diff --git a/crates/store/src/state/loader.rs b/crates/store/src/state/loader.rs index af678899e2..64c42d12ee 100644 --- a/crates/store/src/state/loader.rs +++ b/crates/store/src/state/loader.rs @@ -12,7 +12,6 @@ use std::future::Future; use std::num::NonZeroUsize; use std::path::Path; -use miden_crypto::merkle::mmr::Mmr; #[cfg(feature = "rocksdb")] use miden_large_smt_backend_rocksdb::{RocksDbConfig, RocksDbStorage}; use miden_protocol::block::account_tree::{AccountTree, account_id_to_smt_key}; @@ -75,6 +74,10 @@ pub fn account_tree_large_smt_error_to_init_error(e: LargeSmtError) -> StateInit LargeSmtError::Storage(err) => { StateInitializationError::AccountTreeIoError(err.as_report()) }, + LargeSmtError::RootMismatch { expected, actual } => { + StateInitializationError::RootMismatch { expected, actual } + }, + LargeSmtError::StorageNotEmpty => StateInitializationError::StorageNotEmpty, } } diff --git a/crates/validator/src/db/mod.rs b/crates/validator/src/db/mod.rs index 4c8fe665be..70fa432b3b 100644 --- a/crates/validator/src/db/mod.rs +++ b/crates/validator/src/db/mod.rs @@ -9,7 +9,7 @@ use diesel::dsl::exists; use diesel::prelude::*; use miden_node_db::{DatabaseError, Db}; use miden_protocol::transaction::TransactionId; -use miden_protocol::utils::Serializable; +use miden_protocol::utils::serde::Serializable; use tracing::instrument; use crate::COMPONENT; diff --git a/proto/proto/types/primitives.proto b/proto/proto/types/primitives.proto index 3c8d279b02..d5cb81dcd9 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 key. + primitives.Digest key = 1; + // Asset value. + primitives.Digest value = 2; } // SMT (Sparse Merkle Tree)