Skip to content

refactor: remove dead old-style c_bind files#20422

Merged
johnathan79717 merged 2 commits intomerge-train/barretenbergfrom
jh/remove-dead-cbinds
Feb 12, 2026
Merged

refactor: remove dead old-style c_bind files#20422
johnathan79717 merged 2 commits intomerge-train/barretenbergfrom
jh/remove-dead-cbinds

Conversation

@johnathan79717
Copy link
Contributor

@johnathan79717 johnathan79717 commented Feb 12, 2026

Summary

  • Remove 24 dead c_bind.hpp/c_bind.cpp files that exported individual extern "C" WASM functions (the old binding architecture)
  • All functionality is now exclusively accessed through the unified bbapi() msgpack entry point by TypeScript (bb.js), Rust (barretenberg-rs), and the native CLI
  • Remove 3 now-empty object library references from CMakeLists.txt (crypto_blake3s_objects, crypto_ecdsa_objects, crypto_schnorr_objects)
  • Remove stale #include of deleted headers from 2 test files and stale c_bind.h from ecdsa
  • Add INTERFACE library support in module.cmake for header-only modules (blake3s, ecdsa, schnorr are now header-only after c_bind removal)

Binary size reduction

Binary Before After Reduction
barretenberg.wasm 10,355,061 9,839,961 -515,100 (5.0%)
barretenberg.wasm.gz 2,840,344 2,712,449 -127,895 (4.5%)
libbarretenberg.a 74,680,286 72,745,528 -1,934,758 (2.6%)

Test plan

  • Native build (cmake --preset clang20) succeeds
  • WASM build (cmake --preset wasm) succeeds
  • Fuzzing build (cmake --preset fuzzing) — fixed link error for header-only modules
  • CI passes

@johnathan79717 johnathan79717 added the ci-barretenberg Run all barretenberg/cpp checks. label Feb 12, 2026
@johnathan79717 johnathan79717 enabled auto-merge (squash) February 12, 2026 12:32
All per-module c_bind files (extern "C" WASM_EXPORT functions) have been
superseded by the unified bbapi msgpack entry point. TypeScript (bb.js),
Rust (barretenberg-rs), and the native CLI exclusively use bbapi() -
zero callers remain for the old individual exports.

Removes 24 dead files (1,512 lines), reduces WASM binary by ~500KB (5%).
Copy link
Contributor

@ledwards2225 ledwards2225 left a comment

Choose a reason for hiding this comment

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

This makes me so happy

Add INTERFACE library fallback in barretenberg_module_with_sources for
modules that have dependencies but no source files (now header-only after
c_bind removal). This fixes the fuzzing build where dependents couldn't
find crypto_blake3s, crypto_ecdsa, and crypto_schnorr as link targets.

Also removes the stale crypto/ecdsa/c_bind.h header.
@johnathan79717 johnathan79717 merged commit 12a9adb into merge-train/barretenberg Feb 12, 2026
11 of 12 checks passed
@johnathan79717 johnathan79717 deleted the jh/remove-dead-cbinds branch February 12, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-barretenberg Run all barretenberg/cpp checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants