@aztec/pxe 0.87.7 → 1.0.0-nightly.20250605
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/event_validation_request.d.ts +22 -0
- package/dest/contract_function_simulator/event_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/event_validation_request.js +43 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +25 -28
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -1
- package/dest/contract_function_simulator/note_validation_request.d.ts +21 -0
- package/dest/contract_function_simulator/note_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/note_validation_request.js +42 -0
- 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 +23 -19
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +6 -6
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/typed_oracle.js +7 -7
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +5 -6
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +8 -8
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +7 -5
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +81 -32
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +30 -30
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +9 -7
- package/dest/pxe_service/pxe_service.d.ts.map +1 -1
- package/dest/pxe_service/pxe_service.js +10 -3
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +4 -2
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +1 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +46 -7
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.js +14 -14
- package/package.json +16 -16
- package/src/contract_function_simulator/event_validation_request.ts +53 -0
- package/src/contract_function_simulator/execution_data_provider.ts +29 -50
- package/src/contract_function_simulator/note_validation_request.ts +52 -0
- package/src/contract_function_simulator/oracle/oracle.ts +27 -50
- package/src/contract_function_simulator/oracle/typed_oracle.ts +18 -26
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +15 -42
- package/src/contract_function_simulator/pxe_oracle_interface.ts +157 -51
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +35 -34
- package/src/private_kernel/private_kernel_execution_prover.ts +11 -10
- package/src/pxe_service/pxe_service.ts +10 -3
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +56 -7
- package/src/storage/note_data_provider/note_data_provider.ts +22 -22
|
@@ -80,12 +80,12 @@ export class NoteDataProvider implements DataProvider {
|
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
if (!(await this.#scopes.hasAsync(scope.toString()))) {
|
|
85
|
-
await this.addScope(scope);
|
|
86
|
-
}
|
|
87
|
-
|
|
83
|
+
addNotes(notes: NoteDao[], scope: AztecAddress = AztecAddress.ZERO): Promise<void> {
|
|
88
84
|
return this.#store.transactionAsync(async () => {
|
|
85
|
+
if (!(await this.#scopes.hasAsync(scope.toString()))) {
|
|
86
|
+
await this.addScope(scope);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
89
|
for (const dao of notes) {
|
|
90
90
|
// store notes by their index in the notes hash tree
|
|
91
91
|
// this provides the uniqueness we need to store individual notes
|
|
@@ -127,24 +127,24 @@ export class NoteDataProvider implements DataProvider {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
public async unnullifyNotesAfter(blockNumber: number, synchedBlockNumber?: number): Promise<void> {
|
|
130
|
-
const nullifiersToUndo: string[] = [];
|
|
131
|
-
const currentBlockNumber = blockNumber + 1;
|
|
132
|
-
const maxBlockNumber = synchedBlockNumber ?? currentBlockNumber;
|
|
133
|
-
for (let i = currentBlockNumber; i <= maxBlockNumber; i++) {
|
|
134
|
-
nullifiersToUndo.push(...(await toArray(this.#nullifiersByBlockNumber.getValuesAsync(i))));
|
|
135
|
-
}
|
|
136
|
-
const notesIndexesToReinsert = await Promise.all(
|
|
137
|
-
nullifiersToUndo.map(nullifier => this.#nullifiedNotesByNullifier.getAsync(nullifier)),
|
|
138
|
-
);
|
|
139
|
-
const notNullNoteIndexes = notesIndexesToReinsert.filter(noteIndex => noteIndex != undefined);
|
|
140
|
-
const nullifiedNoteBuffers = await Promise.all(
|
|
141
|
-
notNullNoteIndexes.map(noteIndex => this.#nullifiedNotes.getAsync(noteIndex!)),
|
|
142
|
-
);
|
|
143
|
-
const noteDaos = nullifiedNoteBuffers
|
|
144
|
-
.filter(buffer => buffer != undefined)
|
|
145
|
-
.map(buffer => NoteDao.fromBuffer(buffer!));
|
|
146
|
-
|
|
147
130
|
await this.#store.transactionAsync(async () => {
|
|
131
|
+
const nullifiersToUndo: string[] = [];
|
|
132
|
+
const currentBlockNumber = blockNumber + 1;
|
|
133
|
+
const maxBlockNumber = synchedBlockNumber ?? currentBlockNumber;
|
|
134
|
+
for (let i = currentBlockNumber; i <= maxBlockNumber; i++) {
|
|
135
|
+
nullifiersToUndo.push(...(await toArray(this.#nullifiersByBlockNumber.getValuesAsync(i))));
|
|
136
|
+
}
|
|
137
|
+
const notesIndexesToReinsert = await Promise.all(
|
|
138
|
+
nullifiersToUndo.map(nullifier => this.#nullifiedNotesByNullifier.getAsync(nullifier)),
|
|
139
|
+
);
|
|
140
|
+
const notNullNoteIndexes = notesIndexesToReinsert.filter(noteIndex => noteIndex != undefined);
|
|
141
|
+
const nullifiedNoteBuffers = await Promise.all(
|
|
142
|
+
notNullNoteIndexes.map(noteIndex => this.#nullifiedNotes.getAsync(noteIndex!)),
|
|
143
|
+
);
|
|
144
|
+
const noteDaos = nullifiedNoteBuffers
|
|
145
|
+
.filter(buffer => buffer != undefined)
|
|
146
|
+
.map(buffer => NoteDao.fromBuffer(buffer!));
|
|
147
|
+
|
|
148
148
|
for (const dao of noteDaos) {
|
|
149
149
|
const noteIndex = toBufferBE(dao.index, 32).toString('hex');
|
|
150
150
|
await this.#notes.set(noteIndex, dao.toBuffer());
|