feat: public data tree overrides for simulation#22830
Merged
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
eeea6a6 to
7c70c29
Compare
bfce029 to
5ec5db9
Compare
9116033 to
fe71850
Compare
dbanks12
commented
May 5, 2026
Comment on lines
+1
to
+16
| import { z } from 'zod'; | ||
|
|
||
| import { type PublicStorageOverride, PublicStorageOverrideSchema } from './public_storage_override.js'; | ||
|
|
||
| /** | ||
| * Pre-simulation state overrides. Each field is optional and additive: the simulator applies all | ||
| * provided overrides to the ephemeral world-state fork (in order) before running the tx. | ||
| */ | ||
| export type StateOverrides = { | ||
| /** Public-storage writes to apply before simulation. */ | ||
| publicStorage?: PublicStorageOverride[]; | ||
| }; | ||
|
|
||
| export const StateOverridesSchema = z.object({ | ||
| publicStorage: z.array(PublicStorageOverrideSchema).optional(), | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
if we know for certain that we'll never want to override state from other trees, we could flatten this and just have "public storage overrides" instead of generic "state overrides"
Thunkar
approved these changes
May 5, 2026
Contributor
Thunkar
left a comment
There was a problem hiding this comment.
Won't block, but as discussed I'd try to lean more into a consolidated overrides object, since very soon we'll be able to do contracts additionally to public state.
The rest LGTM, ty!
ce67508 to
1ca8868
Compare
86096b6 to
e73027d
Compare
1ca8868 to
b361b3c
Compare
0fb7f88 to
a63ac50
Compare
06fafc0 to
a498f65
Compare
a53f144 to
d38afc5
Compare
cf88b94 to
a72d30a
Compare
d38afc5 to
a0a1316
Compare
a72d30a to
82138d4
Compare
a0a1316 to
6e25dbc
Compare
This was referenced May 7, 2026
Thunkar
approved these changes
May 7, 2026
a176344 to
da09888
Compare
4d7ac18 to
386276c
Compare
da09888 to
5b272ac
Compare
This was referenced May 7, 2026
5b272ac to
ea12e44
Compare
386276c to
dd377eb
Compare
ea12e44 to
e33392c
Compare
d48dbfe to
aec497a
Compare
e33392c to
7936d76
Compare
Base automatically changed from
db/sim-overrides-drop-artifacts
to
merge-train/fairies
May 8, 2026 01:19
Extends `SimulationOverrides` with a `publicStorage` field, plumbed through `.simulate({ overrides })` on aztec.js → wallet → PXE → `AztecNode.simulatePublicCalls`. Each entry writes a `(contract, slot, value)` into the public-data tree of the ephemeral world-state fork before the tx runs; real chain state is untouched.
EmbeddedWallet was still calling the old positional-argument form of the SimulationOverrides constructor, so contract-instance overrides for the stub account were silently dropped, and simulation re-entered the real account entrypoint with no auth witness.
7936d76 to
1b062ca
Compare
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.

Extends
SimulationOverrideswith apublicStoragefield, plumbed through.simulate({ overrides })on aztec.js → wallet → PXE →AztecNode.simulatePublicCalls. Each entry writes a(contract, slot, value)into the public-data tree of the ephemeral world-state fork before the tx runs; real chain state is untouched.Test plan
aztec-node/src/aztec-node/public_data_overrides.test.ts.e2e_avm_simulatorpublicDataOverridesdescribe block.migration_notes.mdandhow_to_test.mdupdated.