Skip to content

refactor(pxe): replace Oracle class with Proxy-based buildACIRCallback#23915

Merged
nchamo merged 6 commits into
merge-train/fairies-v5from
nchamo/delete-oracle-ts
Jun 8, 2026
Merged

refactor(pxe): replace Oracle class with Proxy-based buildACIRCallback#23915
nchamo merged 6 commits into
merge-train/fairies-v5from
nchamo/delete-oracle-ts

Conversation

@nchamo

@nchamo nchamo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follows refactor(pxe): hash oracle registry instead of Oracle class #23907 (which moved the oracle version hash to the registry). The Oracle class was a 711-line manual mapping of ~60 methods that each followed the exact same pattern: deserialize inputs via the registry, call the handler method, serialize the result. Since the registry already encodes all oracle names, param types, and return types, a single Proxy-based buildACIRCallback function (~100 lines) replaces the entire class by dispatching dynamically from registry keys.
  • Adding a new oracle now requires changes in two places (registry entry + handler method) instead of three.
  • Removes the now-unused callHandler export and ORACLE_NAMES type.

@nchamo nchamo self-assigned this Jun 5, 2026
@nchamo nchamo requested a review from mverzilli June 5, 2026 23:58

@mverzilli mverzilli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Beautiful

@nchamo nchamo requested a review from nventuro as a code owner June 8, 2026 11:37
@nchamo nchamo enabled auto-merge (squash) June 8, 2026 11:38
@nchamo nchamo merged commit d100d21 into merge-train/fairies-v5 Jun 8, 2026
12 checks passed
@nchamo nchamo deleted the nchamo/delete-oracle-ts branch June 8, 2026 12:12
mverzilli added a commit that referenced this pull request Jun 8, 2026
Brings in TransientArray (#23576) and the Proxy-based buildACIRCallback
oracle dispatch (#23915). Conflict resolutions:

- oracle.ts: accepted upstream's deletion of the hand-written 711-line
  dispatch. FactStore oracles now dispatch through the registry-driven
  buildACIRCallback; their entries auto-merged into oracle_registry.ts.
- utility_execution_oracle.ts: dropped the obsolete `Oracle` import,
  kept `FactOutput`. FactStore and transient handler methods auto-merged.
- oracle_version.ts: recomputed ORACLE_INTERFACE_HASH for the merged
  65-oracle registry (ae63cb…) and bumped minor 29.1 -> 29.2 (the merged
  interface is a strict superset of both branches' independent 29.1
  additions). Mirrored the minor bump into the two Noir version files.

Verified: TS build green, oracle hash confirmed by check_oracle_version,
offchain + FactStore Noir suite 13/13 and oracle_version_is_checked 9/9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants