feat: merge-train/fairies#23074
Merged
Merged
Conversation
Drops the `artifact` field from `SimulationOverrides.contracts` entries. Simulation now resolves the override-instance's `currentContractClassId` through PXE's locally registered classes — callers register the target artifact via `pxe.registerContractClass(...)` once, then construct an instance with the desired `currentContractClassId` to drive dispatch. In-tree account-stub flows (`cli-wallet`, `embedded_wallet`, `test_wallet`) migrate to the pre-register pattern: pre-register the stub class and bump `currentContractClassId` on the override instance. `proxied_contract_data_source` drops its `getFunctionArtifact*` overrides — function lookup falls through to the regular `ContractStore`. The proxy now only overrides `getContractInstance`. ## Test plan - All existing simulator unit tests pass against the refactored proxy. - E2E account-stub flows (kernelless-override simulation mode) continue to work via the pre-register pattern.
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.
```typescript
const result = await contract.methods.read_balance(account).simulate({
overrides: {
publicStorage: [{ contract: contract.address, slot: BALANCE_SLOT, value: new Fr(1_000_000n) }],
},
});
```
## Test plan
- Unit tests in
`aztec-node/src/aztec-node/public_data_overrides.test.ts`.
- E2E `e2e_avm_simulator` `publicDataOverrides` describe block.
- `migration_notes.md` and `how_to_test.md` updated.
…ct upgrades) (#22932) Adds `wallet.registerContractClass(artifact)` (a thin pass-through to PXE) so external callers can register a new class artifact locally before passing an instance override (next pr) that targets it. Without this, PXE-side ACIR dispatch can't resolve private functions of the override's class. `ContractClassesCapability` gains a `canRegister?: boolean` flag so wallets can grant or deny the new method via the capability manifest, matching the existing `ContractsCapability.canRegister` pattern. With `fastForwardContractUpdate` (next pr in stack) plus this method, a single `.simulate({ overrides })` covers both private and public function calls on an upgraded contract: ```typescript await wallet.registerContractClass(UpdatedContract.artifact); // and then upcoming work: const overrides = await fastForwardContractUpdate({ instanceAddress, newClassId, node }); await updatedContract.methods.set_private_value().simulate({ from, overrides }); ```
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
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.
BEGIN_COMMIT_OVERRIDE
refactor: drop artifact field from SimulationOverrides (#22957)
feat: public data tree overrides for simulation (#22830)
feat: expose wallet.registerContractClass (prep for simulating contract upgrades) (#22932)
END_COMMIT_OVERRIDE