From d40fcd65d1e4c7906c09a0be74653b3f57ed6b42 Mon Sep 17 00:00:00 2001 From: Nikolaus Heger Date: Mon, 31 Aug 2026 23:55:10 +0800 Subject: [PATCH 1/2] Bump zk-circuits crates to 4.3.0 input_amount moves from PrivateCircuitInputs to PublicCircuitInputs per the 4.3.0 leaf layout (22nd public input, aggregate per-segment fee enforcement). --- Cargo.lock | 48 ++++++++++++++++++++++----------------------- Cargo.toml | 16 +++++++-------- src/wormhole_lib.rs | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f3b42a..ba32e50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1170,7 +1170,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1738,7 +1738,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1963,7 +1963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3903,7 +3903,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4775,9 +4775,9 @@ dependencies = [ [[package]] name = "qp-wormhole-aggregator" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36c1e817cba09384f092f6f1cda8016cc39637c878c1b80788d8c7d5bd75b40" +checksum = "6604a9d9248e3270d330155fc27a4a84b382849b2aecb1f92a110511314fe07b" dependencies = [ "anyhow", "hex", @@ -4794,9 +4794,9 @@ dependencies = [ [[package]] name = "qp-wormhole-circuit" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418648e0835bb47c7e6fa908bce246e9e9fce042f857b15e652b2591ff869e76" +checksum = "55167daf965a3616b74184171148b94c64b3a48771d6433a1a43377a6e46c6e8" dependencies = [ "anyhow", "hex", @@ -4808,9 +4808,9 @@ dependencies = [ [[package]] name = "qp-wormhole-circuit-builder" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0716238af4fa0c0efdf06f30ccbff90534c0d9e700c3d90aa9d3be79fb10d2fe" +checksum = "f4fe35e0d8ad019e37e447e092da348fe4c52ae691d84dfd919fc9b58e7effe5" dependencies = [ "anyhow", "clap", @@ -4823,18 +4823,18 @@ dependencies = [ [[package]] name = "qp-wormhole-inputs" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385fee220d58083a3c833ff9ee87c2346f77c7e869f35bbe12ecd8dad3d076f" +checksum = "9c07863a2211a17b46319289c5ef22e5670a3fb8653386bb366c418193254793" dependencies = [ "anyhow", ] [[package]] name = "qp-wormhole-prover" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c90421378b57eeb08f3e60f426aa861b2ad741942dcd795c43b5665171026a" +checksum = "7203e454113812e1ca85aee7687dc5f270f7c297d113a647a3a00b6d43c5a4f6" dependencies = [ "anyhow", "qp-plonky2", @@ -4844,9 +4844,9 @@ dependencies = [ [[package]] name = "qp-wormhole-verifier" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fce3fa8c1866b7c0d4279e2d004d1b3959eb8d5e67d656c738725b8ac039d9" +checksum = "677a24da8f5a55f52d7dab865d8d70f3f501f26a85c1ab086684fa1f16b8a671" dependencies = [ "anyhow", "qp-plonky2-verifier", @@ -4856,9 +4856,9 @@ dependencies = [ [[package]] name = "qp-zk-circuits-common" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78477b533829319a41b946bf8bdc1bc778f9ed1806f156eb584aa3a6ff764b3b" +checksum = "dec45510701f160fdb730bdb622d6cdd0a62547e607c9b1ecb19558202797f81" dependencies = [ "anyhow", "qp-plonky2", @@ -5000,7 +5000,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5430,7 +5430,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -5510,7 +5510,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs 1.0.9", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -7014,7 +7014,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix 1.1.4", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -7497,7 +7497,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.4", "digest 0.10.7", "rand 0.8.6", "static_assertions", @@ -8129,7 +8129,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2e4df32..8243fb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,13 +121,13 @@ anyhow = "1.0" qp-plonky2 = { version = "1.5.5", default-features = false, features = ["rand", "std"] } qp-plonky2-verifier = { version = "1.5.5", default-features = false } -qp-wormhole-aggregator = { version = "4.2.0", default-features = false, features = ["rayon", "std"] } -qp-wormhole-circuit = { version = "4.2.0", default-features = false, features = ["std"] } -qp-wormhole-circuit-builder = { version = "4.2.0" } -qp-wormhole-inputs = { version = "4.2.0", default-features = false, features = ["std"] } -qp-wormhole-prover = { version = "4.2.0", default-features = false, features = ["std"] } -qp-wormhole-verifier = { version = "4.2.0", default-features = false, features = ["std"] } -qp-zk-circuits-common = { version = "4.2.0", default-features = false, features = ["std"] } +qp-wormhole-aggregator = { version = "4.3.0", default-features = false, features = ["rayon", "std"] } +qp-wormhole-circuit = { version = "4.3.0", default-features = false, features = ["std"] } +qp-wormhole-circuit-builder = { version = "4.3.0" } +qp-wormhole-inputs = { version = "4.3.0", default-features = false, features = ["std"] } +qp-wormhole-prover = { version = "4.3.0", default-features = false, features = ["std"] } +qp-wormhole-verifier = { version = "4.3.0", default-features = false, features = ["std"] } +qp-zk-circuits-common = { version = "4.3.0", default-features = false, features = ["std"] } [target.'cfg(unix)'.dependencies] libc = "0.2" @@ -135,7 +135,7 @@ libc = "0.2" [build-dependencies] hex = "0.4" qp-poseidon-core = "3.1.0" -qp-wormhole-circuit-builder = { version = "4.2.0" } +qp-wormhole-circuit-builder = { version = "4.3.0" } sha2 = "0.10" [dev-dependencies] diff --git a/src/wormhole_lib.rs b/src/wormhole_lib.rs index 5f86aff..5b56ba4 100644 --- a/src/wormhole_lib.rs +++ b/src/wormhole_lib.rs @@ -324,6 +324,7 @@ fn generate_proof_inner(input: &ProofGenerationInput) -> Result Result Date: Tue, 1 Sep 2026 00:44:01 +0800 Subject: [PATCH 2/2] Update public-inputs layout test for the 22-felt 4.3.0 leaf interface --- src/cli/wormhole.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cli/wormhole.rs b/src/cli/wormhole.rs index 7e5a61b..c395565 100644 --- a/src/cli/wormhole.rs +++ b/src/cli/wormhole.rs @@ -4786,13 +4786,13 @@ mod tests { use qp_wormhole_inputs::{ ASSET_ID_INDEX, BLOCK_HASH_END_INDEX, BLOCK_HASH_START_INDEX, BLOCK_NUMBER_INDEX, EXIT_ACCOUNT_1_END_INDEX, EXIT_ACCOUNT_1_START_INDEX, EXIT_ACCOUNT_2_END_INDEX, - EXIT_ACCOUNT_2_START_INDEX, NULLIFIER_END_INDEX, NULLIFIER_START_INDEX, - OUTPUT_AMOUNT_1_INDEX, OUTPUT_AMOUNT_2_INDEX, PUBLIC_INPUTS_FELTS_LEN, - VOLUME_FEE_BPS_INDEX, + EXIT_ACCOUNT_2_START_INDEX, INPUT_AMOUNT_INDEX, NULLIFIER_END_INDEX, + NULLIFIER_START_INDEX, OUTPUT_AMOUNT_1_INDEX, OUTPUT_AMOUNT_2_INDEX, + PUBLIC_INPUTS_FELTS_LEN, VOLUME_FEE_BPS_INDEX, }; // Verify expected public inputs layout for dual-output circuit - assert_eq!(PUBLIC_INPUTS_FELTS_LEN, 21, "Public inputs should be 21 field elements"); + assert_eq!(PUBLIC_INPUTS_FELTS_LEN, 22, "Public inputs should be 22 field elements"); assert_eq!(ASSET_ID_INDEX, 0, "Asset ID should be first"); assert_eq!(OUTPUT_AMOUNT_1_INDEX, 1, "Output amount 1 should be at index 1"); assert_eq!(OUTPUT_AMOUNT_2_INDEX, 2, "Output amount 2 should be at index 2"); @@ -4806,6 +4806,7 @@ mod tests { assert_eq!(BLOCK_HASH_START_INDEX, 16, "Block hash should start at index 16"); assert_eq!(BLOCK_HASH_END_INDEX, 20, "Block hash should end at index 20"); assert_eq!(BLOCK_NUMBER_INDEX, 20, "Block number should be at index 20"); + assert_eq!(INPUT_AMOUNT_INDEX, 21, "Input amount should be at index 21"); } /// Test that constants match expected on-chain configuration