diff --git a/.cargo/config.toml b/.cargo/config.toml index 2a89ed7e0..8f0af7cdc 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -63,3 +63,10 @@ # openvm-keccak256 = { git = "ssh://git@github.com/openvm-org/openvm.git", branch = "main" } # openvm-sha2 = { git = "ssh://git@github.com/openvm-org/openvm.git", branch = "main" } # openvm-pairing = { git = "ssh://git@github.com/openvm-org/openvm.git", branch = "main" } + +[patch."https://github.com/powdr-labs/powdr.git"] +powdr-openvm = { path = "../openvm" } +powdr-riscv-elf = { path = "../riscv-elf" } +powdr-number = { path = "../number" } +powdr-autoprecompiles = { path = "../autoprecompiles" } +powdr-openvm-hints-circuit = { path = "../openvm/extensions/hints-circuit" } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 663c3ef5a..2793b3ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ elf **/rpc-cache +# APC compilation output +**/apc-cache + # Metrics metrics.json diff --git a/Cargo.lock b/Cargo.lock index c8000bf5b..e3bfb6126 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -856,24 +856,52 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" dependencies = [ - "ark-ec", + "ark-ec 0.5.0", "ark-ff 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", ] +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + [[package]] name = "ark-bn254" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ - "ark-ec", + "ark-ec 0.5.0", "ark-ff 0.5.0", "ark-r1cs-std", "ark-std 0.5.0", ] +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + [[package]] name = "ark-ec" version = "0.5.0" @@ -882,7 +910,7 @@ checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ "ahash", "ark-ff 0.5.0", - "ark-poly", + "ark-poly 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", "educe", @@ -1021,6 +1049,19 @@ dependencies = [ "syn 2.0.102", ] +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + [[package]] name = "ark-poly" version = "0.5.0" @@ -1042,7 +1083,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" dependencies = [ - "ark-ec", + "ark-ec 0.5.0", "ark-ff 0.5.0", "ark-relations", "ark-std 0.5.0", @@ -1081,6 +1122,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ + "ark-serialize-derive 0.4.2", "ark-std 0.4.0", "digest 0.10.7", "num-bigint 0.4.6", @@ -1092,13 +1134,24 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ - "ark-serialize-derive", + "ark-serialize-derive 0.5.0", "ark-std 0.5.0", "arrayvec", "digest 0.10.7", "num-bigint 0.4.6", ] +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-serialize-derive" version = "0.5.0" @@ -1216,6 +1269,18 @@ dependencies = [ "num", ] +[[package]] +name = "auto_enums" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c170965892137a3a9aeb000b4524aa3cc022a310e709d848b6e1cdce4ab4781" +dependencies = [ + "derive_utils", + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "auto_impl" version = "1.3.0" @@ -1689,7 +1754,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half", + "half 2.6.0", ] [[package]] @@ -1976,6 +2041,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "crypto-bigint" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96272c2ff28b807e09250b180ad1fb7889a3258f7455759b5c3c58b719467130" +dependencies = [ + "num-traits", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1986,6 +2062,27 @@ dependencies = [ "typenum", ] +[[package]] +name = "csv" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +dependencies = [ + "memchr", +] + [[package]] name = "ctor" version = "0.5.0" @@ -2190,6 +2287,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "derive_utils" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "dhat" version = "0.3.3" @@ -2368,7 +2476,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", - "crypto-bigint", + "crypto-bigint 0.5.5", "digest 0.10.7", "ff 0.13.1", "generic-array", @@ -2600,6 +2708,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "2.3.0" @@ -2949,6 +3063,11 @@ name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +dependencies = [ + "fallible-iterator", + "indexmap 2.9.0", + "stable_deref_trait", +] [[package]] name = "glam" @@ -2975,6 +3094,17 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "goblin" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "group" version = "0.12.1" @@ -3017,6 +3147,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + [[package]] name = "half" version = "2.6.0" @@ -3190,6 +3326,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -3463,6 +3608,19 @@ dependencies = [ "cc", ] +[[package]] +name = "ibig" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1fcc7f316b2c079dde77564a1360639c1a956a23fa96122732e416cb10717bb" +dependencies = [ + "cfg-if", + "num-traits", + "rand 0.8.5", + "serde", + "static_assertions", +] + [[package]] name = "icu_collections" version = "2.0.0" @@ -4421,9 +4579,11 @@ dependencies = [ [[package]] name = "openvm" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "bytemuck", + "getrandom 0.2.16", + "getrandom 0.3.3", "num-bigint 0.4.6", "openvm-custom-insn", "openvm-platform", @@ -4434,7 +4594,7 @@ dependencies = [ [[package]] name = "openvm-algebra-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -4460,13 +4620,14 @@ dependencies = [ "rand 0.8.5", "serde", "serde_with", + "struct-reflection", "strum 0.26.3", ] [[package]] name = "openvm-algebra-complex-macros" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-macros-common", "quote", @@ -4476,7 +4637,7 @@ dependencies = [ [[package]] name = "openvm-algebra-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "halo2curves-axiom", "num-bigint 0.4.6", @@ -4492,7 +4653,7 @@ dependencies = [ [[package]] name = "openvm-algebra-moduli-macros" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "num-bigint 0.4.6", "num-prime", @@ -4504,7 +4665,7 @@ dependencies = [ [[package]] name = "openvm-algebra-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-algebra-guest", "openvm-instructions", @@ -4518,7 +4679,7 @@ dependencies = [ [[package]] name = "openvm-benchmarks-prove" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "clap", "derive_more 1.0.0", @@ -4545,7 +4706,7 @@ dependencies = [ [[package]] name = "openvm-benchmarks-utils" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cargo_metadata", "clap", @@ -4560,7 +4721,7 @@ dependencies = [ [[package]] name = "openvm-bigint-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -4586,7 +4747,7 @@ dependencies = [ [[package]] name = "openvm-bigint-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-platform", "strum_macros 0.26.4", @@ -4595,7 +4756,7 @@ dependencies = [ [[package]] name = "openvm-bigint-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-bigint-guest", "openvm-instructions", @@ -4610,7 +4771,7 @@ dependencies = [ [[package]] name = "openvm-build" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cargo_metadata", "eyre", @@ -4622,7 +4783,7 @@ dependencies = [ [[package]] name = "openvm-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "backtrace", "cfg-if", @@ -4647,13 +4808,14 @@ dependencies = [ "openvm-poseidon2-air", "openvm-stark-backend", "openvm-stark-sdk", - "p3-baby-bear", - "p3-field", + "p3-baby-bear 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "rustc-hash 2.1.1", "serde", "serde-big-array", "static_assertions", + "struct-reflection", "thiserror 1.0.69", "tracing", ] @@ -4661,7 +4823,7 @@ dependencies = [ [[package]] name = "openvm-circuit-derive" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "itertools 0.14.0", "proc-macro2", @@ -4672,7 +4834,7 @@ dependencies = [ [[package]] name = "openvm-circuit-primitives" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "derive-new 0.6.0", "itertools 0.14.0", @@ -4684,13 +4846,14 @@ dependencies = [ "openvm-cuda-common", "openvm-stark-backend", "rand 0.8.5", + "struct-reflection", "tracing", ] [[package]] name = "openvm-circuit-primitives-derive" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "itertools 0.14.0", "quote", @@ -4727,7 +4890,7 @@ dependencies = [ [[package]] name = "openvm-continuations" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "derivative", "openvm-circuit", @@ -4742,7 +4905,7 @@ dependencies = [ [[package]] name = "openvm-cuda-backend" version = "1.2.1" -source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.1#dde6cdaf105cc57d1609fd49568c7bce0a066cc2" +source = "git+https://github.com/powdr-labs/stark-backend.git?rev=v1.2.1-powdr#a571f1cc5ff28d9b5689705885987475517cb4ff" dependencies = [ "bincode 2.0.1", "bincode_derive", @@ -4755,15 +4918,15 @@ dependencies = [ "openvm-cuda-common", "openvm-stark-backend", "openvm-stark-sdk", - "p3-baby-bear", + "p3-baby-bear 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-commit", - "p3-dft", - "p3-field", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-fri", - "p3-matrix", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-merkle-tree", - "p3-symmetric", - "p3-util", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rustc-hash 2.1.1", "serde", "serde_json", @@ -4774,7 +4937,7 @@ dependencies = [ [[package]] name = "openvm-cuda-builder" version = "1.2.1" -source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.1#dde6cdaf105cc57d1609fd49568c7bce0a066cc2" +source = "git+https://github.com/powdr-labs/stark-backend.git?rev=v1.2.1-powdr#a571f1cc5ff28d9b5689705885987475517cb4ff" dependencies = [ "cc", "glob", @@ -4783,7 +4946,7 @@ dependencies = [ [[package]] name = "openvm-cuda-common" version = "1.2.1" -source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.1#dde6cdaf105cc57d1609fd49568c7bce0a066cc2" +source = "git+https://github.com/powdr-labs/stark-backend.git?rev=v1.2.1-powdr#a571f1cc5ff28d9b5689705885987475517cb4ff" dependencies = [ "bytesize", "ctor", @@ -4797,7 +4960,7 @@ dependencies = [ [[package]] name = "openvm-custom-insn" version = "0.1.0" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "proc-macro2", "quote", @@ -4807,7 +4970,7 @@ dependencies = [ [[package]] name = "openvm-ecc-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -4839,7 +5002,7 @@ dependencies = [ [[package]] name = "openvm-ecc-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "ecdsa", "elliptic-curve", @@ -4858,7 +5021,7 @@ dependencies = [ [[package]] name = "openvm-ecc-sw-macros" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-macros-common", "quote", @@ -4868,7 +5031,7 @@ dependencies = [ [[package]] name = "openvm-ecc-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-ecc-guest", "openvm-instructions", @@ -4913,7 +5076,7 @@ dependencies = [ [[package]] name = "openvm-instructions" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "backtrace", "derive-new 0.6.0", @@ -4930,7 +5093,7 @@ dependencies = [ [[package]] name = "openvm-instructions-derive" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "quote", "syn 2.0.102", @@ -4939,7 +5102,7 @@ dependencies = [ [[package]] name = "openvm-keccak256-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -4960,6 +5123,7 @@ dependencies = [ "p3-keccak-air", "rand 0.8.5", "serde", + "struct-reflection", "strum 0.26.3", "tiny-keccak", ] @@ -4967,7 +5131,7 @@ dependencies = [ [[package]] name = "openvm-keccak256-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-platform", ] @@ -4975,7 +5139,7 @@ dependencies = [ [[package]] name = "openvm-keccak256-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-instructions", "openvm-instructions-derive", @@ -4989,7 +5153,7 @@ dependencies = [ [[package]] name = "openvm-macros-common" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "syn 2.0.102", ] @@ -4997,7 +5161,7 @@ dependencies = [ [[package]] name = "openvm-mod-circuit-builder" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cuda-runtime-sys", "itertools 0.14.0", @@ -5064,7 +5228,7 @@ dependencies = [ [[package]] name = "openvm-native-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -5085,17 +5249,18 @@ dependencies = [ "openvm-rv32im-transpiler", "openvm-stark-backend", "openvm-stark-sdk", - "p3-field", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "static_assertions", + "struct-reflection", "strum 0.26.3", ] [[package]] name = "openvm-native-compiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "backtrace", "itertools 0.14.0", @@ -5119,7 +5284,7 @@ dependencies = [ [[package]] name = "openvm-native-compiler-derive" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "quote", "syn 2.0.102", @@ -5128,7 +5293,7 @@ dependencies = [ [[package]] name = "openvm-native-recursion" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "itertools 0.14.0", @@ -5141,10 +5306,10 @@ dependencies = [ "openvm-native-compiler-derive", "openvm-stark-backend", "openvm-stark-sdk", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-fri", "p3-merkle-tree", - "p3-symmetric", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "serde_json", @@ -5156,17 +5321,17 @@ dependencies = [ [[package]] name = "openvm-native-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-instructions", "openvm-transpiler", - "p3-field", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", ] [[package]] name = "openvm-pairing-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -5197,7 +5362,7 @@ dependencies = [ [[package]] name = "openvm-pairing-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "halo2curves-axiom", "hex-literal 0.4.1", @@ -5218,7 +5383,7 @@ dependencies = [ [[package]] name = "openvm-pairing-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-instructions", "openvm-pairing-guest", @@ -5231,7 +5396,7 @@ dependencies = [ [[package]] name = "openvm-platform" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "libm", "openvm-custom-insn", @@ -5241,17 +5406,17 @@ dependencies = [ [[package]] name = "openvm-poseidon2-air" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "derivative", "lazy_static", "openvm-cuda-builder", "openvm-stark-backend", "openvm-stark-sdk", - "p3-monty-31", - "p3-poseidon2", + "p3-monty-31 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-poseidon2-air", - "p3-symmetric", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "zkhash", ] @@ -5299,6 +5464,7 @@ dependencies = [ "openvm-build", "openvm-circuit", "openvm-client-executor", + "openvm-cuda-backend", "openvm-ecc-circuit", "openvm-host-executor", "openvm-native-circuit", @@ -5309,6 +5475,11 @@ dependencies = [ "openvm-sdk", "openvm-stark-sdk", "openvm-transpiler", + "powdr-autoprecompiles", + "powdr-number", + "powdr-openvm", + "powdr-openvm-hints-circuit", + "powdr-riscv-elf", "reth-primitives", "serde", "serde_json", @@ -5364,7 +5535,7 @@ dependencies = [ [[package]] name = "openvm-rv32-adapters" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "derive-new 0.6.0", "itertools 0.14.0", @@ -5376,12 +5547,13 @@ dependencies = [ "openvm-stark-backend", "openvm-stark-sdk", "rand 0.8.5", + "struct-reflection", ] [[package]] name = "openvm-rv32im-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -5402,23 +5574,24 @@ dependencies = [ "openvm-stark-sdk", "rand 0.8.5", "serde", + "struct-reflection", "strum 0.26.3", ] [[package]] name = "openvm-rv32im-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-custom-insn", - "p3-field", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "strum_macros 0.26.4", ] [[package]] name = "openvm-rv32im-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-instructions", "openvm-instructions-derive", @@ -5434,7 +5607,7 @@ dependencies = [ [[package]] name = "openvm-sdk" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "alloy-sol-types 0.8.25", "bitcode", @@ -5493,7 +5666,7 @@ dependencies = [ [[package]] name = "openvm-sha256-air" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-circuit-primitives", "openvm-stark-backend", @@ -5504,7 +5677,7 @@ dependencies = [ [[package]] name = "openvm-sha256-circuit" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "cfg-if", "derive-new 0.6.0", @@ -5530,7 +5703,7 @@ dependencies = [ [[package]] name = "openvm-sha256-guest" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-platform", ] @@ -5538,7 +5711,7 @@ dependencies = [ [[package]] name = "openvm-sha256-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "openvm-instructions", "openvm-instructions-derive", @@ -5552,7 +5725,7 @@ dependencies = [ [[package]] name = "openvm-stark-backend" version = "1.2.1" -source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.1#dde6cdaf105cc57d1609fd49568c7bce0a066cc2" +source = "git+https://github.com/powdr-labs/stark-backend.git?rev=v1.2.1-powdr#a571f1cc5ff28d9b5689705885987475517cb4ff" dependencies = [ "bitcode", "cfg-if", @@ -5565,11 +5738,11 @@ dependencies = [ "p3-air", "p3-challenger", "p3-commit", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-uni-stark", - "p3-util", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rayon", "rustc-hash 2.1.1", "serde", @@ -5582,7 +5755,7 @@ dependencies = [ [[package]] name = "openvm-stark-sdk" version = "1.2.1" -source = "git+https://github.com/openvm-org/stark-backend.git?tag=v1.2.1#dde6cdaf105cc57d1609fd49568c7bce0a066cc2" +source = "git+https://github.com/powdr-labs/stark-backend.git?rev=v1.2.1-powdr#a571f1cc5ff28d9b5689705885987475517cb4ff" dependencies = [ "dashmap", "derivative", @@ -5593,18 +5766,18 @@ dependencies = [ "metrics-tracing-context", "metrics-util", "openvm-stark-backend", - "p3-baby-bear", + "p3-baby-bear 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-blake3", "p3-bn254-fr", - "p3-dft", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-fri", "p3-goldilocks", "p3-keccak", - "p3-koala-bear", + "p3-koala-bear 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-merkle-tree", "p3-poseidon", - "p3-poseidon2", - "p3-symmetric", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "serde_json", @@ -5619,7 +5792,7 @@ dependencies = [ [[package]] name = "openvm-transpiler" version = "1.4.1" -source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" +source = "git+https://github.com/powdr-labs/openvm.git?rev=v1.4.1-powdr#60073d7908e703ba585475a285f7a4c6eadd9853" dependencies = [ "elf", "eyre", @@ -5663,8 +5836,22 @@ name = "p3-air" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "p3-field", - "p3-matrix", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", +] + +[[package]] +name = "p3-baby-bear" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-mds 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-monty-31 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-poseidon2 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-symmetric 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "rand 0.8.5", + "serde", ] [[package]] @@ -5672,11 +5859,11 @@ name = "p3-baby-bear" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "p3-field", - "p3-mds", - "p3-monty-31", - "p3-poseidon2", - "p3-symmetric", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-mds 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-monty-31 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", ] @@ -5687,8 +5874,8 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "blake3", - "p3-symmetric", - "p3-util", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", ] [[package]] @@ -5699,9 +5886,9 @@ dependencies = [ "ff 0.13.1", "halo2curves", "num-bigint 0.4.6", - "p3-field", - "p3-poseidon2", - "p3-symmetric", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", ] @@ -5711,10 +5898,10 @@ name = "p3-challenger" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "p3-field", - "p3-maybe-rayon", - "p3-symmetric", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "tracing", ] @@ -5725,23 +5912,53 @@ source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62c dependencies = [ "itertools 0.14.0", "p3-challenger", - "p3-dft", - "p3-field", - "p3-matrix", - "p3-util", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "serde", ] +[[package]] +name = "p3-dft" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-matrix 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-util 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "tracing", +] + [[package]] name = "p3-dft" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "itertools 0.14.0", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "nums", + "p3-maybe-rayon 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-util 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "rand 0.8.5", + "serde", "tracing", ] @@ -5755,8 +5972,8 @@ dependencies = [ "num-integer", "num-traits", "nums", - "p3-maybe-rayon", - "p3-util", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "tracing", @@ -5770,12 +5987,12 @@ dependencies = [ "itertools 0.14.0", "p3-challenger", "p3-commit", - "p3-dft", - "p3-field", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-interpolation", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "tracing", @@ -5787,13 +6004,13 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "num-bigint 0.4.6", - "p3-dft", - "p3-field", - "p3-mds", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-mds 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "p3-poseidon", - "p3-poseidon2", - "p3-symmetric", - "p3-util", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", ] @@ -5803,10 +6020,10 @@ name = "p3-interpolation" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", ] [[package]] @@ -5815,9 +6032,9 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "itertools 0.14.0", - "p3-field", - "p3-symmetric", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "tiny-keccak", ] @@ -5827,43 +6044,77 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "p3-air", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "tracing", ] +[[package]] +name = "p3-koala-bear" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-mds 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-monty-31 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-poseidon2 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-symmetric 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "rand 0.8.5", + "serde", +] + [[package]] name = "p3-koala-bear" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "p3-field", - "p3-mds", - "p3-monty-31", - "p3-poseidon2", - "p3-symmetric", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-mds 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-monty-31 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", ] +[[package]] +name = "p3-matrix" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-util 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "rand 0.8.5", + "serde", + "tracing", + "transpose", +] + [[package]] name = "p3-matrix" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "itertools 0.14.0", - "p3-field", - "p3-maybe-rayon", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "tracing", "transpose", ] +[[package]] +name = "p3-maybe-rayon" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" + [[package]] name = "p3-maybe-rayon" version = "0.1.0" @@ -5872,17 +6123,31 @@ dependencies = [ "rayon", ] +[[package]] +name = "p3-mds" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "p3-dft 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-matrix 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-symmetric 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-util 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "rand 0.8.5", +] + [[package]] name = "p3-mds" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "itertools 0.14.0", - "p3-dft", - "p3-field", - "p3-matrix", - "p3-symmetric", - "p3-util", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", ] @@ -5893,14 +6158,54 @@ source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62c dependencies = [ "itertools 0.14.0", "p3-commit", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-symmetric", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "rand 0.8.5", + "serde", + "tracing", +] + +[[package]] +name = "p3-mersenne-31" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "num-bigint 0.4.6", + "p3-dft 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-matrix 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-mds 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-poseidon2 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-symmetric 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-util 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "p3-monty-31" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "num-bigint 0.4.6", + "p3-dft 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-matrix 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-mds 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-poseidon2 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-symmetric 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-util 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", "rand 0.8.5", "serde", "tracing", + "transpose", ] [[package]] @@ -5910,14 +6215,14 @@ source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62c dependencies = [ "itertools 0.14.0", "num-bigint 0.4.6", - "p3-dft", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-mds", - "p3-poseidon2", - "p3-symmetric", - "p3-util", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-mds 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "serde", "tracing", @@ -5929,9 +6234,21 @@ name = "p3-poseidon" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ - "p3-field", - "p3-mds", - "p3-symmetric", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-mds 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "rand 0.8.5", +] + +[[package]] +name = "p3-poseidon2" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "gcd", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-mds 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-symmetric 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", "rand 0.8.5", ] @@ -5941,9 +6258,9 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "gcd", - "p3-field", - "p3-mds", - "p3-symmetric", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-mds 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-symmetric 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", ] @@ -5953,23 +6270,33 @@ version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "p3-air", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-poseidon2", - "p3-util", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-poseidon2 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "rand 0.8.5", "tikv-jemallocator", "tracing", ] +[[package]] +name = "p3-symmetric" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "itertools 0.13.0", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "serde", +] + [[package]] name = "p3-symmetric" version = "0.1.0" source = "git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb#539bbc84085efb609f4f62cb03cf49588388abdb" dependencies = [ "itertools 0.14.0", - "p3-field", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "serde", ] @@ -5982,15 +6309,23 @@ dependencies = [ "p3-air", "p3-challenger", "p3-commit", - "p3-dft", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", + "p3-dft 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-field 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-matrix 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-maybe-rayon 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", + "p3-util 0.1.0 (git+https://github.com/Plonky3/Plonky3.git?rev=539bbc84085efb609f4f62cb03cf49588388abdb)", "serde", "tracing", ] +[[package]] +name = "p3-util" +version = "0.1.0" +source = "git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0#2192432ddf28e7359dd2c577447886463e6124f0" +dependencies = [ + "serde", +] + [[package]] name = "p3-util" version = "0.1.0" @@ -6274,6 +6609,12 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "plotters" version = "0.3.7" @@ -6332,6 +6673,204 @@ dependencies = [ "zerovec", ] +[[package]] +name = "powdr-autoprecompiles" +version = "0.1.4" +dependencies = [ + "itertools 0.13.0", + "log", + "metrics", + "num-traits", + "powdr-constraint-solver", + "powdr-expression", + "powdr-number", + "rayon", + "serde", + "serde_cbor", + "serde_json", + "strum 0.27.1", + "tracing", + "tracing-subscriber 0.3.20", +] + +[[package]] +name = "powdr-constraint-solver" +version = "0.1.4" +dependencies = [ + "auto_enums", + "bitvec", + "derive_more 0.99.20", + "itertools 0.13.0", + "log", + "num-traits", + "powdr-number", + "serde", +] + +[[package]] +name = "powdr-expression" +version = "0.1.4" +dependencies = [ + "derive_more 0.99.20", + "itertools 0.13.0", + "num-traits", + "powdr-number", + "schemars 0.8.22", + "serde", +] + +[[package]] +name = "powdr-isa-utils" +version = "0.1.4" + +[[package]] +name = "powdr-number" +version = "0.1.4" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "csv", + "derive_more 0.99.20", + "ibig", + "num-bigint 0.4.6", + "num-traits", + "p3-baby-bear 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-field 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-koala-bear 0.1.0 (git+https://github.com/plonky3/Plonky3.git?rev=2192432ddf28e7359dd2c577447886463e6124f0)", + "p3-mersenne-31", + "schemars 0.8.22", + "serde", + "serde_cbor", + "serde_with", +] + +[[package]] +name = "powdr-openvm" +version = "0.1.4" +dependencies = [ + "cfg-if", + "clap", + "derive_more 2.0.1", + "eyre", + "itertools 0.14.0", + "log", + "metrics", + "openvm", + "openvm-algebra-circuit", + "openvm-algebra-transpiler", + "openvm-bigint-circuit", + "openvm-bigint-transpiler", + "openvm-build", + "openvm-circuit", + "openvm-circuit-derive", + "openvm-circuit-primitives", + "openvm-circuit-primitives-derive", + "openvm-cuda-backend", + "openvm-cuda-builder", + "openvm-cuda-common", + "openvm-ecc-circuit", + "openvm-ecc-transpiler", + "openvm-instructions", + "openvm-instructions-derive", + "openvm-keccak256-circuit", + "openvm-keccak256-transpiler", + "openvm-native-circuit", + "openvm-native-recursion", + "openvm-pairing-circuit", + "openvm-pairing-transpiler", + "openvm-rv32im-circuit", + "openvm-rv32im-guest", + "openvm-rv32im-transpiler", + "openvm-sdk", + "openvm-sha256-circuit", + "openvm-sha256-transpiler", + "openvm-stark-backend", + "openvm-stark-sdk", + "openvm-transpiler", + "powdr-autoprecompiles", + "powdr-constraint-solver", + "powdr-expression", + "powdr-number", + "powdr-openvm-hints-circuit", + "powdr-openvm-hints-transpiler", + "powdr-riscv-elf", + "rustc-demangle", + "serde", + "serde_json", + "struct-reflection", + "toml 0.8.23", + "tracing", + "tracing-subscriber 0.3.20", +] + +[[package]] +name = "powdr-openvm-hints-circuit" +version = "0.1.4" +dependencies = [ + "crypto-bigint 0.6.1", + "elliptic-curve", + "eyre", + "openvm-circuit", + "openvm-instructions", + "openvm-rv32im-circuit", + "openvm-stark-backend", + "openvm-stark-sdk", + "powdr-openvm-hints-transpiler", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "powdr-openvm-hints-guest" +version = "0.1.4" +dependencies = [ + "openvm-custom-insn", + "openvm-platform", + "openvm-rv32im-guest", + "strum_macros 0.27.1", +] + +[[package]] +name = "powdr-openvm-hints-transpiler" +version = "0.1.4" +dependencies = [ + "openvm-instructions", + "openvm-instructions-derive", + "openvm-stark-backend", + "openvm-transpiler", + "powdr-openvm-hints-guest", + "rrs-lib", + "strum 0.27.1", +] + +[[package]] +name = "powdr-riscv-elf" +version = "0.1.4" +dependencies = [ + "gimli", + "goblin", + "itertools 0.13.0", + "log", + "powdr-isa-utils", + "powdr-riscv-types", + "powdr-syscalls", + "raki", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "powdr-riscv-types" +version = "0.1.4" +dependencies = [ + "powdr-isa-utils", +] + +[[package]] +name = "powdr-syscalls" +version = "0.1.4" + [[package]] name = "powerfmt" version = "0.2.0" @@ -6566,6 +7105,12 @@ dependencies = [ "nibble_vec", ] +[[package]] +name = "raki" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0279959070dedfe40cbbf4e42d06168f2722841d366a6d29c029e2b2dcc989fb" + [[package]] name = "rand" version = "0.8.5" @@ -7356,8 +7901,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f9311e735123d8d53a02af2aa81877bba185be7c141be7f931bb3d2f3af449c" dependencies = [ "ark-bls12-381", - "ark-bn254", - "ark-ec", + "ark-bn254 0.5.0", + "ark-ec 0.5.0", "ark-ff 0.5.0", "ark-serialize 0.5.0", "aurora-engine-modexp", @@ -7689,6 +8234,19 @@ dependencies = [ "syn 2.0.102", ] +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", +] + [[package]] name = "schemars" version = "0.9.0" @@ -7713,12 +8271,44 @@ dependencies = [ "serde_json", ] +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.102", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "sct" version = "0.7.1" @@ -7819,6 +8409,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half 1.8.3", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.219" @@ -7830,6 +8430,17 @@ dependencies = [ "syn 2.0.102", ] +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "serde_json" version = "1.0.140" @@ -8165,6 +8776,24 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "struct-reflection" +version = "0.1.0" +source = "git+https://github.com/gzanitti/struct-reflection-rs.git#69628d17bf35d1f09afd8cd93ba124de44789dff" +dependencies = [ + "struct-reflection-derive", +] + +[[package]] +name = "struct-reflection-derive" +version = "0.1.0" +source = "git+https://github.com/gzanitti/struct-reflection-rs.git#69628d17bf35d1f09afd8cd93ba124de44789dff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.102", +] + [[package]] name = "strum" version = "0.26.3" diff --git a/Cargo.toml b/Cargo.toml index 6b00d7e3c..12c0f85ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -124,28 +124,42 @@ openvm-cuda-backend = { git = "https://github.com/openvm-org/stark-backend.git", # Note: the openvm-sdk commit does not need to be exactly the same as the `openvm` commit used in the guest program: as long as # the openvm-sdk commit doesn't change any guest libraries, they are compatible # This allows us to not update revm and openvm-kzg each time we change openvm-sdk -# Using main from 10/13/2025 for now -openvm-build = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-continuations = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-benchmarks-prove = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-keccak256-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-keccak256-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-rv32im-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-bigint-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-bigint-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-algebra-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-algebra-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-ecc-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-ecc-transpiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-pairing-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-native-circuit = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-native-compiler = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } -openvm-native-recursion = { git = "https://github.com/openvm-org/openvm.git", branch = "main", default-features = false } +openvm-build = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-continuations = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-benchmarks-prove = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-keccak256-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-keccak256-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-rv32im-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-bigint-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-bigint-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-algebra-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-algebra-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-ecc-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-ecc-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-pairing-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-native-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-native-compiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } +openvm-native-recursion = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false } + +# powdr +powdr-openvm = { git = "https://github.com/powdr-labs/powdr.git", rev = "e666cb4", default-features = false } +powdr-riscv-elf = { git = "https://github.com/powdr-labs/powdr.git", rev = "e666cb4", default-features = false } +powdr-number = { git = "https://github.com/powdr-labs/powdr.git", rev = "e666cb4", default-features = false } +powdr-autoprecompiles = { git = "https://github.com/powdr-labs/powdr.git", rev = "e666cb4", default-features = false } +powdr-openvm-hints-circuit = { git = "https://github.com/powdr-labs/powdr.git", rev = "e666cb4", default-features = false } + +# Comment out the following to use a local powdr. +# [patch."https://github.com/openvm-org/openvm.git"] +# powdr-openvm = { path = "../powdr/openvm", default-features = false } +# powdr-riscv-elf = { path = "../powdr/riscv-elf", default-features = false } +# powdr-number = { path = "../powdr/number", default-features = false } +# powdr-autoprecompiles = { path = "../powdr/autoprecompiles", default-features = false } +# powdr-openvm-hints-circuit = { path = "../powdr/openvm/extensions/hints-circuit", default-features = false } [workspace.lints] rust.missing_debug_implementations = "warn" @@ -156,6 +170,7 @@ rustdoc.all = "warn" [profile.release] lto = "thin" +debug = true [profile.profiling] inherits = "maxperf" @@ -174,3 +189,67 @@ opt-level = 3 [profile.bench-with-debug] inherits = "release" debug = 1 + +# NORMAL USAGE PATCHES + +# This patch should be enabled for "normal" usage. +# Comment it out if you want to use a local stark-backend instead. +# This rev needs to be the same that powdr uses. +[patch."https://github.com/openvm-org/stark-backend.git"] +openvm-cuda-backend = { git = "https://github.com/powdr-labs/stark-backend.git", rev = "v1.2.1-powdr" } +openvm-cuda-common = { git = "https://github.com/powdr-labs/stark-backend.git", rev = "v1.2.1-powdr" } +openvm-stark-sdk = { git = "https://github.com/powdr-labs/stark-backend.git", rev = "v1.2.1-powdr" } + +# This patch should be enabled for "normal" usage. +# Comment it out if you want to use a local OpenVM instead (patches below this block). +# This rev needs to be the same that powdr uses. +[patch."https://github.com/openvm-org/openvm.git"] +openvm-benchmarks-prove = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +# OpenVM +openvm-sdk = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +# cargo-openvm = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-mod-circuit-builder = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-poseidon2-air = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-circuit-primitives = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-circuit-primitives-derive = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-build = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-instructions = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-instructions-derive = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-macros-common = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-platform = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-circuit-derive = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-continuations = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } + +# Extensions +openvm-algebra-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-algebra-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-algebra-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-algebra-moduli-macros = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-algebra-complex-macros = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-bigint-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-bigint-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-bigint-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-ecc-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-ecc-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-ecc-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-ecc-sw-macros = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-keccak256-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-keccak256-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-keccak256-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-sha256-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-sha256-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-sha256-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-native-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-native-compiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-native-compiler-derive = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-native-recursion = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-pairing-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-pairing-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-pairing-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-rv32-adapters = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-rv32im-circuit = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-rv32im-transpiler = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } +openvm-rv32im-guest = { git = "https://github.com/powdr-labs/openvm.git", rev = "v1.4.1-powdr" } \ No newline at end of file diff --git a/bin/client-eth/Cargo.lock b/bin/client-eth/Cargo.lock index c796b233c..b0a7d999b 100644 --- a/bin/client-eth/Cargo.lock +++ b/bin/client-eth/Cargo.lock @@ -4527,3 +4527,23 @@ dependencies = [ name = "p256" version = "0.13.2" source = "git+https://github.com/openvm-org/openvm.git?branch=main#05cb6a11bbd7ac3ac8a00c3fc56391b06f54baa2" + +[[patch.unused]] +name = "powdr-autoprecompiles" +version = "0.1.4" + +[[patch.unused]] +name = "powdr-number" +version = "0.1.4" + +[[patch.unused]] +name = "powdr-openvm" +version = "0.1.4" + +[[patch.unused]] +name = "powdr-openvm-hints-circuit" +version = "0.1.4" + +[[patch.unused]] +name = "powdr-riscv-elf" +version = "0.1.4" diff --git a/bin/client-eth/Cargo.toml b/bin/client-eth/Cargo.toml index 334648579..1cf44072c 100644 --- a/bin/client-eth/Cargo.toml +++ b/bin/client-eth/Cargo.toml @@ -67,7 +67,7 @@ ruint = { git = "https://github.com/openvm-org/openvm.git", branch = "main" } [profile.release] panic = "abort" lto = "fat" -strip = true +strip = false [profile.profiling] inherits = "release" diff --git a/bin/host/src/main.rs b/bin/host/src/main.rs index 0276657d7..eb925cc21 100644 --- a/bin/host/src/main.rs +++ b/bin/host/src/main.rs @@ -1,12 +1,14 @@ #![cfg_attr(feature = "tco", allow(incomplete_features))] #![cfg_attr(feature = "tco", feature(explicit_tail_calls))] use clap_builder::Parser; -use openvm_reth_benchmark::{run_reth_benchmark, HostArgs}; +use openvm_reth_benchmark::{complete_args, precompute_prover_data, run_reth_benchmark, HostArgs}; const OPENVM_CLIENT_ETH_ELF: &[u8] = include_bytes!("../elf/openvm-client-eth"); #[tokio::main] async fn main() -> eyre::Result<()> { let args = HostArgs::parse(); - run_reth_benchmark(args, OPENVM_CLIENT_ETH_ELF).await + let args = complete_args(args); + let setup = precompute_prover_data(&args, OPENVM_CLIENT_ETH_ELF).await?; + run_reth_benchmark(args, setup, OPENVM_CLIENT_ETH_ELF).await } diff --git a/crates/host-bench/Cargo.toml b/crates/host-bench/Cargo.toml index 85b78896a..84ad2a5e2 100644 --- a/crates/host-bench/Cargo.toml +++ b/crates/host-bench/Cargo.toml @@ -49,16 +49,24 @@ openvm-native-compiler = { workspace = true } openvm-benchmarks-prove = { workspace = true, features = ["parallel"] } openvm-stark-sdk = { workspace = true } openvm-sdk = { workspace = true } +openvm-cuda-backend = { workspace = true, optional = true } derive_more.workspace = true toml.workspace = true # halo2 halo2-axiom = { version = "0.5.0", default-features = false, optional = true } +# powdr +powdr-openvm = { workspace = true } +powdr-riscv-elf = { workspace = true } +powdr-number = { workspace = true } +powdr-autoprecompiles = { workspace = true } +powdr-openvm-hints-circuit = { workspace = true } + [features] default = ["mimalloc", "metrics"] -metrics = ["openvm-benchmarks-prove/metrics"] -tco = ["openvm-sdk/tco"] +metrics = ["openvm-benchmarks-prove/metrics", "powdr-openvm/metrics"] +tco = ["openvm-sdk/tco", "powdr-openvm/tco"] evm-prove = ["openvm-sdk/evm-prove", "halo2-axiom"] evm-verify = ["evm-prove", "openvm-sdk/evm-verify", "halo2-axiom"] perf-metrics = ["openvm-sdk/perf-metrics", "openvm-benchmarks-prove/perf-metrics"] @@ -70,5 +78,7 @@ halo2-asm = ["halo2-axiom?/asm"] cuda = [ "openvm-native-circuit/cuda", "openvm-sdk/cuda", + "powdr-openvm/cuda", + "dep:openvm-cuda-backend", ] unprotected = ["openvm-sdk/unprotected"] diff --git a/crates/host-bench/src/lib.rs b/crates/host-bench/src/lib.rs index ccac485cc..9836c3a3f 100644 --- a/crates/host-bench/src/lib.rs +++ b/crates/host-bench/src/lib.rs @@ -7,7 +7,7 @@ use alloy_transport::layers::RetryBackoffLayer; use clap::Parser; use openvm_benchmarks_prove::util::BenchmarkCli; use openvm_circuit::{ - arch::*, + arch::{execution_mode::Segment, *}, openvm_stark_sdk::{ bench::run_with_metric_collection, openvm_stark_backend::p3_field::PrimeField32, }, @@ -15,20 +15,42 @@ use openvm_circuit::{ use openvm_client_executor::{io::ClientExecutorInput, ClientExecutor, CHAIN_ID_ETH_MAINNET}; use openvm_host_executor::HostExecutor; pub use openvm_native_circuit::NativeConfig; +use openvm_native_circuit::NativeCpuBuilder; +#[cfg(feature = "cuda")] +pub use openvm_cuda_backend::engine::GpuBabyBearPoseidon2Engine; use openvm_sdk::{ - config::{AppConfig, SdkVmBuilder, SdkVmConfig}, - fs::read_object_from_file, + config::{AppConfig, SdkVmConfig}, keygen::{AggProvingKey, AppProvingKey}, - prover::verify_app_proof, + prover::{verify_app_proof, vm::new_local_prover}, types::VersionedVmStarkProof, - DefaultStarkEngine, Sdk, StdIn, + DefaultStarkEngine, GenericSdk, StdIn, +}; +use openvm_stark_sdk::{ + config::baby_bear_poseidon2::BabyBearPoseidon2Engine, engine::StarkFriEngine, }; -use openvm_stark_sdk::engine::StarkFriEngine; use openvm_transpiler::{elf::Elf, openvm_platform::memory::MEM_SIZE}; +use powdr_autoprecompiles::PgoType; +#[cfg(feature = "cuda")] +use powdr_openvm::ExtendedVmConfigGpuBuilder; +#[cfg(not(feature = "cuda"))] +use powdr_openvm::PowdrSdkCpu; +#[cfg(feature = "cuda")] +use powdr_openvm::PowdrSdkGpu; +use powdr_openvm::{ + CompiledProgram, ExtendedVmConfig, ExtendedVmConfigCpuBuilder, OriginalCompiledProgram, + SpecializedConfig, SpecializedConfigCpuBuilder, +}; + +use powdr_openvm_hints_circuit::HintsExtension; pub use reth_primitives; +use serde::{Deserialize, Serialize}; use serde_json::json; -use std::{fs, path::PathBuf}; +use std::{ + fs::{self, File}, + io::{BufReader, BufWriter}, + path::PathBuf, +}; use tracing::{info, info_span}; mod execute; @@ -36,6 +58,8 @@ mod execute; mod cli; use cli::ProviderArgs; +use crate::cli::ProviderConfig; + /// Enum representing the execution mode of the host executable. #[derive(Debug, Clone, clap::ValueEnum)] pub enum BenchMode { @@ -45,6 +69,8 @@ pub enum BenchMode { Execute, /// Execute the VM with metering to get segments information. ExecuteMetered, + /// Execute, generate trace, and check constraints and bus interactions without proving. + ProveMock, /// Generate sequence of app proofs for continuation segments. ProveApp, /// Generate a full end-to-end STARK proof with aggregation. @@ -54,6 +80,8 @@ pub enum BenchMode { ProveEvm, /// Generate input file only. MakeInput, + /// Compile with apcs, no execution. + Compile, /// Generate fixtures file for futher benchmarking. GenerateFixtures, } @@ -64,16 +92,17 @@ impl std::fmt::Display for BenchMode { Self::ExecuteHost => write!(f, "execute_host"), Self::Execute => write!(f, "execute"), Self::ExecuteMetered => write!(f, "execute_metered"), + Self::ProveMock => write!(f, "prove_mock"), Self::ProveApp => write!(f, "prove_app"), Self::ProveStark => write!(f, "prove_stark"), #[cfg(feature = "evm-verify")] Self::ProveEvm => write!(f, "prove_evm"), Self::MakeInput => write!(f, "make_input"), + Self::Compile => write!(f, "compile"), Self::GenerateFixtures => write!(f, "generate_fixtures"), } } } - /// The arguments for the host executable. #[derive(Debug, Parser)] pub struct HostArgs { @@ -91,6 +120,14 @@ pub struct HostArgs { /// created from RPC data if it doesn't already exist. #[clap(long)] cache_dir: Option, + + /// Path to the directory containing cached apc compilation output. + #[clap(long)] + apc_cache_dir: PathBuf, + + #[clap(long)] + apc_setup_name: String, + /// The path to the CSV file containing the execution data. #[clap(long, default_value = "report.csv")] report_path: PathBuf, @@ -102,6 +139,14 @@ pub struct HostArgs { #[arg(long)] pub input_path: Option, + #[arg(long)] + apc: usize, + + #[arg(long)] + apc_skip: usize, + + #[arg(long)] + pgo_type: PgoType, /// Path to write the fixtures to. Only needed for mode=make_input #[arg(long)] pub fixtures_path: Option, @@ -126,7 +171,7 @@ pub struct HostArgs { pub skip_comparison: bool, } -pub fn reth_vm_config(app_log_blowup: usize) -> SdkVmConfig { +pub fn reth_vm_config(app_log_blowup: usize) -> ExtendedVmConfig { let mut config = toml::from_str::>(include_str!( "../../../bin/client-eth/openvm.toml" )) @@ -137,13 +182,183 @@ pub fn reth_vm_config(app_log_blowup: usize) -> SdkVmConfig { .config .with_max_constraint_degree((1 << app_log_blowup) + 1) .with_public_values(32); - config + ExtendedVmConfig { sdk: config, hints: HintsExtension } } pub const RETH_DEFAULT_APP_LOG_BLOWUP: usize = 1; pub const RETH_DEFAULT_LEAF_LOG_BLOWUP: usize = 1; -pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> eyre::Result<()> { +const PGO_CHAIN_ID: u64 = CHAIN_ID_ETH_MAINNET; +const PGO_BLOCK_NUMBERS: [u64; 1] = [23100006]; +const APP_LOG_BLOWUP: usize = 1; + +#[derive(Serialize, Deserialize)] +pub struct PrecomputedProverData { + program: CompiledProgram, + app_pk: AppProvingKey, + agg_pk: AggProvingKey, +} + +async fn get_client_input( + provider_config: &ProviderConfig, + cache_dir: &Option, + chain_id: u64, + block_number: u64, +) -> eyre::Result { + let client_input_from_cache = + try_load_input_from_cache(cache_dir.as_ref(), chain_id, block_number)?; + + match (client_input_from_cache, &provider_config.rpc_url) { + (Some(client_input_from_cache), _) => Ok(client_input_from_cache), + (None, Some(rpc_url)) => { + // Cache not found but we have RPC + // Setup the provider. + let client = RpcClient::builder() + .layer(RetryBackoffLayer::new(5, 1000, 100)) + .http(rpc_url.clone()); + let provider = RootProvider::new(client); + + // Setup the host executor. + let host_executor = HostExecutor::new(provider); + + // Execute the host. + let client_input = + host_executor.execute(block_number).await.expect("failed to execute host"); + + if let Some(cache_dir) = cache_dir { + let input_folder = cache_dir.join(format!("input/{}", chain_id)); + if !input_folder.exists() { + std::fs::create_dir_all(&input_folder)?; + } + + let input_path = input_folder.join(format!("{}.bin", block_number)); + let mut cache_file = std::fs::File::create(input_path)?; + + bincode::serde::encode_into_std_write( + &client_input, + &mut cache_file, + bincode::config::standard(), + )?; + } + + Ok(client_input) + } + (None, None) => { + eyre::bail!("cache not found and RPC URL not provided") + } + } +} + +/// Complete the host arguments with defaults +pub fn complete_args(mut args: HostArgs) -> HostArgs { + let app_log_blowup = args.benchmark.app_log_blowup.unwrap_or(RETH_DEFAULT_APP_LOG_BLOWUP); + assert_eq!(app_log_blowup, APP_LOG_BLOWUP, "App log blowup must be {RETH_DEFAULT_APP_LOG_BLOWUP} because it must match the one used when compiling this benchmark"); + args.benchmark.app_log_blowup = Some(app_log_blowup); + let leaf_log_blowup = args.benchmark.leaf_log_blowup.unwrap_or(RETH_DEFAULT_LEAF_LOG_BLOWUP); + args.benchmark.leaf_log_blowup = Some(leaf_log_blowup); + + args +} + +/// Precompute the prover data, in particular the specialized config taking into account APCs, as +/// well as associated proving keys. If the data is already present in the cache, deserialize it and +/// return it. +pub async fn precompute_prover_data( + args: &HostArgs, + openvm_client_eth_elf: &[u8], +) -> eyre::Result { + // We do this in a separate scope so the log initialization does not conflict with OpenVM's. + // The powdr log is enabled during the scope of `_guard`. + let subscriber = + tracing_subscriber::FmtSubscriber::builder().with_max_level(tracing::Level::DEBUG).finish(); + let _guard = tracing::subscriber::set_default(subscriber); + + let cache_file_path = args.apc_cache_dir.join(&args.apc_setup_name).with_extension("bin"); + + if let Some(compiled_program) = + File::open(&cache_file_path).ok().map(BufReader::new).map(|mut file| { + bincode::serde::decode_from_std_read(&mut file, bincode::config::standard()) + .expect("Found cached precomputed prover data, but deserialization failed") + }) + { + tracing::info!("Precomputed prover data for key {} found in cache", args.apc_setup_name); + return Ok(compiled_program); + } + + tracing::info!( + "Precomputed prover data for key {} not found in cache. Precomputing prover data.", + args.apc_setup_name + ); + + let provider_config = args.provider.clone().into_provider().await?; + + let mut pgo_stdins = Vec::new(); + + for block_id in PGO_BLOCK_NUMBERS { + let pgo_client_input = + get_client_input(&provider_config, &args.cache_dir, PGO_CHAIN_ID, block_id) + .await + .unwrap(); + + let mut pgo_stdin = StdIn::default(); + pgo_stdin.write(&pgo_client_input); + pgo_stdins.push(pgo_stdin); + } + + let app_log_blowup = args.benchmark.app_log_blowup.unwrap(); + + let vm_config = reth_vm_config(app_log_blowup); + let app_config = args.benchmark.app_config(vm_config.clone()); + + let sdk: GenericSdk = + GenericSdk::new(app_config.clone())? + .with_agg_config(args.benchmark.agg_config()) + .with_agg_tree_config(args.benchmark.agg_tree_config); + let elf = Elf::decode(openvm_client_eth_elf, MEM_SIZE as u32)?; + let exe = sdk.convert_to_exe(elf.clone())?; + let elf = powdr_riscv_elf::load_elf_from_buffer(openvm_client_eth_elf); + + let program = powdr::apc( + OriginalCompiledProgram { exe, vm_config, elf }, + args.apc, + args.apc_skip, + args.pgo_type, + pgo_stdins, + ); + + // Precompute proving keys + let specialized_sdk: GenericSdk< + BabyBearPoseidon2Engine, + SpecializedConfigCpuBuilder, + NativeCpuBuilder, + > = GenericSdk::new(args.benchmark.app_config(program.vm_config.clone()))? + .with_agg_config(args.benchmark.agg_config()) + .with_agg_tree_config(args.benchmark.agg_tree_config); + + tracing::info!("Run app keygen"); + let (app_pk, _) = specialized_sdk.app_keygen(); + tracing::info!("Run agg keygen"); + let (agg_pk, _) = specialized_sdk.agg_keygen().unwrap(); + + let setup = PrecomputedProverData { program, app_pk, agg_pk }; + + tracing::info!("Saving prover data to cache at {}", cache_file_path.display()); + std::fs::create_dir_all(&args.apc_cache_dir).unwrap(); + bincode::serde::encode_into_std_write( + &setup, + &mut BufWriter::new(File::create(cache_file_path).unwrap()), + bincode::config::standard(), + ) + .unwrap(); + + Ok(setup) +} + +pub async fn run_reth_benchmark( + args: HostArgs, + setup: PrecomputedProverData, + openvm_client_eth_elf: &[u8], +) -> eyre::Result<()> { // Initialize the environment variables. dotenv::dotenv().ok(); @@ -153,68 +368,21 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> // Parse the command line arguments. let mut args = args; + let provider_config = args.provider.into_provider().await?; - let client_input_from_path = - args.input_path.as_ref().map(|path| try_load_input_from_path(path).unwrap()); - - let client_input = if let Some(client_input_from_path) = client_input_from_path { - client_input_from_path - } else { - let provider_config = args.provider.into_provider().await?; - match provider_config.chain_id { - #[allow(non_snake_case)] - CHAIN_ID_ETH_MAINNET => (), - _ => { - eyre::bail!("unknown chain ID: {}", provider_config.chain_id); - } - }; - let client_input_from_cache = try_load_input_from_cache( - args.cache_dir.as_ref(), - provider_config.chain_id, - args.block_number, - )?; - - match (client_input_from_cache, provider_config.rpc_url) { - (Some(client_input_from_cache), _) => client_input_from_cache, - (None, Some(rpc_url)) => { - // Cache not found but we have RPC - // Setup the provider. - let client = - RpcClient::builder().layer(RetryBackoffLayer::new(5, 1000, 100)).http(rpc_url); - let provider = RootProvider::new(client); - - // Setup the host executor. - let host_executor = HostExecutor::new(provider); - - // Execute the host. - let client_input = - host_executor.execute(args.block_number).await.expect("failed to execute host"); - - if let Some(cache_dir) = args.cache_dir { - let input_folder = - cache_dir.join(format!("input/{}", provider_config.chain_id)); - if !input_folder.exists() { - std::fs::create_dir_all(&input_folder)?; - } - - let input_path = input_folder.join(format!("{}.bin", args.block_number)); - let mut cache_file = std::fs::File::create(input_path)?; - - bincode::serde::encode_into_std_write( - &client_input, - &mut cache_file, - bincode::config::standard(), - )?; - } - - client_input - } - (None, None) => { - eyre::bail!("cache not found and RPC URL not provided") - } + match provider_config.chain_id { + #[allow(non_snake_case)] + CHAIN_ID_ETH_MAINNET => (), + _ => { + eyre::bail!("unknown chain ID: {}", provider_config.chain_id); } }; + let chain_id = provider_config.chain_id; + + let client_input = + get_client_input(&provider_config, &args.cache_dir, chain_id, args.block_number).await?; + let mut stdin = StdIn::default(); stdin.write(&client_input); info!("input loaded"); @@ -231,47 +399,40 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> return Ok(()); } - let app_log_blowup = args.benchmark.app_log_blowup.unwrap_or(RETH_DEFAULT_APP_LOG_BLOWUP); - args.benchmark.app_log_blowup = Some(app_log_blowup); - let leaf_log_blowup = args.benchmark.leaf_log_blowup.unwrap_or(RETH_DEFAULT_LEAF_LOG_BLOWUP); - args.benchmark.leaf_log_blowup = Some(leaf_log_blowup); - - #[cfg(feature = "cuda")] - println!("CUDA Backend Enabled"); + let app_log_blowup = args.benchmark.app_log_blowup.unwrap(); let vm_config = reth_vm_config(app_log_blowup); let app_config = args.benchmark.app_config(vm_config.clone()); - let sdk = Sdk::new(app_config.clone())? + + let elf = Elf::decode(openvm_client_eth_elf, MEM_SIZE as u32)?; + + let PrecomputedProverData { program: CompiledProgram { exe, vm_config }, app_pk, agg_pk } = + setup; + + // Create an SDK based on the `SpecializedConfig` we generated + #[cfg(feature = "cuda")] + let generic_sdk = PowdrSdkGpu::new(args.benchmark.app_config(vm_config.clone()))?; + #[cfg(not(feature = "cuda"))] + let generic_sdk = PowdrSdkCpu::new(args.benchmark.app_config(vm_config.clone()))?; + let specialized_sdk = generic_sdk .with_agg_config(args.benchmark.agg_config()) .with_agg_tree_config(args.benchmark.agg_tree_config); - if args.app_pk_path.is_some() != args.agg_pk_path.is_some() { - eyre::bail!("app_pk_path and agg_pk_path must be provided together"); - } - if let Some(app_pk_path) = args.app_pk_path { - let app_pk: AppProvingKey = read_object_from_file(app_pk_path)?; - let agg_pk_path = args.agg_pk_path.unwrap(); - let agg_pk: AggProvingKey = read_object_from_file(agg_pk_path)?; - let vm_config_loaded = app_pk.app_vm_pk.vm_config.clone(); - let vm_config_json = - serde_json::to_value(&vm_config).expect("failed to serialize vm_config to json value"); - let vm_config_loaded_json = serde_json::to_value(&vm_config_loaded) - .expect("failed to serialize vm_config_loaded to json value"); - assert_eq!( - vm_config_json, vm_config_loaded_json, - "vm_config mismatch between runtime config and proving key" - ); - sdk.set_app_pk(app_pk).map_err(|_| eyre::eyre!("failed to set app pk"))?; - sdk.set_agg_pk(agg_pk).map_err(|_| eyre::eyre!("failed to set agg pk"))?; - } - - let elf = Elf::decode(openvm_client_eth_elf, MEM_SIZE as u32)?; - let exe = sdk.convert_to_exe(elf.clone())?; + // Load the precomputed proving keys + tracing::info!("Load app pk"); + specialized_sdk.set_app_pk(app_pk).map_err(|_| ()).unwrap(); + tracing::info!("Load agg pk"); + specialized_sdk.set_agg_pk(agg_pk).map_err(|_| ()).unwrap(); let program_name = format!("reth.{}.block_{}", args.mode, args.block_number); // NOTE: args.benchmark.app_config resets SegmentationLimits if max_segment_length is set args.benchmark.max_segment_length = None; + // `prover` can be called over both `elf` and `exe`. + // We had a bug before where `prover(elf)` was called and silently didn't use any apcs. + // So we drop `elf` here to make sure it's never used later. + drop(elf); + run_with_metric_collection("OUTPUT_PATH", || { info_span!("reth-block", block_number = args.block_number).in_scope( || -> eyre::Result<()> { @@ -299,18 +460,25 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> // Execute for benchmarking: if !args.skip_comparison { let pvs = info_span!("sdk.execute", group = program_name) - .in_scope(|| sdk.execute(elf.clone(), stdin.clone()))?; + .in_scope(|| specialized_sdk.execute(exe.clone(), stdin.clone()))?; let block_hash = pvs; println!("block_hash (execute): {}", ToHexExt::encode_hex(&block_hash)); } match args.mode { + BenchMode::Compile => { + // This mode is used to compile the program with APCs, no execution. + println!("Compiled program with APCs"); + } BenchMode::Execute => {} BenchMode::ExecuteMetered => { let engine = DefaultStarkEngine::new(app_config.app_fri_params.fri_params); let (vm, _) = VirtualMachine::new_with_keygen( engine, - SdkVmBuilder, + #[cfg(feature = "cuda")] + ExtendedVmConfigGpuBuilder, + #[cfg(not(feature = "cuda"))] + ExtendedVmConfigCpuBuilder, app_config.app_vm_config, )?; let executor_idx_to_air_idx = vm.executor_idx_to_air_idx(); @@ -322,14 +490,70 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> .in_scope(|| interpreter.execute_metered(stdin, metered_ctx))?; println!("Number of segments: {}", segments.len()); } + BenchMode::ProveMock => { + // Build owned vm instance, so we can mutate it later + let vm_builder = specialized_sdk.app_vm_builder().clone(); + let vm_pk = specialized_sdk.app_pk().app_vm_pk.clone(); + let exe = specialized_sdk.convert_to_exe(exe.clone())?; + let mut vm_instance: VmInstance<_, _> = + new_local_prover(vm_builder, &vm_pk, exe.clone())?; + + vm_instance.reset_state(stdin.clone()); + let metered_ctx = vm_instance.vm.build_metered_ctx(&exe); + let metered_interpreter = + vm_instance.vm.metered_interpreter(vm_instance.exe())?; + let (segments, _) = + metered_interpreter.execute_metered(stdin.clone(), metered_ctx)?; + let mut state = vm_instance.state_mut().take(); + + // Get reusable inputs for `debug_proving_ctx`, the mock prover API from + // OVM. + let vm = &mut vm_instance.vm; + let air_inv = vm.config().create_airs().unwrap(); + #[cfg(feature = "cuda")] + let pk = air_inv.keygen::(&vm.engine); + #[cfg(not(feature = "cuda"))] + let pk = air_inv.keygen::(&vm.engine); + + for (seg_idx, segment) in segments.into_iter().enumerate() { + let _segment_span = + info_span!("prove_segment", segment = seg_idx).entered(); + // We need a separate span so the metric label includes "segment" from + // _segment_span + let _prove_span = info_span!("total_proof").entered(); + let Segment { instret_start, num_insns, trace_heights } = segment; + assert_eq!(state.as_ref().unwrap().instret(), instret_start); + let from_state = Option::take(&mut state).unwrap(); + vm.transport_init_memory_to_device(&from_state.memory); + let PreflightExecutionOutput { + system_records, + record_arenas, + to_state, + } = vm.execute_preflight( + &mut vm_instance.interpreter, + from_state, + Some(num_insns), + &trace_heights, + )?; + state = Some(to_state); + + // Generate proving context for each segment + let ctx = vm.generate_proving_ctx(system_records, record_arenas)?; + + // Run the mock prover for each segment + debug_proving_ctx(vm, &pk, &ctx); + } + } BenchMode::ProveApp => { - let mut prover = sdk.app_prover(elf)?.with_program_name(program_name); - let (_, app_vk) = sdk.app_keygen(); + let mut prover = + specialized_sdk.app_prover(exe)?.with_program_name(program_name); + let (_, app_vk) = specialized_sdk.app_keygen(); let proof = prover.prove(stdin)?; verify_app_proof(&app_vk, &proof)?; } BenchMode::ProveStark => { - let mut prover = sdk.prover(elf)?.with_program_name(program_name); + let mut prover = + specialized_sdk.prover(exe)?.with_program_name(program_name); let proof = prover.prove(stdin)?; let block_hash = proof .user_public_values @@ -358,8 +582,9 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> } #[cfg(feature = "evm-verify")] BenchMode::ProveEvm => { - let mut prover = sdk.evm_prover(elf)?.with_program_name(program_name); - let halo2_pk = sdk.halo2_pk(); + let mut prover = + specialized_sdk.evm_prover(exe)?.with_program_name(program_name); + let halo2_pk = specialized_sdk.halo2_pk(); tracing::info!( "halo2_outer_k: {}", halo2_pk.verifier.pinning.metadata.config_params.k @@ -373,7 +598,8 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> println!("block_hash (prove_evm): {}", ToHexExt::encode_hex(block_hash)); } BenchMode::GenerateFixtures => { - let mut prover = sdk.prover(elf)?.with_program_name(program_name); + let mut prover = + specialized_sdk.prover(exe)?.with_program_name(program_name); let app_proof = prover.app_prover.prove(stdin)?; let leaf_proofs = prover.agg_prover.generate_leaf_proofs(&app_proof)?; let fixture_path = args.fixtures_path.unwrap(); @@ -388,11 +614,11 @@ pub async fn run_reth_benchmark(args: HostArgs, openvm_client_eth_elf: &[u8]) -> let mut app_pk_path = fixture_path.clone(); app_pk_path.push("app_pk.bitcode"); - fs::write(app_pk_path, bitcode::serialize(sdk.app_pk())?)?; + fs::write(app_pk_path, bitcode::serialize(specialized_sdk.app_pk())?)?; let mut agg_pk_path = fixture_path.clone(); agg_pk_path.push("agg_pk.bitcode"); - fs::write(agg_pk_path, bitcode::serialize(sdk.agg_pk())?)?; + fs::write(agg_pk_path, bitcode::serialize(specialized_sdk.agg_pk())?)?; } _ => { // This case is handled earlier and should not reach here @@ -430,34 +656,75 @@ fn try_load_input_from_cache( }) } -fn try_load_input_from_path(path: &PathBuf) -> eyre::Result { - let ext = path.extension().and_then(|s| s.to_str()).unwrap_or(""); - if ext.eq_ignore_ascii_case("json") { - let s = std::fs::read_to_string(path)?; - let v: serde_json::Value = serde_json::from_str(&s)?; - let arr = v - .get("input") - .and_then(|v| v.as_array()) - .ok_or_else(|| eyre::eyre!("invalid JSON: missing 'input' array"))?; - let hex_str = arr - .first() - .and_then(|v| v.as_str()) - .ok_or_else(|| eyre::eyre!("invalid JSON: 'input[0]' must be string"))?; - let stripped = hex_str.trim_start_matches("0x"); - let mut bytes = hex::decode(stripped)?; - if let Some(1u8) = bytes.first().copied() { - bytes.remove(0); - } - if bytes.len() % 4 != 0 { - eyre::bail!("input bytes length must be multiple of 4"); +mod powdr { + use openvm_native_circuit::NativeCpuBuilder; + use openvm_sdk::{ + config::{AppConfig, DEFAULT_APP_LOG_BLOWUP}, + GenericSdk, StdIn, + }; + use openvm_stark_sdk::config::FriParameters; + use powdr_autoprecompiles::{execution_profile::execution_profile, PgoType}; + use powdr_openvm::{ + compile_exe, default_powdr_openvm_config, BabyBearOpenVmApcAdapter, CompiledProgram, + DegreeBound, ExtendedVmConfigCpuBuilder, OriginalCompiledProgram, PgoConfig, Prog, + }; + + /// This function is used to generate the specialized program for the Powdr APC. + /// It takes: + /// - `original_program`: The original program, including the original vm config. + /// - `apc`: The number of apcs to generate + /// - `apc_skip`: The number of apcs to skip when selecting. Used for debugging. + /// - `pgo_type`: The PGO strategy to use when choosing the blocks to accelerate. + /// - `pgo_stdin`: The standard inputs to the program used for PGO data generation to choose + /// which basic blocks to accelerate. + pub fn apc( + original_program: OriginalCompiledProgram, + apc: usize, + apc_skip: usize, + pgo_type: PgoType, + pgo_stdin: Vec, + ) -> CompiledProgram { + // Set app configuration + let app_fri_params = + FriParameters::standard_with_100_bits_conjectured_security(DEFAULT_APP_LOG_BLOWUP); + let app_config = AppConfig::new(app_fri_params, original_program.vm_config.clone()); + + use openvm_stark_sdk::config::baby_bear_poseidon2::BabyBearPoseidon2Engine; + + // prepare for execute + let sdk: GenericSdk = + GenericSdk::new(app_config).unwrap(); + + assert_eq!(pgo_stdin.len(), 1, "Currently only support 1 stdin for PGO"); + let inputs = pgo_stdin[0].clone(); + + let execute = || { + for stdin in pgo_stdin { + sdk.execute(original_program.exe.clone(), stdin).unwrap(); + } + }; + + let program = Prog::from(&original_program.exe.program); + + let pgo_config = match pgo_type { + PgoType::None => PgoConfig::None, + PgoType::Instruction => PgoConfig::Instruction(execution_profile::< + BabyBearOpenVmApcAdapter, + >(&program, execute)), + PgoType::Cell => PgoConfig::Cell( + execution_profile::(&program, execute), + None, // max total columns + ), + }; + + let mut config = default_powdr_openvm_config(apc as u64, apc_skip as u64); + + config.degree_bound = DegreeBound { identities: 3, bus_interactions: 2 }; + + if let Ok(path) = std::env::var("POWDR_APC_CANDIDATES_DIR") { + config = config.with_apc_candidates_dir(path); } - let input: ClientExecutorInput = openvm::serde::from_slice(&bytes) - .map_err(|e| eyre::eyre!("failed to decode input words using openvm::serde: {e:?}"))?; - Ok(input) - } else { - let mut file = std::fs::File::open(path)?; - let client_input: ClientExecutorInput = - bincode::serde::decode_from_std_read(&mut file, bincode::config::standard())?; - Ok(client_input) + + compile_exe(original_program, config, pgo_config, inputs).unwrap() } } diff --git a/crates/mpt/src/hp.rs b/crates/mpt/src/hp.rs index 10cc44f38..011244bd2 100644 --- a/crates/mpt/src/hp.rs +++ b/crates/mpt/src/hp.rs @@ -197,7 +197,7 @@ pub(crate) fn to_encoded_path_with_bump<'a>( #[cfg(feature = "host")] #[inline] pub(crate) fn to_encoded_path(nibs: &[u8], is_leaf: bool) -> Vec { - let is_odd = nibs.len() % 2 != 0; + let is_odd = !nibs.len().is_multiple_of(2); // Max path is 64 nibs (32 bytes) + 1 prefix byte = 33 bytes. let mut encoded = Vec::with_capacity(33); diff --git a/run.sh b/run.sh index 24c372008..af0c817c9 100755 --- a/run.sh +++ b/run.sh @@ -2,29 +2,32 @@ USE_CUDA=false if [ "$1" == "cuda" ]; then - USE_CUDA=true + USE_CUDA=true fi set -e mkdir -p rpc-cache source .env -MODE=execute # can be execute-host, execute, execute-metered, prove-app, prove-stark, or prove-evm (needs "evm-verify" feature) +# MODE=execute # can be execute-host, execute, execute-metered, prove-app, prove-stark, or prove-evm (needs "evm-verify" feature) cd bin/client-eth -cargo openvm build +RUSTFLAGS="-Clink-arg=--emit-relocs" cargo openvm build --no-transpile mkdir -p ../host/elf SRC="target/riscv32im-risc0-zkvm-elf/release/openvm-client-eth" DEST="../host/elf/openvm-client-eth" if [ ! -f "$DEST" ] || ! cmp -s "$SRC" "$DEST"; then - cp "$SRC" "$DEST" + cp "$SRC" "$DEST" fi cd ../.. +mkdir -p rpc-cache +source .env +# MODE=execute # can be compile, execute, execute-metered, prove-mock, prove-app, prove-stark, or prove-evm (needs "evm-verify" feature) PROFILE="release" -FEATURES="metrics,jemalloc,tco,unprotected" -BLOCK_NUMBER=23100006 +FEATURES="metrics,jemalloc,unprotected" # removed tco here till we have that fixed +BLOCK_NUMBER=21882667 # switch to +nightly-2025-08-19 if using tco TOOLCHAIN="+nightly-2025-08-19" # "+stable" BIN_NAME="openvm-reth-benchmark-bin" @@ -34,49 +37,54 @@ VPMM_PAGE_SIZE=$((4 << 20)) VPMM_PAGES=$((12 * $MAX_SEGMENT_LENGTH/ $VPMM_PAGE_SIZE)) if [ "$USE_CUDA" = "true" ]; then - FEATURES="$FEATURES,cuda" + FEATURES="$FEATURES,cuda" else - FEATURES="$FEATURES,nightly-features" + FEATURES="$FEATURES,nightly-features" fi if [ "$MODE" = "prove-evm" ]; then - FEATURES="$FEATURES,evm-verify" + FEATURES="$FEATURES,evm-verify" +fi + +if grep -m1 -q 'avx512f' /proc/cpuinfo; then + RUSTFLAGS="-Ctarget-cpu=native -C target-feature=+avx512f" +else + RUSTFLAGS="-Ctarget-cpu=native" fi -arch=$(uname -m) -case $arch in -arm64|aarch64) - RUSTFLAGS="-Ctarget-cpu=native" - ;; -x86_64|amd64) - RUSTFLAGS="-Ctarget-cpu=native" - ;; -*) -echo "Unsupported architecture: $arch" -exit 1 -;; -esac export JEMALLOC_SYS_WITH_MALLOC_CONF="retain:true,background_thread:true,metadata_thp:always,dirty_decay_ms:10000,muzzy_decay_ms:10000,abort_conf:true" RUSTFLAGS=$RUSTFLAGS cargo $TOOLCHAIN build --bin $BIN_NAME --profile=$PROFILE --no-default-features --features=$FEATURES PARAMS_DIR="$HOME/.openvm/params/" # Use target/debug if profile is dev if [ "$PROFILE" = "dev" ]; then - TARGET_DIR="debug" + TARGET_DIR="debug" else - TARGET_DIR="$PROFILE" + TARGET_DIR="$PROFILE" fi -RUST_LOG="info,p3_=warn" OUTPUT_PATH="metrics.json" VPMM_PAGES=$VPMM_PAGES VPMM_PAGE_SIZE=$VPMM_PAGE_SIZE ./target/$TARGET_DIR/$BIN_NAME \ ---kzg-params-dir $PARAMS_DIR \ ---mode $MODE \ ---block-number $BLOCK_NUMBER \ ---rpc-url $RPC_1 \ ---cache-dir rpc-cache \ ---app-log-blowup 1 \ ---leaf-log-blowup 1 \ ---internal-log-blowup 2 \ ---root-log-blowup 3 \ ---max-segment-length $MAX_SEGMENT_LENGTH \ ---segment-max-cells $SEGMENT_MAX_CELLS \ ---num-children-leaf 1 \ ---num-children-internal 3 +# Default options if not set +: "${APC_SETUP_NAME:=my-setup}" +: "${MODE:=execute}" +: "${APC:=0}" +: "${APC_SKIP:=0}" +: "${PGO_TYPE:=cell}" + +POWDR_APC_CANDIDATES_DIR=apcs RUST_LOG="debug" OUTPUT_PATH="metrics.json" VPMM_PAGES=$VPMM_PAGES VPMM_PAGE_SIZE=$VPMM_PAGE_SIZE ./target/$TARGET_DIR/$BIN_NAME \ + --kzg-params-dir $PARAMS_DIR \ + --mode $MODE \ + --block-number $BLOCK_NUMBER \ + --rpc-url $RPC_1 \ + --cache-dir rpc-cache \ + --app-log-blowup 1 \ + --leaf-log-blowup 1 \ + --internal-log-blowup 2 \ + --root-log-blowup 3 \ + --max-segment-length $MAX_SEGMENT_LENGTH \ + --segment-max-cells $SEGMENT_MAX_CELLS \ + --num-children-leaf 1 \ + --num-children-internal 3 \ + --apc-cache-dir apc-cache \ + --apc-setup-name ${APC_SETUP_NAME}_${APC}_${APC_SKIP}_${PGO_TYPE}_${BLOCK_NUMBER} \ + --apc "$APC" \ + --apc-skip "$APC_SKIP" \ + --pgo-type "$PGO_TYPE"