Skip to content

feat: infrastructure for testing [new_contract_artfiacts, old_aztec_stack]#22593

Merged
benesjan merged 9 commits intomerge-train/fairiesfrom
jan/f-552-forward-compat-testing-wallet-service-rpc-client-test-suite
Apr 16, 2026
Merged

feat: infrastructure for testing [new_contract_artfiacts, old_aztec_stack]#22593
benesjan merged 9 commits intomerge-train/fairiesfrom
jan/f-552-forward-compat-testing-wallet-service-rpc-client-test-suite

Conversation

@benesjan
Copy link
Copy Markdown
Contributor

@benesjan benesjan commented Apr 16, 2026

In this PR I add the testing infrastructure that allows us to test new contract artifacts (artifacts from the release that will be getting build) with an old release of a stack. To achieve this I expose a Wallet service over JSON-RPC and then connect it to via wallet client from an e2e test.

In this PR I get this to work but it's not yet integrated into the CI release process - this makes sense to do after the next release as at that point we will have a release we can start testing against (e.g. to test release 10 I need release 9 to already contain this code such that I can spin up the wallet service from release 9 - this implies integrating this will make sense in like 2 weeks).

Also in this PR I only refactored the e2e_amm which is not sufficient to test the full oracle suite but it makes sense to add more tests in a followup to keep the scope small. e2e_amm tests well enough that the new infra works.

For more context see this slack discussion.

Summary

  • Adds createWalletClient(url) thin RPC client in aztec.js for connecting to a remote wallet service over JSON-RPC
  • Adds wallet_service.ts standalone entrypoint in end-to-end that spins up a local Aztec network + EmbeddedWallet and serves both over HTTP RPC (test-only, NOT in the aztec binary)
  • Adds docker-compose.yml for forward-compat testing with old-stack (old release image) and new-tree test containers
  • Adds refactored e2e_amm.test.ts in backwards-compat/ using standard Wallet interface and remote wallet RPC

Closes F-552

@benesjan benesjan changed the title feat: forward-compat testing wallet service, RPC client, and docker-compose feat: infrastructure for testing [new_contract_artfiacts, old_aztec_stack] Apr 16, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@benesjan benesjan force-pushed the jan/f-552-forward-compat-testing-wallet-service-rpc-client-test-suite branch from 729b397 to cc67b64 Compare April 16, 2026 07:17
await mintTokensToPrivate(token0, adminAddress, swapperAddress, INITIAL_TOKEN_BALANCE);
});

describe('full flow', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A pure copy from yarn-project/end-to-end/src/e2e_amm.test.ts follows

@benesjan benesjan marked this pull request as ready for review April 16, 2026 07:48
@benesjan benesjan requested review from Thunkar and mverzilli April 16, 2026 08:44
benesjan and others added 9 commits April 16, 2026 14:51
…ompose

Add infrastructure for forward-compatibility testing: old wallet/PXE
processing contracts compiled with the latest Noir.

- `createWalletClient(url)` thin RPC client in aztec.js that proxies
  Wallet interface calls over JSON-RPC
- `wallet_service.ts` standalone entrypoint in end-to-end that spins up
  a local network, creates an EmbeddedWallet, and serves both node and
  wallet over HTTP RPC (test-only, not in the aztec binary)
- `docker-compose.yml` for forward-compat testing with old-stack and
  new-tree test containers
- Refactored `e2e_amm.test.ts` for backwards-compat directory using
  standard Wallet interface and remote wallet RPC

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create a 4th Schnorr account in the wallet service so the test body is
identical to the original e2e_amm.test.ts (separate admin, LP1, LP2,
swapper roles). Restores all original comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The 4th account needs fee juice to send transactions. Compute its
address before createLocalNetwork and pass it via prefundAddresses so
it gets funded at genesis, matching how the 3 initial test accounts
are funded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benesjan benesjan force-pushed the jan/f-552-forward-compat-testing-wallet-service-rpc-client-test-suite branch from d91b93c to 132ce1d Compare April 16, 2026 14:58
Copy link
Copy Markdown
Contributor

@Thunkar Thunkar left a comment

Choose a reason for hiding this comment

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

Nice!

@benesjan benesjan enabled auto-merge (squash) April 16, 2026 15:17
@benesjan benesjan merged commit 77bc527 into merge-train/fairies Apr 16, 2026
21 of 25 checks passed
@benesjan benesjan deleted the jan/f-552-forward-compat-testing-wallet-service-rpc-client-test-suite branch April 16, 2026 15:18
AztecBot pushed a commit that referenced this pull request Apr 16, 2026
…stack]` (#22593)

In this PR I add the testing infrastructure that allows us to test new
contract artifacts (artifacts from the release that will be getting
build) with an old release of a stack. To achieve this I expose a Wallet
service over JSON-RPC and then connect it to via wallet client from an
e2e test.

In this PR I get this to work but it's not yet integrated into the CI
release process - this makes sense to do after the next release as at
that point we will have a release we can start testing against (e.g. to
test release 10 I need release 9 to already contain this code such that
I can spin up the wallet service from release 9 - this implies
integrating this will make sense in like 2 weeks).

Also in this PR I only refactored the `e2e_amm` which is not sufficient
to test the full oracle suite but it makes sense to add more tests in a
followup to keep the scope small. `e2e_amm` tests well enough that the
new infra works.

For more context see [this slack
discussion](https://aztecprotocol.slack.com/archives/C07R3GTKJ49/p1776137361334029).

## Summary
- Adds `createWalletClient(url)` thin RPC client in `aztec.js` for
connecting to a remote wallet service over JSON-RPC
- Adds `wallet_service.ts` standalone entrypoint in `end-to-end` that
spins up a local Aztec network + EmbeddedWallet and serves both over
HTTP RPC (test-only, NOT in the `aztec` binary)
- Adds `docker-compose.yml` for forward-compat testing with old-stack
(old release image) and new-tree test containers
- Adds refactored `e2e_amm.test.ts` in `backwards-compat/` using
standard `Wallet` interface and remote wallet RPC

Closes
[F-552](https://linear.app/aztec-labs/issue/F-552/infrastructure-for-testing-new-contract-artfiacts-old-aztec-stack)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@AztecBot
Copy link
Copy Markdown
Collaborator

✅ Successfully backported to backport-to-v4-next-staging #22580.

github-merge-queue bot pushed a commit that referenced this pull request Apr 17, 2026
BEGIN_COMMIT_OVERRIDE
feat: check noir release has nargo binaries before releasing (#22551)
chore: cache chainInfo in embeddedwallet (#22592)
fix: wrap external getCapsule in transactionAsync (#22595)
fix(pxe): throw clear error for invalid comparator in pick_notes
(#22585)
refactor(aztec-nr): rename conversion fns to encode_/decode_ naming
(#22576)
fix: adding transactions to PXE stores (#22603)
feat: infrastructure for testing `[new_contract_artfiacts,
old_aztec_stack]` (#22593)
chore: fix unnecessary and inconsistent side-effect counter increments
(#22245)
feat(aztec-nr): new BoundedVec emit private log APIs (#22064)
END_COMMIT_OVERRIDE
Thunkar added a commit that referenced this pull request Apr 17, 2026
BEGIN_COMMIT_OVERRIDE
fix(pxe): cap event filter toBlock to last synced block (#22573)
fix(pxe): round tx expiration timestamp to reduce precision (#22577)
fix: eliminate anvil watcher warp race and false success logs (#22584)
refactor: aztec new and init creating 2 crates (#20681)
test: aztec new scaffold works (#20711)
feat(cli): warning if contract crate has tests (#20723)
feat(cli): auto-recompiling when aztec test is run (#20729)
feat: aztec new supporting multiple contract crates (#21007)
feat: asserts that aztec dep version matches cli (#21245)
chore: backport aztec CLI improvements to v4-next (#22587)
feat: check noir release has nargo binaries before releasing (#22551)
chore: cache chainInfo in embeddedwallet (#22592)
fix: wrap external getCapsule in transactionAsync (#22595)
fix(pxe): throw clear error for invalid comparator in pick_notes
(#22585)
refactor(aztec-nr): rename conversion fns to encode_/decode_ naming
(#22576)
feat: infrastructure for testing `[new_contract_artfiacts,
old_aztec_stack]` (#22593)
chore: fix unnecessary and inconsistent side-effect counter increments
(#22245)
fix: update FaceID wallet redirects and strip anchors in redirect
validation (#22505)
docs: add getting started on testnet guide (#22366)
docs: add getting started on testnet guide (backport #22366) (#22619)
feat(aztec-nr): new BoundedVec emit private log APIs (#22064)
END_COMMIT_OVERRIDE
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