Skip to content

feat: merge-train/fairies#23074

Merged
AztecBot merged 3 commits into
nextfrom
merge-train/fairies
May 8, 2026
Merged

feat: merge-train/fairies#23074
AztecBot merged 3 commits into
nextfrom
merge-train/fairies

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented May 8, 2026

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

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.
dbanks12 added 2 commits May 7, 2026 21:24
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 });
```
Copy link
Copy Markdown
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot AztecBot added this pull request to the merge queue May 8, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator Author

AztecBot commented May 8, 2026

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

Merged via the queue into next with commit 999138f May 8, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants