@aztec/pxe 3.0.0-nightly.20251201.2 → 3.0.0-nightly.20251203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/contract_function_simulator/execution_data_provider.d.ts +3 -2
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.d.ts +3 -2
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +3 -2
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +4 -3
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +6 -3
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +5 -3
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +3 -3
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +4 -4
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +5 -4
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +7 -5
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +3 -2
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +3 -2
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +4 -3
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +7 -5
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +1 -4
- package/dest/storage/note_data_provider/note_data_provider.d.ts +4 -4
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.js +4 -1
- package/package.json +16 -16
- package/src/contract_function_simulator/execution_data_provider.ts +2 -0
- package/src/contract_function_simulator/execution_note_cache.ts +3 -2
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +4 -0
- package/src/contract_function_simulator/oracle/oracle.ts +4 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +7 -2
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +9 -1
- package/src/contract_function_simulator/pxe_oracle_interface.ts +16 -5
- package/src/private_kernel/private_kernel_execution_prover.ts +0 -4
- package/src/storage/note_data_provider/note_data_provider.ts +7 -3
- package/dest/private_kernel/hints/compute_side_effect_uniqueness_hints.d.ts +0 -3
- package/dest/private_kernel/hints/compute_side_effect_uniqueness_hints.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_side_effect_uniqueness_hints.js +0 -48
- package/src/private_kernel/hints/compute_side_effect_uniqueness_hints.ts +0 -173
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
36
36
|
|
|
37
37
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
|
|
38
|
-
import { computeSideEffectUniquenessHints } from './hints/compute_side_effect_uniqueness_hints.js';
|
|
39
38
|
import type { PrivateKernelOracle } from './private_kernel_oracle.js';
|
|
40
39
|
|
|
41
40
|
const NULL_SIMULATE_OUTPUT: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs> = {
|
|
@@ -417,8 +416,6 @@ export class PrivateKernelExecutionProver {
|
|
|
417
416
|
|
|
418
417
|
const updatedClassIdHints = await this.oracle.getUpdatedClassIdHints(contractAddress);
|
|
419
418
|
|
|
420
|
-
const sideEffectUniquenessHints = computeSideEffectUniquenessHints(publicInputs);
|
|
421
|
-
|
|
422
419
|
return PrivateCallData.from({
|
|
423
420
|
publicInputs,
|
|
424
421
|
vk,
|
|
@@ -430,7 +427,6 @@ export class PrivateKernelExecutionProver {
|
|
|
430
427
|
functionLeafMembershipWitness,
|
|
431
428
|
updatedClassIdHints,
|
|
432
429
|
}),
|
|
433
|
-
sideEffectUniquenessHints,
|
|
434
430
|
});
|
|
435
431
|
}
|
|
436
432
|
}
|
|
@@ -3,7 +3,7 @@ import type { Fr } from '@aztec/foundation/fields';
|
|
|
3
3
|
import { toArray } from '@aztec/foundation/iterable';
|
|
4
4
|
import type { AztecAsyncKVStore, AztecAsyncMap, AztecAsyncMultiMap } from '@aztec/kv-store';
|
|
5
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import type {
|
|
6
|
+
import type { DataInBlock } from '@aztec/stdlib/block';
|
|
7
7
|
import { NoteStatus, type NotesFilter } from '@aztec/stdlib/note';
|
|
8
8
|
import { NoteDao } from '@aztec/stdlib/note';
|
|
9
9
|
|
|
@@ -224,7 +224,7 @@ export class NoteDataProvider {
|
|
|
224
224
|
* parameters.
|
|
225
225
|
*
|
|
226
226
|
* @param filter - Filter criteria including contractAddress (required), and optional
|
|
227
|
-
* storageSlot, status, scopes and siloedNullifier.
|
|
227
|
+
* owner, storageSlot, status, scopes, and siloedNullifier.
|
|
228
228
|
* @returns Promise resolving to array of NoteDao objects matching the filter
|
|
229
229
|
* @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
|
|
230
230
|
*/
|
|
@@ -307,6 +307,10 @@ export class NoteDataProvider {
|
|
|
307
307
|
continue;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
if (filter.owner && !note.owner.equals(filter.owner)) {
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
|
|
310
314
|
if (filter.storageSlot && !note.storageSlot.equals(filter.storageSlot!)) {
|
|
311
315
|
continue;
|
|
312
316
|
}
|
|
@@ -333,7 +337,7 @@ export class NoteDataProvider {
|
|
|
333
337
|
* @returns Promise resolving to array of nullified NoteDao objects
|
|
334
338
|
* @throws Error if any nullifier is not found in the active notes
|
|
335
339
|
*/
|
|
336
|
-
applyNullifiers(nullifiers:
|
|
340
|
+
applyNullifiers(nullifiers: DataInBlock<Fr>[]): Promise<NoteDao[]> {
|
|
337
341
|
if (nullifiers.length === 0) {
|
|
338
342
|
return Promise.resolve([]);
|
|
339
343
|
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type PrivateCircuitPublicInputs, SideEffectUniquenessHints } from '@aztec/stdlib/kernel';
|
|
2
|
-
export declare function computeSideEffectUniquenessHints(publicInputs: PrivateCircuitPublicInputs): SideEffectUniquenessHints;
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV9zaWRlX2VmZmVjdF91bmlxdWVuZXNzX2hpbnRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHJpdmF0ZV9rZXJuZWwvaGludHMvY29tcHV0ZV9zaWRlX2VmZmVjdF91bmlxdWVuZXNzX2hpbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCQSxPQUFPLEVBR0wsS0FBSywwQkFBMEIsRUFFL0IseUJBQXlCLEVBQzFCLE1BQU0sc0JBQXNCLENBQUM7QUFFOUIsd0JBQWdCLGdDQUFnQyxDQUFDLFlBQVksRUFBRSwwQkFBMEIsR0FBRyx5QkFBeUIsQ0F3SHBIIn0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute_side_effect_uniqueness_hints.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/compute_side_effect_uniqueness_hints.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,KAAK,0BAA0B,EAE/B,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,0BAA0B,GAAG,yBAAyB,CAwHpH"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET, GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET, GLOBAL_INDEX_NOTE_HASH_OFFSET, GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET, GLOBAL_INDEX_NULLIFIER_OFFSET, GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET, GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET, GLOBAL_INDEX_PRIVATE_LOG_OFFSET, GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET, MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASHES_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL } from '@aztec/constants';
|
|
2
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
3
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
|
-
import { SideEffectCounterRange, SideEffectUniquenessHints } from '@aztec/stdlib/kernel';
|
|
5
|
-
export function computeSideEffectUniquenessHints(publicInputs) {
|
|
6
|
-
let sideEffectRanges = [];
|
|
7
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.noteHashReadRequests, GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET, createRangeFromCountedItem));
|
|
8
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.nullifierReadRequests, GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET, createRangeFromCountedItem));
|
|
9
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.noteHashes, GLOBAL_INDEX_NOTE_HASH_OFFSET, createRangeFromCountedItem));
|
|
10
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.nullifiers, GLOBAL_INDEX_NULLIFIER_OFFSET, createRangeFromCountedItem));
|
|
11
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.privateCallRequests, GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET, createRangeFromPrivateCallRequest));
|
|
12
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.publicCallRequests, GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET, createRangeFromCountedItem));
|
|
13
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.l2ToL1Msgs, GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET, createRangeFromCountedItem));
|
|
14
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.privateLogs, GLOBAL_INDEX_PRIVATE_LOG_OFFSET, createRangeFromCountedItem));
|
|
15
|
-
sideEffectRanges = sideEffectRanges.concat(createRangesFromClaimedLengthArray(publicInputs.contractClassLogsHashes, GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET, createRangeFromCountedItem));
|
|
16
|
-
sideEffectRanges.sort((a, b)=>a.start - b.start);
|
|
17
|
-
const sideEffectRangeIndices = makeTuple(TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL, ()=>0);
|
|
18
|
-
for(let i = 0; i < sideEffectRanges.length; i++){
|
|
19
|
-
const range = sideEffectRanges[i];
|
|
20
|
-
sideEffectRangeIndices[range.sideEffectGlobalIndex] = i;
|
|
21
|
-
}
|
|
22
|
-
const hints = SideEffectUniquenessHints.from({
|
|
23
|
-
sideEffectRanges: padArrayEnd(sideEffectRanges, SideEffectCounterRange.empty(), TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL),
|
|
24
|
-
noteHashReadRequestIndices: makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET]),
|
|
25
|
-
nullifierReadRequestIndices: makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET]),
|
|
26
|
-
noteHashesIndices: makeTuple(MAX_NOTE_HASHES_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_NOTE_HASH_OFFSET]),
|
|
27
|
-
nullifiersIndices: makeTuple(MAX_NULLIFIERS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_NULLIFIER_OFFSET]),
|
|
28
|
-
privateCallRequestsIndices: makeTuple(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET]),
|
|
29
|
-
publicCallRequestsIndices: makeTuple(MAX_ENQUEUED_CALLS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET]),
|
|
30
|
-
l2ToL1MsgsIndices: makeTuple(MAX_L2_TO_L1_MSGS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET]),
|
|
31
|
-
privateLogsIndices: makeTuple(MAX_PRIVATE_LOGS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_PRIVATE_LOG_OFFSET]),
|
|
32
|
-
contractClassLogsHashesIndices: makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_CALL, (i)=>sideEffectRangeIndices[i + GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET])
|
|
33
|
-
});
|
|
34
|
-
return hints;
|
|
35
|
-
}
|
|
36
|
-
function createRangesFromClaimedLengthArray(array, globalIndexOffset, rangeConstructor) {
|
|
37
|
-
const ranges = [];
|
|
38
|
-
for(let i = 0; i < array.claimedLength; i++){
|
|
39
|
-
ranges.push(rangeConstructor(array.array[i], globalIndexOffset + i));
|
|
40
|
-
}
|
|
41
|
-
return ranges;
|
|
42
|
-
}
|
|
43
|
-
function createRangeFromCountedItem(item, globalIndex) {
|
|
44
|
-
return new SideEffectCounterRange(item.counter, item.counter, globalIndex);
|
|
45
|
-
}
|
|
46
|
-
function createRangeFromPrivateCallRequest(item, globalIndex) {
|
|
47
|
-
return new SideEffectCounterRange(item.startSideEffectCounter, item.endSideEffectCounter, globalIndex);
|
|
48
|
-
}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET,
|
|
3
|
-
GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET,
|
|
4
|
-
GLOBAL_INDEX_NOTE_HASH_OFFSET,
|
|
5
|
-
GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET,
|
|
6
|
-
GLOBAL_INDEX_NULLIFIER_OFFSET,
|
|
7
|
-
GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET,
|
|
8
|
-
GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET,
|
|
9
|
-
GLOBAL_INDEX_PRIVATE_LOG_OFFSET,
|
|
10
|
-
GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET,
|
|
11
|
-
MAX_CONTRACT_CLASS_LOGS_PER_CALL,
|
|
12
|
-
MAX_ENQUEUED_CALLS_PER_CALL,
|
|
13
|
-
MAX_L2_TO_L1_MSGS_PER_CALL,
|
|
14
|
-
MAX_NOTE_HASHES_PER_CALL,
|
|
15
|
-
MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
|
|
16
|
-
MAX_NULLIFIERS_PER_CALL,
|
|
17
|
-
MAX_NULLIFIER_READ_REQUESTS_PER_CALL,
|
|
18
|
-
MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,
|
|
19
|
-
MAX_PRIVATE_LOGS_PER_CALL,
|
|
20
|
-
TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL,
|
|
21
|
-
} from '@aztec/constants';
|
|
22
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
23
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
24
|
-
import type { Serializable } from '@aztec/foundation/serialize';
|
|
25
|
-
import {
|
|
26
|
-
ClaimedLengthArray,
|
|
27
|
-
PrivateCallRequest,
|
|
28
|
-
type PrivateCircuitPublicInputs,
|
|
29
|
-
SideEffectCounterRange,
|
|
30
|
-
SideEffectUniquenessHints,
|
|
31
|
-
} from '@aztec/stdlib/kernel';
|
|
32
|
-
|
|
33
|
-
export function computeSideEffectUniquenessHints(publicInputs: PrivateCircuitPublicInputs): SideEffectUniquenessHints {
|
|
34
|
-
let sideEffectRanges: SideEffectCounterRange[] = [];
|
|
35
|
-
|
|
36
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
37
|
-
createRangesFromClaimedLengthArray(
|
|
38
|
-
publicInputs.noteHashReadRequests,
|
|
39
|
-
GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET,
|
|
40
|
-
createRangeFromCountedItem,
|
|
41
|
-
),
|
|
42
|
-
);
|
|
43
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
44
|
-
createRangesFromClaimedLengthArray(
|
|
45
|
-
publicInputs.nullifierReadRequests,
|
|
46
|
-
GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET,
|
|
47
|
-
createRangeFromCountedItem,
|
|
48
|
-
),
|
|
49
|
-
);
|
|
50
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
51
|
-
createRangesFromClaimedLengthArray(
|
|
52
|
-
publicInputs.noteHashes,
|
|
53
|
-
GLOBAL_INDEX_NOTE_HASH_OFFSET,
|
|
54
|
-
createRangeFromCountedItem,
|
|
55
|
-
),
|
|
56
|
-
);
|
|
57
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
58
|
-
createRangesFromClaimedLengthArray(
|
|
59
|
-
publicInputs.nullifiers,
|
|
60
|
-
GLOBAL_INDEX_NULLIFIER_OFFSET,
|
|
61
|
-
createRangeFromCountedItem,
|
|
62
|
-
),
|
|
63
|
-
);
|
|
64
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
65
|
-
createRangesFromClaimedLengthArray(
|
|
66
|
-
publicInputs.privateCallRequests,
|
|
67
|
-
GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET,
|
|
68
|
-
createRangeFromPrivateCallRequest,
|
|
69
|
-
),
|
|
70
|
-
);
|
|
71
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
72
|
-
createRangesFromClaimedLengthArray(
|
|
73
|
-
publicInputs.publicCallRequests,
|
|
74
|
-
GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET,
|
|
75
|
-
createRangeFromCountedItem,
|
|
76
|
-
),
|
|
77
|
-
);
|
|
78
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
79
|
-
createRangesFromClaimedLengthArray(
|
|
80
|
-
publicInputs.l2ToL1Msgs,
|
|
81
|
-
GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET,
|
|
82
|
-
createRangeFromCountedItem,
|
|
83
|
-
),
|
|
84
|
-
);
|
|
85
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
86
|
-
createRangesFromClaimedLengthArray(
|
|
87
|
-
publicInputs.privateLogs,
|
|
88
|
-
GLOBAL_INDEX_PRIVATE_LOG_OFFSET,
|
|
89
|
-
createRangeFromCountedItem,
|
|
90
|
-
),
|
|
91
|
-
);
|
|
92
|
-
sideEffectRanges = sideEffectRanges.concat(
|
|
93
|
-
createRangesFromClaimedLengthArray(
|
|
94
|
-
publicInputs.contractClassLogsHashes,
|
|
95
|
-
GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET,
|
|
96
|
-
createRangeFromCountedItem,
|
|
97
|
-
),
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
sideEffectRanges.sort((a, b) => a.start - b.start);
|
|
101
|
-
|
|
102
|
-
const sideEffectRangeIndices = makeTuple(TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL, () => 0);
|
|
103
|
-
for (let i = 0; i < sideEffectRanges.length; i++) {
|
|
104
|
-
const range = sideEffectRanges[i];
|
|
105
|
-
sideEffectRangeIndices[range.sideEffectGlobalIndex] = i;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const hints = SideEffectUniquenessHints.from({
|
|
109
|
-
sideEffectRanges: padArrayEnd(
|
|
110
|
-
sideEffectRanges,
|
|
111
|
-
SideEffectCounterRange.empty(),
|
|
112
|
-
TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL,
|
|
113
|
-
),
|
|
114
|
-
noteHashReadRequestIndices: makeTuple(
|
|
115
|
-
MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
|
|
116
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET],
|
|
117
|
-
),
|
|
118
|
-
nullifierReadRequestIndices: makeTuple(
|
|
119
|
-
MAX_NULLIFIER_READ_REQUESTS_PER_CALL,
|
|
120
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET],
|
|
121
|
-
),
|
|
122
|
-
noteHashesIndices: makeTuple(
|
|
123
|
-
MAX_NOTE_HASHES_PER_CALL,
|
|
124
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_NOTE_HASH_OFFSET],
|
|
125
|
-
),
|
|
126
|
-
nullifiersIndices: makeTuple(
|
|
127
|
-
MAX_NULLIFIERS_PER_CALL,
|
|
128
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_NULLIFIER_OFFSET],
|
|
129
|
-
),
|
|
130
|
-
privateCallRequestsIndices: makeTuple(
|
|
131
|
-
MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,
|
|
132
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET],
|
|
133
|
-
),
|
|
134
|
-
publicCallRequestsIndices: makeTuple(
|
|
135
|
-
MAX_ENQUEUED_CALLS_PER_CALL,
|
|
136
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET],
|
|
137
|
-
),
|
|
138
|
-
l2ToL1MsgsIndices: makeTuple(
|
|
139
|
-
MAX_L2_TO_L1_MSGS_PER_CALL,
|
|
140
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET],
|
|
141
|
-
),
|
|
142
|
-
privateLogsIndices: makeTuple(
|
|
143
|
-
MAX_PRIVATE_LOGS_PER_CALL,
|
|
144
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_PRIVATE_LOG_OFFSET],
|
|
145
|
-
),
|
|
146
|
-
contractClassLogsHashesIndices: makeTuple(
|
|
147
|
-
MAX_CONTRACT_CLASS_LOGS_PER_CALL,
|
|
148
|
-
i => sideEffectRangeIndices[i + GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET],
|
|
149
|
-
),
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
return hints;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function createRangesFromClaimedLengthArray<T extends Serializable, N extends number>(
|
|
156
|
-
array: ClaimedLengthArray<T, N>,
|
|
157
|
-
globalIndexOffset: number,
|
|
158
|
-
rangeConstructor: (item: T, globalIndex: number) => SideEffectCounterRange,
|
|
159
|
-
): SideEffectCounterRange[] {
|
|
160
|
-
const ranges = [];
|
|
161
|
-
for (let i = 0; i < array.claimedLength; i++) {
|
|
162
|
-
ranges.push(rangeConstructor(array.array[i], globalIndexOffset + i));
|
|
163
|
-
}
|
|
164
|
-
return ranges;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function createRangeFromCountedItem(item: { counter: number }, globalIndex: number): SideEffectCounterRange {
|
|
168
|
-
return new SideEffectCounterRange(item.counter, item.counter, globalIndex);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function createRangeFromPrivateCallRequest(item: PrivateCallRequest, globalIndex: number): SideEffectCounterRange {
|
|
172
|
-
return new SideEffectCounterRange(item.startSideEffectCounter, item.endSideEffectCounter, globalIndex);
|
|
173
|
-
}
|