27 bool write =
event.append_data.has_value();
29 FF note_hash =
event.note_hash;
30 FF siloed_note_hash =
event.note_hash;
31 FF unique_note_hash =
event.note_hash;
33 bool should_silo =
false;
37 bool should_unique =
false;
38 uint64_t note_hash_counter = 0;
40 FF first_nullifier = 0;
47 siloed_note_hash = append_data.
siloing_data->siloed_note_hash;
59 FF prev_leaf_value =
event.existing_leaf_value;
60 bool exists = prev_leaf_value == unique_note_hash;
61 FF prev_leaf_value_unique_note_hash_diff_inv =
exists ? 0 : (prev_leaf_value - unique_note_hash).invert();
64 { { { C::note_hash_tree_check_sel, 1 },
65 { C::note_hash_tree_check_write,
write },
66 { C::note_hash_tree_check_exists,
exists },
67 { C::note_hash_tree_check_note_hash, note_hash },
68 { C::note_hash_tree_check_leaf_index,
event.leaf_index },
69 { C::note_hash_tree_check_prev_root,
event.prev_snapshot.root },
70 { C::note_hash_tree_check_should_silo, should_silo },
71 { C::note_hash_tree_check_address, address },
72 { C::note_hash_tree_check_should_unique, should_unique },
73 { C::note_hash_tree_check_note_hash_index, note_hash_counter },
74 { C::note_hash_tree_check_discard,
discard },
75 { C::note_hash_tree_check_next_root, next_root },
76 { C::note_hash_tree_check_siloed_note_hash, siloed_note_hash },
78 { C::note_hash_tree_check_unique_note_hash, unique_note_hash },
79 { C::note_hash_tree_check_first_nullifier_pi_index,
81 { C::note_hash_tree_check_first_nullifier, first_nullifier },
82 { C::note_hash_tree_check_nonce, nonce },
85 { C::note_hash_tree_check_prev_leaf_value, prev_leaf_value },
86 { C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv,
87 prev_leaf_value_unique_note_hash_diff_inv },
88 { C::note_hash_tree_check_next_leaf_value,
write ? unique_note_hash : 0 },
90 { C::note_hash_tree_check_should_write_to_public_inputs,
write && (!
discard) },
91 { C::note_hash_tree_check_public_inputs_index,