Skip to content

feat: AVM cutover — delete NAPI AVM, wire IPC simulator pool + CDB IPC server [PR 3b]#23154

Closed
charlielye wants to merge 4 commits into
cl/ipc-4-avm-binaryfrom
cl/ipc-5-avm-cutover
Closed

feat: AVM cutover — delete NAPI AVM, wire IPC simulator pool + CDB IPC server [PR 3b]#23154
charlielye wants to merge 4 commits into
cl/ipc-4-avm-binaryfrom
cl/ipc-5-avm-cutover

Conversation

@charlielye
Copy link
Copy Markdown
Contributor

Summary

Cuts the in-process NAPI AVM over to the standalone aztec-avm binary (PR 3a) + a TS-hosted CdbIpcServer for contract data callbacks. NAPI AVM and its TsCallback-based contracts DB are deleted.

This is the third (and final) stage of the WSDB/AVM IPC architecture migration:

  • PR 1: shared IPC transport (MPSC SHM)
  • PR 2a/2b: WSDB cutover (#23036)
  • PR 3a: aztec-avm + aztec-cdb binaries + supporting code, inert (#23084)
  • PR 3b (this): cutover — NAPI AVM deleted, IPC AVM used in block-building, validator, prover-node, txe

NAPI side (delete)

  • Delete barretenberg/cpp/src/barretenberg/nodejs_module/avm_simulate/ (NAPI AVM module + TS-callback contracts DB + utils).
  • Strip the AVM exports from init_module.cpp; nodejs_module.node now exposes only LMDBStore, MsgpackClient, MsgpackClientAsync.
  • Drop the NativeAvm/NativeAvmCancellationToken exports from @aztec/native.

TS side (rewire)

  • public_tx_simulator/cpp_public_tx_simulator.ts drives an AvmIpcBackend (pool from PR 3a), returns SimulationHandle { result, cancel }.
  • public_tx_simulator/factories.ts returns the IPC simulator for production block building and proving.
  • public_processor + guarded_merkle_tree updated for the new SimulationHandle and AvmIpcBackend types.
  • public_tx_simulator/ipc_vs_ts_public_tx_simulator.ts added as the new dual-run test helper (replaces cpp_vs_ts_public_tx_simulator.ts).
  • public_tx_simulator/dumping_cpp_public_tx_simulator.ts updated to dump IPC msgpack inputs.

Integration

  • aztec-node/src/aztec-node/server.ts spawns AvmBackend + CdbIpcServer alongside WsdbBackend.
  • validator-client/checkpoint_builder and prover-node wired through.
  • txe test infra uses the same backends.

Removed test

  • simulator/src/public/public_processor/apps_tests/timeout_race.test.ts — the bug it guarded against (in-process C++ AVM racing TS checkpoint reverts on the same WorldState handle) is structurally impossible once the AVM is a separate process. The cancellation path remains exercised through SimulationHandle.cancel().

Stack mechanics

Test plan

  • yarn-project build green
  • simulator unit tests pass
  • e2e_block_building / e2e_avm_simulator pass
  • e2e_fees/account_init passes (the partial-note gas-exhaustion bug that bounded the original PR — bug-fix zone for this PR)
  • Local sandbox boots and accepts a transaction

…C server

Replaces the in-process NAPI AVM with the standalone aztec-avm binary
(spawned via AvmBackend from PR 3a) and a TS-hosted CdbIpcServer for the
contract data callbacks.

Stacked on top of PR 2b (cl/ipc-3-avm-wsdb-cutover, #23036) and PR 3a
(cl/ipc-4-avm-binary, #23084).
@charlielye charlielye marked this pull request as ready for review May 11, 2026 16:45
…rretenberg

The link line was reduced to `barretenberg ipc` when stripping the NAPI AVM,
but LMDBStore is still exported from nodejs_module and needs LMDB symbols
(mdb_cursor_open etc). The all-in-one barretenberg archive does not pull in
LMDB. world_state does (it owns the LMDB tree storage), and since LMDBStore
itself is the only thing in nodejs_module that needs LMDB, depending on
world_state is the right fit. Mirrors cl/wsdb_cdb.
@AztecBot
Copy link
Copy Markdown
Collaborator

This issue was automatically closed because it was referenced in PR #23040 which has been merged to the default branch.

View workflow run

@AztecBot AztecBot closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants