Skip to content

fix(pxe): queue registerSender wipe to avoid racing with in-flight jobs#22623

Merged
nchamo merged 2 commits intomerge-train/fairiesfrom
fix/register-sender-wipe-race
Apr 17, 2026
Merged

fix(pxe): queue registerSender wipe to avoid racing with in-flight jobs#22623
nchamo merged 2 commits intomerge-train/fairiesfrom
fix/register-sender-wipe-race

Conversation

@nchamo
Copy link
Copy Markdown
Contributor

@nchamo nchamo commented Apr 16, 2026

Summary

  • registerSender calls contractSyncService.wipe() to force a re-sync after adding a new sender. This ran outside the job queue, so it could clear cached sync state while a simulation or proving job was in flight, causing that job to operate on stale or incomplete contract state.
  • Fix: queue the wipe() call through #putInJobQueue so it waits for any in-flight job to finish before clearing the cache. The addSender store write stays outside the queue since it doesn't interfere with in-flight jobs.

Closes https://github.com/AztecProtocol/aztec-claude/issues/146

Trade-off

registerSender now awaits the queued wipe, meaning it blocks until any in-flight job finishes. If this latency is a concern, we could fire-and-forget the wipe (void this.#putInJobQueue(...)) at the cost of the caller not knowing when the wipe completes.

@nchamo nchamo self-assigned this Apr 16, 2026
@nchamo nchamo requested a review from Thunkar April 16, 2026 22:21
@nchamo nchamo merged commit 924909b into merge-train/fairies Apr 17, 2026
12 checks passed
@nchamo nchamo deleted the fix/register-sender-wipe-race branch April 17, 2026 10:51
@AztecBot
Copy link
Copy Markdown
Collaborator

✅ Successfully backported to backport-to-v4-next-staging #22580.

github-merge-queue Bot pushed a commit that referenced this pull request Apr 17, 2026
BEGIN_COMMIT_OVERRIDE
fix(pxe): stop block synchronizer on PXE shutdown (#22604)
fix(aztec): respect TEST_ACCOUNTS env var in local network mode (#22600)
fix: check all aztec-nr dependency tags, not just aztec (#22483)
fix: reuse anchor block in kernel oracle (#22631)
refactor: unify contract compilation pipeline via bb aztec_process
(#22590)
fix(pxe): queue registerSender wipe to avoid racing with in-flight jobs
(#22623)
fix(pxe): bounds-check PropertySelector in pick_notes (#22614)
fix(pxe): guard private event store rollback against in-flight jobs
(#22615)
refactor(pxe): rename sideEffectCounter to initialSideEffectCounter
(#22599)
fix(pxe): correct stale authwitness comment and inverted tagging error
(#22537)
fix(aztec-nr): range-check auth witness fields before byte cast (#22624)
fix(pxe): serialize block stream event handling to prevent race
conditions (#22635)
fix(pxe): throw error on origin/contract address mismatch in simulation
(#22637)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants