diff --git a/Cargo.lock b/Cargo.lock index dfdd9aec..39a14dd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1311,7 +1311,7 @@ dependencies = [ [[package]] name = "arm" version = "0.7.0" -source = "git+https://github.com/anoma/arm-risc0.git?rev=1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8#1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8" +source = "git+https://github.com/anoma/arm-risc0.git?rev=b4810fad7bb5dee1b0314d96854137d0e6bd5dbd#b4810fad7bb5dee1b0314d96854137d0e6bd5dbd" dependencies = [ "aes-gcm", "alloy-primitives", @@ -1324,6 +1324,7 @@ dependencies = [ "rand 0.8.5", "risc0-zkvm", "serde", + "serde_with", "sha3", "thiserror 2.0.16", ] @@ -5980,9 +5981,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.14.0" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +checksum = "c522100790450cf78eeac1507263d0a350d4d5b30df0c8e1fe051a10c22b376e" dependencies = [ "base64", "chrono", @@ -6000,11 +6001,11 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.14.0" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +checksum = "327ada00f7d64abaac1e55a6911e90cf665aa051b9a561c7006c157f4633135e" dependencies = [ - "darling 0.20.11", + "darling 0.21.3", "proc-macro2", "quote", "syn 2.0.106", @@ -6087,7 +6088,7 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "simple-transfer-app" version = "0.1.0" -source = "git+https://github.com/anoma/arm-risc0.git?rev=1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8#1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8" +source = "git+https://github.com/anoma/arm-risc0.git?rev=b4810fad7bb5dee1b0314d96854137d0e6bd5dbd#b4810fad7bb5dee1b0314d96854137d0e6bd5dbd" dependencies = [ "arm", "hex", @@ -6101,7 +6102,7 @@ dependencies = [ [[package]] name = "simple-transfer-witness" version = "0.1.0" -source = "git+https://github.com/anoma/arm-risc0.git?rev=1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8#1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8" +source = "git+https://github.com/anoma/arm-risc0.git?rev=b4810fad7bb5dee1b0314d96854137d0e6bd5dbd#b4810fad7bb5dee1b0314d96854137d0e6bd5dbd" dependencies = [ "arm", "rand 0.8.5", diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 5155d58f..92d7b4df 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0-beta" edition = "2024" [dependencies] -arm_risc0 = { git = "https://github.com/anoma/arm-risc0.git", rev = "1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8", package = "arm", features = [ +arm_risc0 = { git = "https://github.com/anoma/arm-risc0.git", rev = "b4810fad7bb5dee1b0314d96854137d0e6bd5dbd", package = "arm", features = [ #"groth16_prover", # Add this feature to generate regular transactions. Note that proof aggregation won't work. "groth16_aggregation", "bonsai", @@ -14,7 +14,7 @@ alloy = { version = "1.0.30", features = ["full", "eip712", "node-bindings"] } tokio = { version = "1.44", features = ["rt-multi-thread"] } serde = { version = "1.0.197", default-features = false } sha2 = { version = "0.10.9" } -simple_transfer_app = { git = "https://github.com/anoma/arm-risc0.git", rev = "1379cbaa2db78e94c4d32fdcfd2c97cd7195d6d8", package = "simple-transfer-app" } +simple_transfer_app = { git = "https://github.com/anoma/arm-risc0.git", rev = "b4810fad7bb5dee1b0314d96854137d0e6bd5dbd", package = "simple-transfer-app" } diff --git a/contracts/src/ProtocolAdapter.sol b/contracts/src/ProtocolAdapter.sol index 7f30065e..42e824c2 100644 --- a/contracts/src/ProtocolAdapter.sol +++ b/contracts/src/ProtocolAdapter.sol @@ -336,7 +336,7 @@ contract ProtocolAdapter is // Aggregate the compliance instance if (isProofAggregated) { - encodedJournal = abi.encodePacked(RiscZeroUtils._COMPLIANCE_INSTANCE_PADDING, journal); + encodedJournal = journal; } // Verify the compliance proof. else { diff --git a/contracts/src/libs/RiscZeroUtils.sol b/contracts/src/libs/RiscZeroUtils.sol index 3481c9c6..6f3e38c7 100644 --- a/contracts/src/libs/RiscZeroUtils.sol +++ b/contracts/src/libs/RiscZeroUtils.sol @@ -14,12 +14,6 @@ library RiscZeroUtils { using RiscZeroUtils for bytes; using RiscZeroUtils for bool; - /// @notice The RISC Zero padding bytes for the compliance instance obtained from its length (`7 * 32 bytes`) - /// divided by 4 (bytes) representing the number of RISC Zero words in little-endian order - /// (https://dev.risczero.com/api/zkvm/optimization#unaligned-data-access-is-significantly-more-expensive). - /// @dev `uint32(56).toRiscZero() = bytes4(0x38000000)` - bytes4 internal constant _COMPLIANCE_INSTANCE_PADDING = bytes4(0x38000000); - /// @notice Converts the compliance instance to the RISC Zero journal format. /// @param instance The compliance instance. /// @return journal The resulting RISC Zero journal. diff --git a/contracts/src/proving/Aggregation.sol b/contracts/src/proving/Aggregation.sol index d6292bac..6b7a411d 100644 --- a/contracts/src/proving/Aggregation.sol +++ b/contracts/src/proving/Aggregation.sol @@ -14,5 +14,5 @@ library Aggregation { /// @notice The aggregation verifying key. /// @dev The key is fixed as long as the aggregation circuit binary is not changed. - bytes32 internal constant _VERIFYING_KEY = 0x96dcbee66a8780979442bd2abc2f7373957e450336f377704041ba6f9b95ff6a; + bytes32 internal constant _VERIFYING_KEY = 0xa9c9a22ee9df47fd35ed2b319cd272c3f328a171ea04dab5e44ee15e33f5b9ce; } diff --git a/contracts/test/examples/transactions/test_tx_agg_01.bin b/contracts/test/examples/transactions/test_tx_agg_01.bin index 35b7ebc5..f25b0dc6 100644 Binary files a/contracts/test/examples/transactions/test_tx_agg_01.bin and b/contracts/test/examples/transactions/test_tx_agg_01.bin differ diff --git a/contracts/test/examples/transactions/test_tx_agg_05.bin b/contracts/test/examples/transactions/test_tx_agg_05.bin index 8c802e31..9750a291 100644 Binary files a/contracts/test/examples/transactions/test_tx_agg_05.bin and b/contracts/test/examples/transactions/test_tx_agg_05.bin differ diff --git a/contracts/test/examples/transactions/test_tx_agg_10.bin b/contracts/test/examples/transactions/test_tx_agg_10.bin index 4b33a0ae..4228f233 100644 Binary files a/contracts/test/examples/transactions/test_tx_agg_10.bin and b/contracts/test/examples/transactions/test_tx_agg_10.bin differ diff --git a/contracts/test/examples/transactions/test_tx_agg_15.bin b/contracts/test/examples/transactions/test_tx_agg_15.bin index d3027be1..9775f39f 100644 Binary files a/contracts/test/examples/transactions/test_tx_agg_15.bin and b/contracts/test/examples/transactions/test_tx_agg_15.bin differ diff --git a/contracts/test/examples/transactions/test_tx_agg_20.bin b/contracts/test/examples/transactions/test_tx_agg_20.bin index d461e883..7f0c4078 100644 Binary files a/contracts/test/examples/transactions/test_tx_agg_20.bin and b/contracts/test/examples/transactions/test_tx_agg_20.bin differ diff --git a/contracts/test/proofs/RiscZeroUtils.t.sol b/contracts/test/proofs/RiscZeroUtils.t.sol deleted file mode 100644 index e515b055..00000000 --- a/contracts/test/proofs/RiscZeroUtils.t.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.30; - -import {Test} from "forge-std/Test.sol"; - -import {RiscZeroUtils} from "../../src/libs/RiscZeroUtils.sol"; - -contract RiscZeroUtilsTest is Test { - using RiscZeroUtils for *; - - function test_compliance_instance_length_constant() public pure { - assertEq(RiscZeroUtils._COMPLIANCE_INSTANCE_PADDING, uint32(56).toRiscZero()); - } -}