Skip to content

fix: emit error on oracle functions with function bodies#10132

Merged
TomAFrench merged 14 commits intomasterfrom
tf/reject-function-body-on-oracles
Oct 14, 2025
Merged

fix: emit error on oracle functions with function bodies#10132
TomAFrench merged 14 commits intomasterfrom
tf/reject-function-body-on-oracles

Conversation

@TomAFrench
Copy link
Member

Description

Problem*

Resolves #10131

Summary*

I've added a quick check where we skip elaboration of a presumed empty function body to ensure that it doesn't include any statements.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation 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.

@TomAFrench TomAFrench requested a review from a team October 9, 2025 10:39
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: 1ac9617 Previous: 86565a2 Ratio
test_report_noir-lang_noir_bigcurve_ 407 s 328 s 1.24

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: 1ac9617 Previous: 86565a2 Ratio
rollup-checkpoint-merge 0.004 s 0.003 s 1.33

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

CC: @TomAFrench

Copy link
Contributor

@aakoshh aakoshh left a comment

Choose a reason for hiding this comment

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

Looks good 👍

I couldn't see an oracle appear as a function in SSA as an fn, rather than just an identifier, so it looks like there is nothing to look at for an empty function body.

@TomAFrench TomAFrench enabled auto-merge October 9, 2025 11:22
@TomAFrench
Copy link
Member Author

Huh, I'm having the debugger tests all passing locally so not sure why this is failing in CI.

@asterite
Copy link
Collaborator

For some reason if you run cargo test tests::debug_test_mock_oracle_test_multiple_mock_times --package noir_debugger from the root, it fails... but I still don't know why that would make a difference.

Another thing I noticed is that the new code is put for built-in, low-level, etc., so I thought maybe it's erroring in those cases but no...

@asterite
Copy link
Collaborator

Ah, no... I think the debugger tests use a compiled nargo so after building it running the tests will fail.

@TomAFrench
Copy link
Member Author

TomAFrench commented Oct 10, 2025

the debugger tests use a compiled nargo

assert_cmd::cargo_bin should use the binary which is compiled from the same source as the test code though.

https://docs.rs/assert_cmd/latest/assert_cmd/cargo/index.html

@TomAFrench TomAFrench disabled auto-merge October 14, 2025 12:33
@TomAFrench TomAFrench enabled auto-merge October 14, 2025 12:33
@TomAFrench TomAFrench added this pull request to the merge queue Oct 14, 2025
Merged via the queue into master with commit 96fb819 Oct 14, 2025
131 checks passed
@TomAFrench TomAFrench deleted the tf/reject-function-body-on-oracles branch October 14, 2025 13:34
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Oct 15, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat(ACIR): exact element_type_sizes_array
(noir-lang/noir#10188)
chore: add unit test for keep_last_store
(noir-lang/noir#10177)
fix(ssa-interpreter): Ignore index overflow when side effects are
disabled (noir-lang/noir#10183)
fix: emit error on oracle functions with function bodies
(noir-lang/noir#10132)
chore: bump bb version (noir-lang/noir#10181)
END_COMMIT_OVERRIDE
@Savio-Sou Savio-Sou added this to the Group 0 Audited - External 2 milestone Dec 2, 2025
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 functions can include bodies that are silently ignored

4 participants