Skip to content

feat: merge-train/fairies#23079

Merged
Thunkar merged 21 commits intonextfrom
merge-train/fairies
May 10, 2026
Merged

feat: merge-train/fairies#23079
Thunkar merged 21 commits intonextfrom
merge-train/fairies

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented May 8, 2026

BEGIN_COMMIT_OVERRIDE
fix: include sqlite binary in its npm package (#23039)
fix: add sendMessagesAs to wallet api schemas (#23041)
refactor(pxe): deduplicate tx hash lookups in MessageContextService (#23075)
refactor(pxe): batch tagged private log queries across all secrets (#23048)
refactor(pxe): batch log RPC calls in LogService.fetchLogsByTag (#23088)
feat(pxe,nr): flesh out account stubs and don't exclude syncing for overrides (#23054)
feat: deploy method refactor 2 (#23033)
feat: fastForwardContractUpdate cheatcode for simulating contract updates (#22905)
refactor(stdlib): consolidate find-function-by-selector helpers (#23008)
feat(ci): Snapshots for aztec-nr contract compilation failures and nargo expand (#23061)
chore: kv store test fully on vitest (#23096)
refactor(pxe): skip redundant getBlock RPC when querying at anchor block (#23100)
chore(playground): bump main chunk size limit 1750 → 1800 KB (#23107)
feat(txe): allow authorizing cross-contract utility calls in nr tests (#23064)
chore: bench public fns with emit repro (#23105)
refactor(pxe): short-circuit block header lookup at anchor block (#23128)
END_COMMIT_OVERRIDE

We correctly .gitignore prebuilt sqlite artifacts since we fetch and
verify them on build, however, this is inconvenient for users of our
packages, since it leaves the burden of re-vendoring up to them.

This PR introduces an .npmignore file to the sqlite npm package, which
by convention overshadows the .gitignore file when npm produces the
package tarball.

It also includes a verification script to make sure there's no loose
ends in the process
mverzilli and others added 7 commits May 8, 2026 07:48
`sendMessagesAs` was not added to Zod schemas, which caused the param to
be dropped when serialized to cross process boundaries (needed for
extension wallet work)
…verrides (#23054)

flesh out account stubs so that syncing actually works for them, and
then remove their exclusion
## Summary

Splits `DeployMethod` into an abstract umbrella type plus three concrete
flavors that encode the deployer-lock state at the type level instead of
branching on a nullable field.

- `DeployMethod<T>` — abstract base, the type consumers use generically
(`let d: DeployMethod<MyContract> = ...`).
- `BoundDeployMethod` — locked to a concrete `deployer`.
- `UniversalDeployMethod` — locked to `AztecAddress.ZERO` (any sender).
- `PendingDeployMethod` — promotes into a `Bound`/`Universal` sibling on
the first `send` / `simulate` / `profile` call.

The three flavor-specific decisions (`getDeployerAddress`,
`lockOrAssertDeployer`, `cloneInstantiation`) are now abstract methods
rather than `if (this.deployer === undefined / equals(ZERO) / else)`
branches in the base.

## Compile-time guarantees

Each subclass takes a narrowed instantiation type:

- `BoundInstantiationOptions` — `deployer` required, `universalDeploy:
never`.
- `UniversalInstantiationOptions` — `universalDeploy: true` required,
`deployer: never`.
- `PendingInstantiationOptions` — both `never`.

`new BoundDeployMethod(..., { universalDeploy: true })` is now a
TypeScript error. The runtime mutual-exclusion checks in subclass
constructors are gone; the only runtime guard left is
`BoundDeployMethod` rejecting `AztecAddress.ZERO` (a value-level
invariant the type system can't model).

## Constructor shape

Subclass constructors take named bundles instead of 9 positionals:

```ts
new BoundDeployMethod(wallet, contract, instantiation, payload?)
//                            ^               ^             ^
//   { artifact, postDeployCtor, args, constructorNameOrArtifact }
//                            { salt, publicKeys, deployer }
//                            { authWitnesses, capsules, extraHashedArgs }
```

`DeployMethod.create` follows the same shape. `Contract.deploy(wallet,
artifact, args, constructorName, instantiation)` and
`MyContract.deploy(wallet, ...args, instantiation?)` (codegen) are
**unchanged** — the bundle reshape stops at the `create` boundary.

## Other changes

- `DeployAccountMethod` now extends `UniversalDeployMethod` (account
contracts are always universal).
…ates (#22905)

Adds `fastForwardContractUpdate` to aztec.js — a high-level cheatcode
that returns a `SimulationOverrides` blob 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.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.

```typescript
import { fastForwardContractUpdate } from '@aztec/aztec.js';

const overrides = await fastForwardContractUpdate({ instanceAddress, newClassId, node });
const result = await contract.methods.upgraded_method().simulate({ overrides });
```

## Test plan

- Unit tests in `fastforward_contract_update.test.ts` cover validation
and override shape.
- E2E coverage in `e2e_contract_updates` for both public and private
dispatch under override (private dispatch needs
`wallet.registerContractClass` from upstack and the sync-skip narrowing
from upstack).
- `migration_notes.md` and `how_to_test.md` updated.
dbanks12 and others added 2 commits May 8, 2026 10:25
## Summary

Addresses comment
#22957 (comment)

The same artifact-lookup loop was duplicated three times. Puts two
helper fns in `stdlib/abi`:

- `findFunctionArtifactBySelector(artifact, selector)` — searches
`artifact.functions`, returns `FunctionArtifact | undefined`.
- `findFunctionAbiBySelector(artifact, selector)` — searches
`artifact.functions ∪ nonDispatchPublicFunctions` via
`getAllFunctionAbis`, returns `FunctionAbi | undefined`.

Both `ContractStore` and `ProxiedContractStoreFactory` now call the same
stdlib primitive. The existing throwing `getFunctionArtifact` helper
also reuses `findFunctionArtifactBySelector`.

## Test plan

- [x] `yarn workspace @aztec/pxe test
src/storage/contract_store/contract_store.test.ts`
- [x] `yarn workspace @aztec/stdlib test src/abi/abi.test.ts`
- [x] `yarn lint pxe`, `yarn lint stdlib`
…rgo expand (#23061)

Resolves
[F-607](https://linear.app/aztec-labs/issue/F-607/adopt-cargo-insta-for-noir-contract-snapshot-testing)

Don't be scared by the diff size, the majority of the diff is new
snapshots.

- Deleted `noir-projects/noir-contracts-comp-failures/` crate. We now
have `noir-projects/contract-snapshots/`
- `nargo expand` tests cover Token, AMM, StorageProofTest, AvmTest,
AvmGadgetsTest to match the CI benchmarks
- `compile_failure` snapshots are now full stderr (not just `error: `
headlines)

Asserting the full stderr and `expand` output provide us a strong test
invariant on the current compiler behavior. Some of the expanded
snapshots are quite large, and that is why I ultimately chose to only
have snapshots for the benchmark contracts. For compilation failures, I
felt it would be better to have the full snapshot in all cases. We then
assert against the actual compiler behavior rather than some stripped
version of the stderr.

A great example of how these snapshots are useful can be seen in the
child PR #23062.
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 8, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​insta@​1.47.29310093100100

View full report

mverzilli and others added 5 commits May 8, 2026 15:52
Deprecates mocha as a test runner for kv-store (we currently half part
in mocha part in vitest). The seemingly off-topic change in stdlib stems
from L2TipsStore tests being generated from there but consumed from
kv-store. It's a bit of a strange pattern that maybe we should
reconsider.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary

Fix CI failure on `merge-train/fairies` (run
[25572561023](https://github.com/AztecProtocol/aztec-packages/actions/runs/25572561023),
log [1778264338812903](http://ci.aztec-labs.com/1778264338812903)).

The merge of `next` into `merge-train/fairies` (78632af) brought in
barretenberg changes — `feat!: optimized Poseidon2 (#22652)` and `feat:
n1 apps (#22974)` via `feat: merge-train/barretenberg (#23025)` — which
grew bb.js by enough to push the playground main entrypoint 0.02 KB over
the 1750 KB hard limit:

```
❌ assets/index-BEz4wQVA.js: 1750.02 KB exceeds limit of 1750 KB (Main entrypoint, hard limit)
```

Bumping the limit to 1800 KB (matching the prior +50 KB increment from
the bump log) restores headroom.

## Test plan

- [ ] CI green on this PR (chunk size check passes)


ClaudeBox log: https://claudebox.work/s/22af49d0486fc035?run=1
@Thunkar Thunkar self-requested a review as a code owner May 8, 2026 19:00
@nchamo nchamo requested a review from nventuro as a code owner May 8, 2026 19:05
AztecBot and others added 4 commits May 8, 2026 19:42
Adds a bench for the contract shape from
AztecProtocol/aztec-nr#35 (15 public fns each
emitting an event). No existing bench target covers this flow. I want to
see the benefits from follow-up improvements.
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 9, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator Author

AztecBot commented May 9, 2026

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

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 9, 2026
@Thunkar Thunkar added this pull request to the merge queue May 9, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 9, 2026
)

## Summary

- Skip the `aztecNode.getBlock` RPC in `getBlockHeader` when the
requested block number matches the anchor — the anchor's header is
already in memory.
- Most utility executions query state at the anchor block, so this
avoids a redundant round-trip on the hot path.

Co-authored-by: Nico Chamo <nico.chamo@gmail.com>
@Thunkar Thunkar enabled auto-merge May 10, 2026 09:11
@Thunkar Thunkar added this pull request to the merge queue May 10, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/67f1d51ef0500ff7�67f1d51ef0500ff78;;�): yarn-project/scripts/run_test.sh bb-prover/src/avm_proving_tests/avm_check_circuit_token.test.ts (5s) (code: 0)

Merged via the queue into next with commit 3c8a9c6 May 10, 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.

7 participants