From fc25195d147ae2fb7d4c2ab9c150ceb739d51b8e Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 3 Jun 2026 15:55:58 +0900 Subject: [PATCH 1/4] Update Orchard circuits to halo2_gadgets 0.5 --- Cargo.lock | 314 ++++++++++++++++++++++++++++++++------ Cargo.toml | 10 +- README.md | 2 +- src/delegation/circuit.rs | 4 +- src/vote_proof/circuit.rs | 4 +- 5 files changed, 280 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee3c400a..3df72ba4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,11 +71,26 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "bech32" @@ -119,9 +134,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "byteorder" @@ -146,9 +161,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.61" +version = "1.2.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" +checksum = "556e016178bb5662a08681bbe0f00f8e17631781a4dfc8c45e466e4b185ec27f" dependencies = [ "find-msvc-tools", "shlex", @@ -247,6 +262,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror", +] + +[[package]] +name = "const-crc32-nostd" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808ac43170e95b11dd23d78aa9eaac5bea45776a602955552c4e833f3f0f823d" + [[package]] name = "constant_time_eq" version = "0.4.2" @@ -303,6 +333,12 @@ dependencies = [ "itertools 0.13.0", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -344,11 +380,43 @@ dependencies = [ "typenum", ] +[[package]] +name = "derive-getters" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] name = "ff" @@ -381,12 +449,71 @@ dependencies = [ "num-traits", ] +[[package]] +name = "frost-core" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ef2787af391c7e8bedc037a3b9ea03dde803fbd93e778e6bb369547800e5cd" +dependencies = [ + "byteorder", + "const-crc32-nostd", + "derive-getters", + "document-features", + "hex", + "itertools 0.14.0", + "postcard", + "rand_core", + "serde", + "serdect", + "thiserror", + "visibility", + "zeroize", + "zeroize_derive", +] + +[[package]] +name = "frost-rerandomized" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4c5cedd2426728adef2c0b1720f57676354c473836d1ccc50d0f0d1c91942b" +dependencies = [ + "derive-getters", + "document-features", + "frost-core", + "hex", + "rand_core", +] + [[package]] name = "funty" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -445,9 +572,9 @@ dependencies = [ [[package]] name = "halo2_gadgets" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45824ce0dd12e91ec0c68ebae2a7ed8ae19b70946624c849add59f1d1a62a143" +checksum = "fb2a697cad929f706b7987fe804ad57d43622cd37463ba7e4d662a926fdcfea3" dependencies = [ "arrayvec", "bitvec", @@ -498,12 +625,35 @@ dependencies = [ "tracing", ] +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + [[package]] name = "hex" version = "0.4.3" @@ -513,8 +663,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "imt-tree" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c378a3c5c44b985233906c966bd82a4f775a83aa4e1bde1635961c2eb8673d7b" +source = "git+https://github.com/valargroup/vote-nullifier-pir.git?branch=codex%2Fhalo2-gadgets-0.5-imt-tree#8bf777c3abeceac8be9be94aaff37afd2c948658" dependencies = [ "anyhow", "ff", @@ -578,10 +727,12 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] @@ -621,6 +772,21 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + [[package]] name = "maybe-rayon" version = "0.1.1" @@ -633,9 +799,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" [[package]] name = "memuse" @@ -697,9 +863,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "orchard" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497e74492624a1d1cc8c9675a7afb17b430d32fd9efc171513d0840140b5f0c7" +checksum = "a54f8d29bfb1e76a9d4e868a1a08cce2e57dd2bdc66232982822ad3114b91ab3" dependencies = [ "aes", "bitvec", @@ -801,6 +967,19 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "serde", +] + [[package]] name = "ppv-lite86" version = "0.2.21" @@ -908,12 +1087,13 @@ dependencies = [ [[package]] name = "reddsa" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a5191930e84973293aa5f532b513404460cd2216c1cfb76d08748c15b40b02" +checksum = "4784b85c8bfd17b36b86e664e6e504ecdb586001086ee23749e4a633bbb84832" dependencies = [ "blake2b_simd", "byteorder", + "frost-rerandomized", "group", "hex", "jubjub", @@ -953,6 +1133,15 @@ version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustversion" version = "1.0.22" @@ -968,6 +1157,18 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + [[package]] name = "serde" version = "1.0.228" @@ -1000,9 +1201,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -1011,11 +1212,21 @@ dependencies = [ "zmij", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "sinsemilla" @@ -1028,11 +1239,26 @@ dependencies = [ "subtle", ] +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "static_assertions" @@ -1065,18 +1291,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.69" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", @@ -1126,9 +1352,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.20.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "uint" @@ -1214,9 +1440,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" dependencies = [ "cfg-if", "once_cell", @@ -1227,9 +1453,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1237,9 +1463,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" dependencies = [ "bumpalo", "proc-macro2", @@ -1250,18 +1476,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.95" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" dependencies = [ "js-sys", "wasm-bindgen", @@ -1346,18 +1572,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "3b065d4f0e55f82fae73202e189638116a87c55ab6b8e6c2721e13dd9d854ad1" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "0b631b19d36a892ab55420c92dbc83ccd79274f25be714855d3074aa71cab639" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 3c298a07..0eacf6cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,12 +9,12 @@ repository = "https://github.com/valargroup/voting-circuits" readme = "README.md" [dependencies] -# orchard 0.13.1 declares the MSRV and exposes the unstable governance circuit APIs. -orchard = { version = "0.13.1", features = ["circuit", "unstable-voting-circuits"] } +# orchard 0.14 declares the MSRV and exposes the unstable governance circuit APIs. +orchard = { version = "0.14", features = ["circuit", "unstable-voting-circuits"] } # halo2_proofs 0.3 fixes the proof-system API and batch verifier used by all circuits. halo2_proofs = { version = "0.3", default-features = false, features = ["batch", "floor-planner-v1-legacy-pdqsort"] } -# halo2_gadgets 0.4 supplies ECC, Sinsemilla, Poseidon helpers, bool_check, and range checks that shape the verifying keys. -halo2_gadgets = { version = "0.4", default-features = false } +# halo2_gadgets 0.5 supplies ECC, Sinsemilla, Poseidon helpers, bool_check, and range checks that shape the verifying keys. +halo2_gadgets = { version = "=0.5.0", default-features = false } # pasta_curves/ff/group are the Pallas/Vesta field and trait line used by orchard and halo2. pasta_curves = "0.5" ff = { version = "0.13", default-features = false } @@ -34,7 +34,7 @@ itertools = "0.14.0" # Reference IMT implementation used by integration tests to cross-check the # in-tree provider. Keep exact-pinned so patch releases cannot silently move # tree semantics without updating the equivalence tests. -imt-tree = "=0.1.1" +imt-tree = { git = "https://github.com/valargroup/vote-nullifier-pir.git", branch = "codex/halo2-gadgets-0.5-imt-tree", version = "=0.1.1" } criterion = "0.8" rand = "0.8" incrementalmerkletree = "0.8.1" diff --git a/README.md b/README.md index 7ccae09e..c9afa8ea 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Reusable halo2 gadgets that appear in more than one circuit: ## Dependency on `orchard` -This crate depends on upstream [`zcash/orchard`](https://github.com/zcash/orchard) `0.13.1` from crates.io, allowing compatible patch releases, with the `unstable-voting-circuits` feature enabled to expose the governance-visibility APIs the voting circuits rely on. The previous `valar-orchard` fork has been retired. +This crate depends on upstream [`zcash/orchard`](https://github.com/zcash/orchard) `0.14` from crates.io, allowing compatible patch releases, with the `unstable-voting-circuits` feature enabled to expose the governance-visibility APIs the voting circuits rely on. The previous `valar-orchard` fork has been retired. ## Building diff --git a/src/delegation/circuit.rs b/src/delegation/circuit.rs index 74ac77f4..0ecae321 100644 --- a/src/delegation/circuit.rs +++ b/src/delegation/circuit.rs @@ -34,7 +34,7 @@ use group::{Curve, GroupEncoding}; use halo2_gadgets::{ ecc::{ chip::{EccChip, EccConfig}, - NonIdentityPoint, Point, ScalarFixed, ScalarVar, + CircuitVersion, NonIdentityPoint, Point, ScalarFixed, ScalarVar, }, poseidon::{ primitives::{self as poseidon, ConstantLength}, @@ -296,7 +296,7 @@ impl Config { } fn ecc_chip(&self) -> EccChip { - EccChip::construct(self.ecc_config.clone()) + EccChip::construct(self.ecc_config.clone(), CircuitVersion::AnchoredBase) } // Operating over the Pallas base field, with a width of 3 (state size) and rate of 2 diff --git a/src/vote_proof/circuit.rs b/src/vote_proof/circuit.rs index 655b7acd..9be9ab2b 100644 --- a/src/vote_proof/circuit.rs +++ b/src/vote_proof/circuit.rs @@ -55,7 +55,7 @@ use std::vec::Vec; use halo2_gadgets::{ ecc::{ chip::{EccChip, EccConfig}, - NonIdentityPoint, ScalarFixed, + CircuitVersion, NonIdentityPoint, ScalarFixed, }, poseidon::{ primitives::{self as poseidon, ConstantLength}, @@ -312,7 +312,7 @@ impl Config { /// Constructs an ECC chip for curve operations (conditions 3, 11). fn ecc_chip(&self) -> EccChip { - EccChip::construct(self.ecc_config.clone()) + EccChip::construct(self.ecc_config.clone(), CircuitVersion::AnchoredBase) } /// Constructs a Sinsemilla chip (condition 3: CommitIvk). From b5d29e1245df45ddfba1136938585688ba032ffa Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 3 Jun 2026 16:16:45 +0900 Subject: [PATCH 2/4] Use merged imt-tree 0.2.0 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3df72ba4..a2e69013 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -662,8 +662,8 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "imt-tree" -version = "0.1.1" -source = "git+https://github.com/valargroup/vote-nullifier-pir.git?branch=codex%2Fhalo2-gadgets-0.5-imt-tree#8bf777c3abeceac8be9be94aaff37afd2c948658" +version = "0.2.0" +source = "git+https://github.com/valargroup/vote-nullifier-pir.git#d8891d369c697aac077fa40052ab9248e4957608" dependencies = [ "anyhow", "ff", diff --git a/Cargo.toml b/Cargo.toml index 0eacf6cd..076f2886 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ itertools = "0.14.0" # Reference IMT implementation used by integration tests to cross-check the # in-tree provider. Keep exact-pinned so patch releases cannot silently move # tree semantics without updating the equivalence tests. -imt-tree = { git = "https://github.com/valargroup/vote-nullifier-pir.git", branch = "codex/halo2-gadgets-0.5-imt-tree", version = "=0.1.1" } +imt-tree = { git = "https://github.com/valargroup/vote-nullifier-pir.git", version = "=0.2.0" } criterion = "0.8" rand = "0.8" incrementalmerkletree = "0.8.1" From ca95582b528dcf028725e0c44cde2b167b923703 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 3 Jun 2026 16:23:11 +0900 Subject: [PATCH 3/4] Use published imt-tree 0.2.0 --- Cargo.lock | 3 ++- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2e69013..c251ea8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -663,7 +663,8 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "imt-tree" version = "0.2.0" -source = "git+https://github.com/valargroup/vote-nullifier-pir.git#d8891d369c697aac077fa40052ab9248e4957608" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d0a4887bb71d68b3d0c5db9d42bb76df38b0dff4d261b863dada6383b6c2012" dependencies = [ "anyhow", "ff", diff --git a/Cargo.toml b/Cargo.toml index 076f2886..683c4683 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ itertools = "0.14.0" # Reference IMT implementation used by integration tests to cross-check the # in-tree provider. Keep exact-pinned so patch releases cannot silently move # tree semantics without updating the equivalence tests. -imt-tree = { git = "https://github.com/valargroup/vote-nullifier-pir.git", version = "=0.2.0" } +imt-tree = "=0.2.0" criterion = "0.8" rand = "0.8" incrementalmerkletree = "0.8.1" From de0bfc17c9ff7fd4ebc93abec03410963a338250 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 3 Jun 2026 16:30:24 +0900 Subject: [PATCH 4/4] Bump voting-circuits to 0.8.0 --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06548f39..a3dd9719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## v0.8.0 + +### Changed + +- Updated the Orchard circuit dependency line to `orchard 0.14` and + `halo2_gadgets =0.5.0`. +- Updated the IMT reference dependency to published `imt-tree 0.2.0`. + ## v0.7.0 ### Documented diff --git a/Cargo.lock b/Cargo.lock index c251ea8e..769686da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "voting-circuits" -version = "0.7.0" +version = "0.8.0" dependencies = [ "blake2b_simd", "criterion", diff --git a/Cargo.toml b/Cargo.toml index 683c4683..220f5e18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "voting-circuits" -version = "0.7.0" +version = "0.8.0" edition = "2021" rust-version = "1.86.0" description = "Governance ZKP circuits (delegation, vote proof, share reveal) for the Zcash shielded-voting protocol."