Skip to content

fix(frontend): Allow indirect calls to oracles from constrained functions #10826

Merged
vezenovm merged 17 commits intomasterfrom
af/10298-global-oracle-2
Dec 5, 2025
Merged

fix(frontend): Allow indirect calls to oracles from constrained functions #10826
vezenovm merged 17 commits intomasterfrom
af/10298-global-oracle-2

Conversation

@aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Dec 5, 2025

Description

Problem

Amendment and replacement for #10822
Fixes #10298

As per the discussion in that PR, the lint we have to catch calls from constrained functions to oracles only works with expressions limited to calling a function directly, or via local variables (unless mut), or globals. It does not work for calling an oracle indirectly via data structures.

However, since the proxies pass has been updated to create an unconstrained proxy function for oracles used as values, we no longer have to deny indirect calls via the lint. By relaxing the lint for indirect the cases it handled (local and global variables), we can have a more consistent handling of the issue: we allow calls unless it's a direct call, which is not subject to wrapping into a proxy.

Summary

Changes the way we run lints::oracle_called_from_constrained_function to only be invoked if the callee has a DefinitionKind::Function, not when it's a Local or Global.

Additional Context

See the description of #10822 for other changes included in this PR.

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Changes to Brillig bytecode sizes

Generated at commit: a4843ae645fed0131a37ac795f56960e661a55a1, compared to commit: d4150ea6f903065e7d5a9d6975a749a4e904ed47

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
regression_10156_inliner_max -1 ✅ -0.05%
regression_10156_inliner_min -1 ✅ -0.05%
regression_10156_inliner_zero -1 ✅ -0.05%

Full diff report 👇
Program Brillig opcodes (+/-) %
regression_10156_inliner_max 2,132 (-1) -0.05%
regression_10156_inliner_min 2,132 (-1) -0.05%
regression_10156_inliner_zero 2,132 (-1) -0.05%

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Changes to number of Brillig opcodes executed

Generated at commit: a4843ae645fed0131a37ac795f56960e661a55a1, compared to commit: d4150ea6f903065e7d5a9d6975a749a4e904ed47

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
regression_10156_inliner_max -1 ✅ -0.05%
regression_10156_inliner_min -1 ✅ -0.05%
regression_10156_inliner_zero -1 ✅ -0.05%

Full diff report 👇
Program Brillig opcodes (+/-) %
regression_10156_inliner_max 2,134 (-1) -0.05%
regression_10156_inliner_min 2,134 (-1) -0.05%
regression_10156_inliner_zero 2,134 (-1) -0.05%

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 4f8b5b7 Previous: f6706c2 Ratio
test_report_zkpassport_noir_rsa_ 1 s 0 s +∞

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 4f8b5b7 Previous: f6706c2 Ratio
rollup-checkpoint-root-single-block 511 s 385 s 1.33

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 9118a4a Previous: d4150ea Ratio
rollup-block-root-single-tx 0.003 s 0.002 s 1.50
rollup-root 0.005 s 0.004 s 1.25

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@jfecher jfecher added this pull request to the merge queue Dec 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 5, 2025
@vezenovm vezenovm added this pull request to the merge queue Dec 5, 2025
Merged via the queue into master with commit a4c1387 Dec 5, 2025
132 checks passed
@vezenovm vezenovm deleted the af/10298-global-oracle-2 branch December 5, 2025 21:17
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.

#[oracle] in global crashes

3 participants