Skip to content

Commit aa2a329

Browse files
committed
Refactor recursive verification tests and deployment process
- Updated the deployment of the ValueNotEqual contract to include vkHash as a parameter. - Replaced PXE client setup with TestWallet and Aztec Node client for better integration. - Introduced SponsoredFeePaymentMethod for fee management during contract interactions. - Enhanced test timeout to accommodate longer proof generation and verification times. - Modified account creation and contract deployment processes to utilize the new TestWallet structure. - Ensured separate counters for different users by creating distinct accounts for user1.
1 parent aea3916 commit aa2a329

File tree

5 files changed

+321
-244
lines changed

5 files changed

+321
-244
lines changed

recursive_verification/bun.lockb

23.5 KB
Binary file not shown.

recursive_verification/contract/src/main.nr

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,33 @@ pub contract ValueNotEqual {
66
global HONK_PROOF_SIZE: u32 = 492 + 16;
77

88
use aztec::{
9-
macros::{functions::{external, initializer}, storage::storage},
9+
macros::{functions::{external, initializer, internal}, storage::storage},
1010
oracle::debug_log::debug_log_format,
1111
protocol_types::{address::AztecAddress, traits::ToField},
12-
state_vars::Map,
12+
state_vars::{Map, PublicImmutable},
1313
};
1414
use bb_proof_verification::verify_ultrahonkzk_proof;
1515
use easy_private_state::EasyPrivateUint;
1616

1717
#[storage]
1818
struct Storage<Context> {
1919
counters: Map<AztecAddress, EasyPrivateUint<Context>, Context>,
20+
vk_hash: PublicImmutable<Field, Context>,
2021
}
2122

2223
#[initializer]
2324
#[external("private")]
24-
fn initialize(headstart: u64, owner: AztecAddress) {
25+
fn initialize(headstart: u64, owner: AztecAddress, vk_hash: Field) {
2526
let counters = storage.counters;
2627
counters.at(owner).add(headstart, owner);
28+
29+
ValueNotEqual::at(context.this_address())._set_vk_hash(vk_hash).enqueue(&mut context);
30+
}
31+
32+
#[internal]
33+
#[external("public")]
34+
fn _set_vk_hash(vk_hash: Field) {
35+
storage.vk_hash.initialize(vk_hash);
2736
}
2837

2938
#[external("private")]
@@ -32,9 +41,9 @@ pub contract ValueNotEqual {
3241
verification_key: [Field; HONK_VK_SIZE],
3342
proof: [Field; HONK_PROOF_SIZE],
3443
public_inputs: [Field; 1],
35-
vk_hash: Field,
3644
) {
3745
debug_log_format("Incrementing counter for owner {0}", [owner.to_field()]);
46+
let vk_hash = storage.vk_hash.read();
3847
verify_ultrahonkzk_proof(verification_key, proof, public_inputs, vk_hash);
3948
ValueNotEqual::at(context.this_address()).emit_in_public(12345).enqueue(&mut context);
4049
let counters = storage.counters;

0 commit comments

Comments
 (0)