From 1085377118fae572d862693af7b5c2057a7957ea Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 20 Jan 2026 06:42:08 +0000 Subject: [PATCH] feat: searching for nullifiers and tags concurrently --- .../oracle/utility_execution_oracle.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts b/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts index 333e88344a0e..d9d932bca53a 100644 --- a/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts +++ b/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts @@ -350,10 +350,16 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra this.jobId, ); - await logService.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes); - const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore); - await noteService.syncNoteNullifiers(this.contractAddress); + + // It is acceptable to run the following operations in parallel for several reasons: + // 1. syncTaggedLogs does not write to the note store — it only stores the pending tagged logs in a capsule array, + // which is then processed in Noir after this handler returns. + // 2. Even if syncTaggedLogs did write to the note store, it would not cause inconsistent state. + await Promise.all([ + logService.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes), + noteService.syncNoteNullifiers(this.contractAddress), + ]); } /**