Skip to content

feat: publish AVM CDB server bindings as @aztec/cdb - #25098

Merged
nchamo merged 4 commits into
merge-train/fairiesfrom
fc/cdb-ts-package
Aug 5, 2026
Merged

nchamo merged 4 commits into
merge-train/fairiesfrom
fc/cdb-ts-package

Conversation

@fcarreiro

@fcarreiro fcarreiro commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

yarn-project/simulator generates its cdb IPC server bindings at build time by reaching across the repo into ipc-codegen/ and barretenberg/cpp/.../cdb_schema.json. Both stay on the foundation side of the monorepo split, so the labs repo can't run that generate step (and file/portal links won't exist across repos).

Part of https://linear.app/aztec-labs/issue/A-1493/handle-new-ipc-work-for-the-initial-split .

Approach

Follow the @aztec/wsdb / @aztec/bb-avm-sim precedent: move the codegen to the foundation side and publish the generated bindings as an npm package, consumed by yarn-project like any other foundation dep.

  • ipc-codegen: --package combined with --server (and no --client) now emits a server binding package: wire types + Handler/handleRequest, no binary launcher, no arch packages. The schema file itself ships at the package root (exported as @aztec/cdb/cdb_schema.json) so consumers can regenerate bindings or inspect the wire contract. Client-package output is byte-identical to before (verified by regenerating the bb-avm-sim shell with old and new codegen).
  • barretenberg/ts: new fully-generated (gitignored) cdb workspace, wired into bootstrap.sh (generate_cdb_package / build_cdb / release_cdb). @aztec/cdb publishes in lockstep with @aztec/bb-avm-sim, whose compiled-in C++ cdb client must speak the same schema — pinning both to the same release makes wire skew impossible.
  • yarn-project: simulator drops its generate script and imports from @aztec/cdb (portal resolution for now; to be pinned alongside the other foundation packages). The gitignored simulator/src/public/cdb/generated dir is gone, and simulator leaves the bootstrap generate list.

The cache-hash inputs in yarn-project/bootstrap.sh are unchanged: the composed barretenberg/ipc-codegen component hashes now cover the portal'd package's inputs, and can be dropped once the dep is pinned.

Verification

  • @aztec/cdb generates and builds via barretenberg/ts/bootstrap.sh build_cdb.
  • Full yarn-project tsc build passes; cdb_ipc_server.test.ts passes; simulator lints clean.
  • Regenerating the bb-avm-sim client package with the old vs new generator produces identical output.

Follow-ups

  • Pin @aztec/cdb in the labs pinning branch to the same version as @aztec/bb-avm-sim, then drop the ipc-codegen/cdb hash inputs.
  • Optional hardening: schema-hash handshake on connect between bb-avm-sim and the TS server (both sides already export SCHEMA_HASH).

@socket-security

socket-security Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​aztec/​cdb@​0.0.0-use.localN/AN/AN/AN/AN/A

View full report

@fcarreiro
fcarreiro changed the base branch from monorepo-split/labs to merge-train/fairies August 4, 2026 16:01
The simulator generated its cdb IPC server bindings at build time by
reaching into ../../ipc-codegen and ../../barretenberg, both of which stay
on the foundation side of the monorepo split. Move the codegen to the
foundation side instead: a new generated workspace at barretenberg/ts/cdb
publishes @aztec/cdb — wire types, Handler/handleRequest, and
cdb_schema.json itself — built and released in lockstep with
@aztec/bb-avm-sim, whose compiled-in C++ client must speak the same schema.

ipc-codegen's --package mode gains a server-package flavor (--server
without --client): no binary launcher, no arch packages, and the schema
file ships at the package root for consumers that want to regenerate or
inspect the wire contract.

yarn-project consumes @aztec/cdb via a portal resolution (to be pinned
like the other foundation packages when the split lands) and drops the
simulator generate step.
@fcarreiro
fcarreiro marked this pull request as ready for review August 4, 2026 16:49
@fcarreiro
fcarreiro requested a review from IlyasRidhuan as a code owner August 4, 2026 16:49
@fcarreiro
fcarreiro requested review from nchamo and nventuro and removed request for IlyasRidhuan August 4, 2026 16:49
@nchamo
nchamo requested a review from charlielye as a code owner August 4, 2026 18:19
@nchamo
nchamo enabled auto-merge (squash) August 5, 2026 16:50
@nchamo
nchamo merged commit 4f8e6a7 into merge-train/fairies Aug 5, 2026
12 checks passed
@nchamo
nchamo deleted the fc/cdb-ts-package branch August 5, 2026 17:16
fcarreiro added a commit that referenced this pull request Aug 7, 2026
## Summary

- #25098 publishes the CDB server bindings as `@aztec/cdb`, so the
simulator no longer needs to generate
them. This drops the local codegen and consumes the package, following
#25093 for the other foundation
  packages.
- The published output is byte-identical to what `ipc-codegen` produced
here, and `cdb_ipc_server.ts` now
matches `next`'s already-migrated version exactly. Also removes the
`generate` script, its `build:fuzzer`
call, the `simulator` entry in the bootstrap generate fan-out, and the
now-inputless
`ipc-codegen`/`cdb_schema.json` patterns in the yarn-project build hash.
- Bumps the labs pin to `6.0.0-nightly.20260807`, because `@aztec/cdb`
does not exist at the nightly this
branch was previously pinned to. #25097's three artifact packages move
with it, since `check_pin_drift`
requires every `@aztec/*` resolution to match `BB_VERSION`. The noir
submodule and both pinned Noir
  crates are byte-identical across the bump.
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