refactor!: cleaning up public call and tx phase related oracles#21209
Open
benesjan wants to merge 7 commits intomerge-train/fairiesfrom
Open
refactor!: cleaning up public call and tx phase related oracles#21209benesjan wants to merge 7 commits intomerge-train/fairiesfrom
benesjan wants to merge 7 commits intomerge-train/fairiesfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
9bf6224 to
ddb514b
Compare
benesjan
commented
Mar 8, 2026
| is_static_call: bool, | ||
| hide_msg_sender: bool, | ||
| ) { | ||
| let counter = self.next_counter(); |
Contributor
Author
There was a problem hiding this comment.
Note that here the counter was truly unnecessary because:
- it was unused by
notify_set_public_teardown_function_call, - fundamentally we don't care about counters on teardown calls because there can be only 1 teardown call (and hence no ordering is needed).
benesjan
commented
Mar 8, 2026
| @@ -1,101 +0,0 @@ | |||
| use crate::protocol::address::AztecAddress; | |||
Contributor
Author
There was a problem hiding this comment.
This file was very sad because:
- Most of the args of
notify_enqueued_public_function_call_oraclewere unused, - we had 2 versions of
notify_enqueued_public_function_call_oracle: one for teardown one for standard public call but they were doing the identical thing, - the tx phase oracles (
notify_set_min_revertible_side_effect_counter_oracle_wrapper,is_side_effect_counter_revertible) were not really related to public calls so I moved them to a separatetx_phase.nrfile.
benesjan
commented
Mar 8, 2026
| /// | ||
| /// The check is unconstrained and the only purpose of it is to fail early in case of calldata overflow or a bug in | ||
| /// calldata hashing. | ||
| pub fn validate_public_calldata(calldata_hash: Field) { |
Contributor
Author
There was a problem hiding this comment.
This used to be called notify_enqueued_public_function_call and notify_set_public_teardown_function.
benesjan
commented
Mar 8, 2026
| @@ -4,10 +4,8 @@ use crate::{ | |||
| messaging::process_l1_to_l2_message, | |||
Contributor
Author
There was a problem hiding this comment.
The changes in aztec_sublib are a copy-paste from real Aztec.nr so no need to pay attention to this.
After all the protocol circuits did not yet went for audit so doing the changes here should be fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In this PR I focused on cleaning up the public call and tx phase related oracles. Below is the AI summary and I put github comments in the files that should hopefully make all the changes clear.
This is the most important piece of the before-alpha-oracle cleanup (issue here) as this seems like by far the most sad part of the oracle code.
AI Summary
Cleans up the public call related oracles in the private execution context:
enqueue_public_function_callmodule with two focused modules:public_call(calldata validation) andtx_phase(revertible phase tracking), giving each oracle a clear single responsibilityvalidate_public_calldata: the oldnotifyEnqueuedPublicFunctionCallandnotifySetPublicTeardownFunctionCalloracles both did the same thing (validate calldata) but received unused parameters (contract address, counter, is_static_call). The newvalidatePublicCalldataoracle only takes the calldata hashnotifySetMinRevertibleSideEffectCounter→notifyRevertiblePhaseStart,isSideEffectCounterRevertible→inRevertiblePhase