feat: fastForwardContractUpdate cheatcode for simulating contract updates#22905
Merged
Conversation
This was referenced May 1, 2026
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
97c2111 to
7e12172
Compare
7e12172 to
043c852
Compare
43d10a4 to
ce67508
Compare
85cfaae to
5add18a
Compare
1ca8868 to
b361b3c
Compare
5add18a to
2f092e4
Compare
b361b3c to
7ca547d
Compare
2f092e4 to
4a6e4a1
Compare
7ca547d to
5368aef
Compare
4a6e4a1 to
04ea57f
Compare
5368aef to
df229d1
Compare
e87c61a to
fcf1c77
Compare
df229d1 to
d71c0c2
Compare
fcf1c77 to
3d0b675
Compare
d71c0c2 to
93230bb
Compare
3d0b675 to
6a0ff71
Compare
153b4f1 to
59b94a3
Compare
3 tasks
59b94a3 to
f5a0071
Compare
f5a0071 to
cf63e74
Compare
b1759f1 to
c6a9a2a
Compare
cf63e74 to
721ca99
Compare
721ca99 to
7b2bf7e
Compare
2 tasks
7b2bf7e to
f752939
Compare
028f86a to
ff6e112
Compare
f752939 to
5eab42b
Compare
ff6e112 to
fd5d974
Compare
5eab42b to
bad11ee
Compare
bad11ee to
6ee0009
Compare
fd5d974 to
49d9722
Compare
6ee0009 to
bc31ce0
Compare
49d9722 to
4f39410
Compare
bc31ce0 to
1f320fd
Compare
4f39410 to
392cab1
Compare
Mirrors the real-account note storage (signing_public_key) on the simulated Schnorr/ECDSA account stubs and removes the manual sync_state() override so the #[aztec] macro generates a sync_state matching the real contract's selector. With matching note storage, the macro-generated _compute_note_hash can decode the real account's signing_public_key note during simulation sync. Removes the PXE setExcludedFromSync plumbing that previously skipped overridden contracts from sync. Required for fastForwardContractUpdate's private-call simulation to discover notes through the override.
…ates Adds a high-level helper that returns a `SimulationOverrides` blob simulating a deployed instance as if it had already been upgraded to a new contract class: - `overrides.publicStorage` rewrites the `ContractInstanceRegistry`'s delayed-public-mutable storage so the AVM's `UpdateCheck` resolves to the new class id. - `overrides.contracts` swaps the deployed instance for one whose `currentContractClassId` is bumped to the new class. Drives both AVM-side public dispatch and PXE-side ACIR private dispatch. Both pieces are required: a storage-only override would not redirect the AVM's class dispatch (which reads `currentContractClassId` from the contract DB); an instance-only override would cause the witgen `UpdateCheck` to throw on inconsistency. The new class must already be registered on chain.
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.

Adds
fastForwardContractUpdateto aztec.js — a high-level cheatcode that returns aSimulationOverridesblob simulating a deployed instance as if it had already been upgraded to a new contract class.The blob covers both pieces required for a coherent upgrade simulation:
overrides.publicStoragerewrites theContractInstanceRegistry's delayed-public-mutable storage so the AVM'sUpdateCheckresolves to the new class id.overrides.contractsswaps the deployed instance for one whosecurrentContractClassIdis bumped to the new class. Drives both AVM-side public dispatch and PXE-side ACIR private dispatch.Both pieces are required: a storage-only override would not redirect the AVM's class dispatch (which reads
currentContractClassIdfrom the contract DB); an instance-only override would cause the witgenUpdateCheckto throw on inconsistency. The new class must already be registered on chain.Test plan
fastforward_contract_update.test.tscover validation and override shape.e2e_contract_updatesfor both public and private dispatch under override (private dispatch needswallet.registerContractClassfrom upstack and the sync-skip narrowing from upstack).migration_notes.mdandhow_to_test.mdupdated.