Skip to content

feat: merge-train/fairies-v5#24134

Merged
AztecBot merged 3 commits into
v5-nextfrom
merge-train/fairies-v5
Jun 16, 2026
Merged

feat: merge-train/fairies-v5#24134
AztecBot merged 3 commits into
v5-nextfrom
merge-train/fairies-v5

Conversation

@AztecBot

@AztecBot AztecBot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
fix(simulator): make circuit recorder concurrency-safe via AsyncLocalStorage (#24112)
refactor(pxe): restore satisfies-typed oracle registries (#24132)
END_COMMIT_OVERRIDE

…Storage (#24112)

Holds the active circuit recording in `AsyncLocalStorage` instead of
shared instance fields, so nested and concurrent executions no longer
corrupt each other's recording.

**Problem:** 

`CircuitRecorder` kept mutable state
(`recording`/`stackDepth`/`newCircuit`) on one per-PXE instance. Nested
re-entrant executions (nested private calls via
`aztec_prv_callPrivateFunction`, utility executions) shared that state,
so a child could reset the parent's recording mid-flight and drop or
misattribute oracle calls. The error path then dereferenced the absent
recording and masked the real failure (e.g. `schnorr_initializerless:
capsule load failed`). The first two commits guarded the crash; this
fixes the cause and leaves the guards as redundant defense.

**Fix:**
- Per-execution recording lives in `AsyncLocalStorage` (mirrors
`foundation/src/profiler/profiler.ts`)
- `record(metadata, fn)` replaces `start`/`finish`/`finishWithError` and
re-throws the original error unchanged.
- No `CircuitSimulator` interface or consumer change.

**Tests:** oracle-call attribution across nested private + utility
re-entries (red before this change: parent `oracles` came back
`undefined`), isolation of interleaved concurrent recordings, and
original simulator error surfacing without masking.

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot AztecBot added this pull request to the merge queue Jun 16, 2026
@AztecBot

Copy link
Copy Markdown
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/8e9b79ce009e1705�8e9b79ce009e17058;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_optimistic_proving.parallel.test.ts "removes a checkpoint mid-epoch via reorg and proves with survivors" (228s) (code: 0) group:e2e-p2p-epoch-flakes

Merged via the queue into v5-next with commit 70c9bca Jun 16, 2026
14 checks passed
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.

4 participants