Skip to content

Commit c37cad5

Browse files
committed
feat: searching for nullifiers and tags concurrently
1 parent 9821a67 commit c37cad5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,16 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
350350
this.jobId,
351351
);
352352

353-
await logService.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
354-
355353
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore);
356-
await noteService.syncNoteNullifiers(this.contractAddress);
354+
355+
// The following being parallelized is fine for multiple reasons:
356+
// 1. syncTaggedLogs doesn't write to note store - it just stores the pending tagged logs in a capsule array, which
357+
// is then processed in Noir once this handler returns.
358+
// 2. even if syncTaggedLogs did write to note store, it would not result in inconsistent state.
359+
await Promise.all([
360+
logService.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes),
361+
noteService.syncNoteNullifiers(this.contractAddress),
362+
]);
357363
}
358364

359365
/**

0 commit comments

Comments
 (0)