Skip to content

Commit

Permalink
feat: updating txs hash
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Feb 22, 2024
1 parent c5eeb4c commit 498b540
Show file tree
Hide file tree
Showing 28 changed files with 174 additions and 166 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ library Constants {
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_CALL = 16;
uint256 internal constant MAX_READ_REQUESTS_PER_CALL = 32;
uint256 internal constant MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL = 1;
uint256 internal constant MAX_NEW_COMMITMENTS_PER_TX = 64;
uint256 internal constant MAX_NEW_NOTE_HASHES_PER_TX = 64;
uint256 internal constant MAX_NON_REVERTIBLE_COMMITMENTS_PER_TX = 8;
uint256 internal constant MAX_REVERTIBLE_COMMITMENTS_PER_TX = 56;
uint256 internal constant MAX_NEW_NULLIFIERS_PER_TX = 64;
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/decoders/Decoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ library Decoder {

// Commitments
uint256 count = read4(_body, offset);
vars.baseLeaves = new bytes32[](count / Constants.MAX_NEW_COMMITMENTS_PER_TX);
vars.baseLeaves = new bytes32[](count / Constants.MAX_NEW_NOTE_HASHES_PER_TX);
offset += 0x4;
offsets.commitment = offset;
offset += count * 0x20;
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/decoders/TxsDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ library TxsDecoder {

// Commitments
uint256 count = read4(_body, offset);
vars.baseLeaves = new bytes32[](count / Constants.MAX_NEW_COMMITMENTS_PER_TX);
vars.baseLeaves = new bytes32[](count / Constants.MAX_NEW_NOTE_HASHES_PER_TX);
offsets.commitment = 0x4;
offset += 0x4 + count * 0x20;
offsets.nullifier = offset + 0x4; // + 0x4 to offset by next read4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl PrivateKernelInnerCircuitPrivateInputs {

mod tests {
use crate::private_kernel_inner::PrivateKernelInnerCircuitPrivateInputs;
use dep::types::constants::{MAX_READ_REQUESTS_PER_CALL, MAX_NEW_COMMITMENTS_PER_TX};
use dep::types::constants::{MAX_READ_REQUESTS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_TX};
use dep::types::{
abis::{
kernel_circuit_public_inputs::PrivateKernelInnerCircuitPublicInputs,
Expand Down Expand Up @@ -519,8 +519,8 @@ mod tests {
builder.private_call.public_inputs.new_commitments.push(SideEffect { value: 4321, counter: 0 });

// Mock the previous new commitments to be full, therefore no more commitments can be added.
let mut full_new_commitments = [SideEffect::empty(); MAX_NEW_COMMITMENTS_PER_TX];
for i in 0..MAX_NEW_COMMITMENTS_PER_TX {
let mut full_new_commitments = [SideEffect::empty(); MAX_NEW_NOTE_HASHES_PER_TX];
for i in 0..MAX_NEW_NOTE_HASHES_PER_TX {
full_new_commitments[i] = SideEffect {
value: i + 1,
counter: i as u32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use dep::types::{
side_effect::{SideEffect, SideEffectLinkedToNoteHash, Ordered}
},
constants::{
MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_READ_REQUESTS_PER_TX,
MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_READ_REQUESTS_PER_TX,
MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX,
MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX
},
Expand All @@ -19,8 +19,8 @@ use dep::types::{

struct PrivateKernelTailCircuitPrivateInputs {
previous_kernel: PrivateKernelInnerData,
sorted_new_commitments: [SideEffect; MAX_NEW_COMMITMENTS_PER_TX],
sorted_new_commitments_indexes: [u32; MAX_NEW_COMMITMENTS_PER_TX],
sorted_new_commitments: [SideEffect; MAX_NEW_NOTE_HASHES_PER_TX],
sorted_new_commitments_indexes: [u32; MAX_NEW_NOTE_HASHES_PER_TX],
read_commitment_hints: [Field; MAX_READ_REQUESTS_PER_TX],
sorted_new_nullifiers: [SideEffectLinkedToNoteHash; MAX_NEW_NULLIFIERS_PER_TX],
sorted_new_nullifiers_indexes: [u32; MAX_NEW_NULLIFIERS_PER_TX],
Expand Down Expand Up @@ -136,7 +136,7 @@ impl PrivateKernelTailCircuitPrivateInputs {
// 0-valued nullified_commitment is empty and will be ignored
if nullified_commitment != 0 {
assert(
hint_pos < MAX_NEW_COMMITMENTS_PER_TX as u64, "New nullifier is transient but hint is invalid"
hint_pos < MAX_NEW_NOTE_HASHES_PER_TX as u64, "New nullifier is transient but hint is invalid"
);
let commitment = new_commitments[hint_pos];
assert_eq(nullified_commitment, commitment.value, "Hinted commitment does not match");
Expand All @@ -157,7 +157,7 @@ impl PrivateKernelTailCircuitPrivateInputs {

let mut new_commitments_vec = BoundedVec::new(SideEffect::empty());

for c_idx in 0..MAX_NEW_COMMITMENTS_PER_TX {
for c_idx in 0..MAX_NEW_NOTE_HASHES_PER_TX {
if new_commitments[c_idx].value != 0 {
new_commitments_vec.push(new_commitments[c_idx]);
}
Expand All @@ -182,7 +182,7 @@ impl PrivateKernelTailCircuitPrivateInputs {
let first_nullifier = public_inputs.end.new_nullifiers.get(0);
let mut unique_commitments = public_inputs.end.new_commitments.storage;

for c_idx in 0..MAX_NEW_COMMITMENTS_PER_TX {
for c_idx in 0..MAX_NEW_NOTE_HASHES_PER_TX {
// Apply nonce to all non-zero/non-empty commitments
// Nonce is the hash of the first (0th) nullifier and the commitment's index into new_commitments array
let nonce = compute_commitment_nonce(first_nullifier.value, c_idx);
Expand Down Expand Up @@ -228,7 +228,7 @@ mod tests {
use dep::std::cmp::Eq;
use crate::private_kernel_tail::PrivateKernelTailCircuitPrivateInputs;
use dep::types::constants::{
MAX_READ_REQUESTS_PER_TX, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX,
MAX_READ_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX,
MAX_NON_REVERTIBLE_COMMITMENTS_PER_TX, MAX_REVERTIBLE_COMMITMENTS_PER_TX
};
use dep::types::{
Expand All @@ -255,15 +255,15 @@ mod tests {
}
}

pub fn get_new_commitments(self) -> [SideEffect; MAX_NEW_COMMITMENTS_PER_TX] {
pub fn get_new_commitments(self) -> [SideEffect; MAX_NEW_NOTE_HASHES_PER_TX] {
self.previous_kernel.end.new_commitments.storage
}

pub fn get_new_nullifiers(self) -> [SideEffectLinkedToNoteHash; MAX_NEW_NULLIFIERS_PER_TX] {
self.previous_kernel.end.new_nullifiers.storage
}

pub fn get_unique_siloed_commitments(self) -> [SideEffect; MAX_NEW_COMMITMENTS_PER_TX] {
pub fn get_unique_siloed_commitments(self) -> [SideEffect; MAX_NEW_NOTE_HASHES_PER_TX] {
self.compute_unique_siloed_commitments(self.previous_kernel.end.new_commitments.storage)
}

Expand Down Expand Up @@ -375,7 +375,7 @@ mod tests {
#[test]
unconstrained fn native_matching_some_read_requests_to_commitments_works() {
let mut builder = PrivateKernelOrderingInputsBuilder::new();
builder.append_transient_commitments(MAX_NEW_COMMITMENTS_PER_TX);
builder.append_transient_commitments(MAX_NEW_NOTE_HASHES_PER_TX);
// prepare for the split: first MAX_NON_REVERTIBLE_COMMITMENTS_PER_TX are added to end_non_revertible_accumulted_data
// neeed to take the counter of the side effect at the given index because
builder.previous_kernel.min_revertible_side_effect_counter = builder.previous_kernel.end.new_commitments.get(MAX_NON_REVERTIBLE_COMMITMENTS_PER_TX).counter;
Expand Down Expand Up @@ -543,7 +543,7 @@ mod tests {
// The nullifier at index 1 is nullifying the commitment at index 0;
builder.nullify_transient_commitment(1, 0);
// Change the hint to be out of bounds.
builder.nullifier_commitment_hints[1] = MAX_NEW_COMMITMENTS_PER_TX;
builder.nullifier_commitment_hints[1] = MAX_NEW_NOTE_HASHES_PER_TX;
builder.failed();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use dep::types::{
NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH,
CONTRACT_SUBTREE_SIBLING_PATH_LENGTH, PUBLIC_DATA_TREE_HEIGHT, MAX_NEW_CONTRACTS_PER_TX,
NOTE_HASH_SUBTREE_HEIGHT, CONTRACT_SUBTREE_HEIGHT, NUM_FIELDS_PER_SHA256,
MAX_NEW_COMMITMENTS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX,
MAX_NEW_NOTE_HASHES_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX,
MAX_NEW_NULLIFIERS_PER_TX, NUM_ENCRYPTED_LOGS_HASHES_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX,
NUM_UNENCRYPTED_LOGS_HASHES_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_TREE_HEIGHT,
PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, PUBLIC_DATA_SUBTREE_HEIGHT,
Expand Down Expand Up @@ -256,7 +256,7 @@ impl BaseRollupInputs {
fn components_compute_kernel_calldata_hash(combined: CombinedAccumulatedData) -> [Field; NUM_FIELDS_PER_SHA256] {
// Compute calldata hashes
// Consist of
// MAX_NEW_COMMITMENTS_PER_TX fields for commitments
// MAX_NEW_NOTE_HASHES_PER_TX fields for commitments
// MAX_NEW_NULLIFIERS_PER_TX fields for nullifiers
// 32 public data update requests -> 64 fields
// 2 l2 -> l1 messages -> 2 fields
Expand All @@ -274,10 +274,10 @@ impl BaseRollupInputs {

let mut offset = 0;

for j in 0..MAX_NEW_COMMITMENTS_PER_TX {
for j in 0..MAX_NEW_NOTE_HASHES_PER_TX {
calldata_hash_inputs[offset + j] = new_commitments[j].value;
}
offset += MAX_NEW_COMMITMENTS_PER_TX ;
offset += MAX_NEW_NOTE_HASHES_PER_TX ;

for j in 0..MAX_NEW_NULLIFIERS_PER_TX {
calldata_hash_inputs[offset + j] = new_nullifiers[j].value;
Expand Down Expand Up @@ -493,15 +493,15 @@ fn validate_public_data_reads(
#[test]
fn consistent_not_hash_subtree_width() {
assert_eq(
MAX_NEW_COMMITMENTS_PER_TX, 2.pow_32(NOTE_HASH_SUBTREE_HEIGHT), "note hash subtree width is incorrect"
MAX_NEW_NOTE_HASHES_PER_TX, 2.pow_32(NOTE_HASH_SUBTREE_HEIGHT), "note hash subtree width is incorrect"
);
}

global CALLDATA_HASH_INPUT_SIZE = 201;

#[test]
fn consistent_calldata_hash_input_size() {
let expected_size = MAX_NEW_COMMITMENTS_PER_TX
let expected_size = MAX_NEW_NOTE_HASHES_PER_TX
+ MAX_NEW_NULLIFIERS_PER_TX
+ MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * 2
+ MAX_NEW_L2_TO_L1_MSGS_PER_TX
Expand Down Expand Up @@ -574,7 +574,7 @@ mod tests {
constants::{
CONTRACT_SUBTREE_SIBLING_PATH_LENGTH, CONTRACT_TREE_HEIGHT, CONTRACT_SUBTREE_HEIGHT,
ARCHIVE_HEIGHT, MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_NEW_CONTRACTS_PER_TX,
MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_NEW_CONTRACTS_PER_TX,
NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NOTE_HASH_TREE_HEIGHT, NOTE_HASH_SUBTREE_HEIGHT,
NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, NULLIFIER_SUBTREE_HEIGHT,
PUBLIC_DATA_TREE_HEIGHT, PUBLIC_DATA_SUBTREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH,
Expand Down Expand Up @@ -697,7 +697,7 @@ mod tests {

struct BaseRollupInputsBuilder {
kernel_data: PreviousKernelDataBuilder,
pre_existing_notes: [Field; MAX_NEW_COMMITMENTS_PER_TX],
pre_existing_notes: [Field; MAX_NEW_NOTE_HASHES_PER_TX],
pre_existing_nullifiers: [NullifierLeafPreimage; MAX_NEW_NULLIFIERS_PER_TX],
pre_existing_contracts: [Field; 2],
pre_existing_public_data: [PublicDataTreeLeafPreimage; MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX],
Expand Down Expand Up @@ -1028,7 +1028,7 @@ mod tests {
}
builder.kernel_data.end.new_commitments = new_commitments_vec;
let mut expected_commitments_tree = NonEmptyMerkleTree::new(
[0; MAX_NEW_COMMITMENTS_PER_TX * 2],
[0; MAX_NEW_NOTE_HASHES_PER_TX * 2],
[0; NOTE_HASH_TREE_HEIGHT],
[0; NOTE_HASH_TREE_HEIGHT - NOTE_HASH_SUBTREE_HEIGHT - 1],
[0; NOTE_HASH_SUBTREE_HEIGHT + 1]
Expand All @@ -1037,19 +1037,19 @@ mod tests {
let outputs = builder.execute();
let expected_start_note_hash_tree_snapshot = AppendOnlyTreeSnapshot {
root: expected_commitments_tree.get_root(),
next_available_leaf_index: MAX_NEW_COMMITMENTS_PER_TX as u32
next_available_leaf_index: MAX_NEW_NOTE_HASHES_PER_TX as u32
};
assert(outputs.start.note_hash_tree.eq(expected_start_note_hash_tree_snapshot));

for i in 0..new_commitments.len() {
expected_commitments_tree.update_leaf(
(i as u64) + (MAX_NEW_COMMITMENTS_PER_TX as u64),
(i as u64) + (MAX_NEW_NOTE_HASHES_PER_TX as u64),
new_commitments[i]
);
}
let expected_end_note_hash_tree_snapshot = AppendOnlyTreeSnapshot {
root: expected_commitments_tree.get_root(),
next_available_leaf_index: (MAX_NEW_COMMITMENTS_PER_TX * 2) as u32
next_available_leaf_index: (MAX_NEW_NOTE_HASHES_PER_TX * 2) as u32
};
assert(outputs.end.note_hash_tree.eq(expected_end_note_hash_tree_snapshot));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
}
};
use crate::constants::{
MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NEW_COMMITMENTS_PER_TX,
MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX,
MAX_NEW_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX,
MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_CONTRACTS_PER_TX,
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, NUM_FIELDS_PER_SHA256,
Expand All @@ -31,7 +31,7 @@ struct CombinedAccumulatedData {
read_requests: [SideEffect; MAX_READ_REQUESTS_PER_TX],
nullifier_key_validation_requests: [NullifierKeyValidationRequestContext; MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX],

new_commitments: [SideEffect; MAX_NEW_COMMITMENTS_PER_TX],
new_commitments: [SideEffect; MAX_NEW_NOTE_HASHES_PER_TX],
new_nullifiers: [SideEffectLinkedToNoteHash; MAX_NEW_NULLIFIERS_PER_TX],

private_call_stack: [CallRequest; MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
}
};
use crate::constants::{
MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NEW_COMMITMENTS_PER_TX,
MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX,
MAX_NEW_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX,
MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_CONTRACTS_PER_TX,
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, NUM_FIELDS_PER_SHA256,
Expand All @@ -36,7 +36,7 @@ struct CombinedAccumulatedDataBuilder {
read_requests: BoundedVec<SideEffect,MAX_READ_REQUESTS_PER_TX>,
nullifier_key_validation_requests: BoundedVec<NullifierKeyValidationRequestContext, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX>,

new_commitments: BoundedVec<SideEffect, MAX_NEW_COMMITMENTS_PER_TX>,
new_commitments: BoundedVec<SideEffect, MAX_NEW_NOTE_HASHES_PER_TX>,
new_nullifiers: BoundedVec<SideEffectLinkedToNoteHash, MAX_NEW_NULLIFIERS_PER_TX>,

private_call_stack: BoundedVec<CallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX>,
Expand Down Expand Up @@ -156,7 +156,7 @@ impl CombinedAccumulatedDataBuilder {
let mut non_revertible_builder: AccumulatedNonRevertibleDataBuilder = unsafe::zeroed();
let mut revertible_builder: AccumulatedRevertibleDataBuilder = unsafe::zeroed();

for i in 0..MAX_NEW_COMMITMENTS_PER_TX {
for i in 0..MAX_NEW_NOTE_HASHES_PER_TX {
let commitment = self.new_commitments.storage[i];
// TODO(fees) we shouldn't need to check is_empty here,
// but we do because new_commitments is bounded to MAX_REVERTIBLE_COMMITMENTS_PER_TX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ global RETURN_VALUES_LENGTH: Field = 4;
* Agreed convention is to use MAX_XXX_PER_CALL resp. MAX_XXX_PER_TX, where XXX denotes a type of element such as
* commitment, or nullifier, e.g.,:
* - MAX_NEW_NULLIFIERS_PER_CALL
* - MAX_NEW_COMMITMENTS_PER_TX
* - MAX_NEW_NOTE_HASHES_PER_TX
*
* In the kernel circuits, we accumulate elements such as commitments and the nullifiers from all functions calls in a
* transaction. Therefore, we always must have:
* MAX_XXX_PER_TX ≥ MAX_XXX_PER_CALL
*
* For instance:
* MAX_NEW_COMMITMENTS_PER_TX ≥ MAX_NEW_COMMITMENTS_PER_CALL
* MAX_NEW_NOTE_HASHES_PER_TX ≥ MAX_NEW_COMMITMENTS_PER_CALL
* MAX_NEW_NULLIFIERS_PER_TX ≥ MAX_NEW_NULLIFIERS_PER_CALL
*
*/
Expand All @@ -34,7 +34,7 @@ global MAX_READ_REQUESTS_PER_CALL: Field = 32;
global MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL: Field = 1;

// "PER TRANSACTION" CONSTANTS
global MAX_NEW_COMMITMENTS_PER_TX: Field = 64;
global MAX_NEW_NOTE_HASHES_PER_TX: Field = 64;
global MAX_NON_REVERTIBLE_COMMITMENTS_PER_TX: Field = 8;
global MAX_REVERTIBLE_COMMITMENTS_PER_TX: Field = 56;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
tests::{fixtures, testing_harness::build_tx_context}, transaction::tx_context::TxContext
};
use crate::constants::{
MAX_NEW_COMMITMENTS_PER_TX, MAX_NON_REVERTIBLE_NULLIFIERS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX,
MAX_NEW_NOTE_HASHES_PER_TX, MAX_NON_REVERTIBLE_NULLIFIERS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX,
MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NUM_FIELDS_PER_SHA256,
VK_TREE_HEIGHT
};
Expand Down Expand Up @@ -122,7 +122,7 @@ impl PreviousKernelDataBuilder {

pub fn append_new_commitments(&mut self, num_new_commitments: Field) {
let mocked_value_offset = self.end.new_commitments.len() + 1;
for i in 0..MAX_NEW_COMMITMENTS_PER_TX {
for i in 0..MAX_NEW_NOTE_HASHES_PER_TX {
if i as u64 < num_new_commitments as u64 {
// The default value is its index + 1.
self.end.new_commitments.push(
Expand Down
Loading

0 comments on commit 498b540

Please sign in to comment.