-
Notifications
You must be signed in to change notification settings - Fork 610
feat: sync cache invalidation oracle #21459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nchamo
merged 11 commits into
merge-train/fairies
from
feat/contract-sync-cache-invalidation
Mar 18, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bfa901a
feat: per-contract sync cache invalidation oracle
nchamo 63f1e95
fix(txe): add invalidateContractSyncCache handler to rpc_translator
nchamo 9434ecb
Apply suggestions from code review
nchamo f824587
fix(pxe): address pr feedback
nchamo 0d92dea
Merge remote-tracking branch 'origin/merge-train/fairies' into feat/c…
nchamo 5eb3471
feat(pxe): scope contract sync cache invalidation by recipient
nchamo 8ee9ac5
chore(pxe): update oracle interface hash
nchamo 13c5ecb
fix(pxe): make invalidateContractSyncCache synchronous
nchamo e07755a
Merge remote-tracking branch 'origin/merge-train/fairies' into feat/c…
nchamo f878c1a
fix(pxe): remove await on synchronous invalidateContractSyncCache in …
nchamo bca00cb
Merge remote-tracking branch 'origin/merge-train/fairies' into feat/c…
nchamo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| use crate::protocol::address::AztecAddress; | ||
|
|
||
| #[oracle(aztec_utl_invalidateContractSyncCache)] | ||
| unconstrained fn invalidate_contract_sync_cache_oracle<let N: u32>( | ||
| contract_address: AztecAddress, | ||
| scopes: BoundedVec<AztecAddress, N>, | ||
| ) {} | ||
|
|
||
| /// Forces the PXE to re-sync the given contract for a set of scopes on the next query. | ||
| /// | ||
| /// Call this after writing data (e.g. offchain messages) that the contract's `sync_state` function needs to discover. | ||
| /// Without invalidation, the sync cache would skip re-running `sync_state` until the next block. | ||
| pub unconstrained fn invalidate_contract_sync_cache<let N: u32>( | ||
| contract_address: AztecAddress, | ||
| scopes: BoundedVec<AztecAddress, N>, | ||
| ) { | ||
| invalidate_contract_sync_cache_oracle(contract_address, scopes); | ||
| } |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't have a TODO, but Claude deleted it and the test still passes. Should I put it back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the entire point of this PR was to be able to remove these two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that, as stated above, as soon as we add the balance check for Alice (which was blocked by scoped capsules), the forceEmptyBlock will still be necessary unless we selectively cache by scope and contract address