Skip to content

Conversation

@ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented Feb 3, 2026

BEGIN_COMMIT_OVERRIDE
cherchore: graph tooling audit 0 (#19691)
chore: opt sol scope renaming (#20123)
feat: add download functionality to barretenberg-rs build.rs (#20105)
fix: set BB_LIB_DIR in build function (ffi feature is on by default)
Revert barretenberg-rs download functionality
feat: re-land barretenberg-rs download functionality with fixes (#20128)
fix: skip FFI feature in PipeBackend tests
fix: skip FFI feature in PipeBackend tests
END_COMMIT_OVERRIDE

@ledwards2225 ledwards2225 marked this pull request as ready for review February 3, 2026 10:18
Primary changes:
- Replace methods of the form `get_*_gate_connected_component` with
`GatePattern` structs that specify the conditions under which each wire
is constrained for each gate type
- Test correctness of `GatePattern`'s by perturbing relation inputs to
empirically check which wires are constrained (`gate_patterns.test.cpp`)
- Resolves a few bugs/errors identified by the aforementioned tests (see
PR comments)
- Use `update_used_witnesses` in `fix_witness` to avoid need for ad-hoc
handling in the tooling

Cleanup:
- Replace use of `block_idx` with reference to `block` in several places
for improved clarity

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
ledwards2225 and others added 2 commits February 3, 2026 10:40
.

---------

Co-authored-by: iakovenkos <sergey.s.yakovenko@gmail.com>
@ledwards2225 ledwards2225 changed the title Merge train/barretenberg feat: merge-train/barretenberg Feb 3, 2026
johnathan79717 and others added 8 commits February 3, 2026 12:04
## Summary

This PR adds download functionality to barretenberg-rs `build.rs` to
fetch pre-built static libraries from GitHub releases.

**What this PR does:**
- `build.rs` now downloads `libbb-external.a` from GitHub releases when
local cpp build is not available
- Add `test_download` command to `bootstrap.sh` to verify download path
works
- Uses `BARRETENBERG_VERSION` env var or falls back to crate version
- Blocks version `0.0.1` to prevent accidental downloads during
development

**Download logic:**
1. First checks for local `../../cpp/build/lib/libbb-external.a` (for
development)
2. If not found, downloads from
`https://github.com/AztecProtocol/aztec-packages/releases/download/v{version}/barretenberg-static-{arch}-linux.tar.gz`
3. Extracts to cargo's `OUT_DIR`

**Test command:**
```bash
BARRETENBERG_VERSION=0.0.1-commit.d431d1c ./bootstrap.sh test_download
```

## Test plan
- [x] Tested locally with `BARRETENBERG_VERSION=0.0.1-commit.d431d1c
./bootstrap.sh test_download`
- [x] Verified FFI tests pass with downloaded library
- [x] Verified local library is restored after test

---------

Co-authored-by: Claude <noreply@anthropic.com>
The ffi feature is enabled by default in Cargo.toml, so the build
function needs BB_LIB_DIR to point to the local cpp library. Without
this, build.rs tries to download from GitHub releases which fails for
development versions.
This reverts commits:
- 971e41b fix: set BB_LIB_DIR in build function
- 98d4776 feat: add download functionality to barretenberg-rs build.rs

Will re-land with fixes in a separate PR.
## Summary
Re-lands the download functionality from #20105 with the following
fixes:
- Check for all 0.x.x development versions, not just 0.0.1
- Set BB_LIB_DIR in build function (ffi feature is on by default)

The build.rs now properly detects development versions and requires
either
BARRETENBERG_VERSION to be set to a released version, or BB_LIB_DIR to
point to a local build.

## Test plan
- CI will verify the build and tests pass
@AztecBot
Copy link
Collaborator

AztecBot commented Feb 3, 2026

⚠️ Docs Examples Validation Failed

TypeScript validation

(truncated)...
portals and that's why �[96m--preserve-symlinks�[39m Node option is required for launching it
aztecjs_connection	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_advanced	�[94m➤�[39m �[90mYN0000�[39m: ┌ Resolution step
aztecjs_advanced	�[94m➤�[39m �]8;;https://yarnpkg.com/advanced/error-codes#yn0085---updated_resolution_record�YN0085�]8;;�: │ �[32m+�[39m �[91m@aztec/�[39m�[91maccounts�[39m�[96m@�[39m�[96mlink:/home/aztec-dev/aztec-packages/yarn-project/accounts::locator=aztecjs_advanced%40workspace%3A.�[39m, and �[93m5�[39m more.
aztecjs_advanced	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_advanced	�[94m➤�[39m �[90mYN0000�[39m: ┌ Fetch step
aztecjs_advanced	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_advanced	�[94m➤�[39m �[90mYN0000�[39m: ┌ Link step
aztecjs_authwit	�[94m➤�[39m �[90mYN0000�[39m: ┌ Resolution step
aztecjs_authwit	�[94m➤�[39m �]8;;https://yarnpkg.com/advanced/error-codes#yn0085---updated_resolution_record�YN0085�]8;;�: │ �[32m+�[39m �[91m@aztec/�[39m�[91maccounts�[39m�[96m@�[39m�[96mlink:/home/aztec-dev/aztec-packages/yarn-project/accounts::locator=aztecjs_authwit%40workspace%3A.�[39m, and �[93m3�[39m more.
aztecjs_authwit	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_authwit	�[94m➤�[39m �[90mYN0000�[39m: ┌ Fetch step
aztecjs_getting_started	�[93m➤�[39m �]8;;https://yarnpkg.com/advanced/error-codes#yn0072---nm_preserve_symlinks_required�YN0072�]8;;�: │ The application uses portals and that's why �[96m--preserve-symlinks�[39m Node option is required for launching it
aztecjs_connection	�[93m➤�[39m YN0000: · Done with warnings in 0s 46ms
aztecjs_authwit	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_authwit	�[94m➤�[39m �[90mYN0000�[39m: ┌ Link step
aztecjs_getting_started	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_getting_started	�[93m➤�[39m YN0000: · Done with warnings in 0s 46ms
aztecjs_advanced	�[93m➤�[39m �]8;;https://yarnpkg.com/advanced/error-codes#yn0072---nm_preserve_symlinks_required�YN0072�]8;;�: │ The application uses portals and that's why �[96m--preserve-symlinks�[39m Node option is required for launching it
aztecjs_advanced	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_advanced	�[93m➤�[39m YN0000: · Done with warnings in 0s 49ms
aztecjs_authwit	�[93m➤�[39m �]8;;https://yarnpkg.com/advanced/error-codes#yn0072---nm_preserve_symlinks_required�YN0072�]8;;�: │ The application uses portals and that's why �[96m--preserve-symlinks�[39m Node option is required for launching it
aztecjs_authwit	�[94m➤�[39m �[90mYN0000�[39m: └ Completed
aztecjs_authwit	�[93m➤�[39m YN0000: · Done with warnings in 0s 51ms
aztecjs_connection	Verifying linked packages...
aztecjs_connection	✓ @aztec/aztec.js: 77 .d.ts files
aztecjs_advanced	Verifying linked packages...
aztecjs_getting_started	Verifying linked packages...
aztecjs_connection	✓ @aztec/accounts: 27 .d.ts files
aztecjs_advanced	✓ @aztec/aztec.js: 77 .d.ts files
aztecjs_getting_started	✓ @aztec/aztec.js: 77 .d.ts files
aztecjs_connection	✓ @aztec/test-wallet: 8 .d.ts files
aztecjs_authwit	Verifying linked packages...
aztecjs_advanced	✓ @aztec/accounts: 27 .d.ts files
aztecjs_getting_started	✓ @aztec/accounts: 27 .d.ts files
aztecjs_connection	✓ @aztec/noir-contracts.js: 33 .d.ts files
aztecjs_authwit	✓ @aztec/aztec.js: 77 .d.ts files
aztecjs_advanced	✓ @aztec/test-wallet: 8 .d.ts files
aztecjs_getting_started	✓ @aztec/test-wallet: 8 .d.ts files
aztecjs_authwit	✓ @aztec/accounts: 27 .d.ts files
aztecjs_advanced	✓ @aztec/noir-contracts.js: 33 .d.ts files
aztecjs_getting_started	✓ @aztec/noir-contracts.js: 33 .d.ts files
aztecjs_authwit	✓ @aztec/test-wallet: 8 .d.ts files
aztecjs_advanced	✓ @aztec/ethereum: 85 .d.ts files
aztecjs_authwit	✓ @aztec/noir-contracts.js: 33 .d.ts files
aztecjs_advanced	✓ @aztec/stdlib: 475 .d.ts files
aztecjs_getting_started	Type checking 'aztecjs_getting_started'...
aztecjs_advanced	Type checking 'aztecjs_advanced'...
aztecjs_connection	Type checking 'aztecjs_connection'...
aztecjs_authwit	Type checking 'aztecjs_authwit'...
aztecjs_advanced	index.ts(114,48): error TS2339: Property 'instance' does not exist on type 'TokenContract'.
aztecjs_advanced	ERROR: Type checking failed for 'aztecjs_advanced'
aztecjs_advanced	Validation failed for 'aztecjs_advanced', cleaning up...
parallel: This job failed:
validate_project aztecjs_advanced
Seq	Host	Starttime	JobRuntime	Send	Receive	Exitval	Signal	Command
1	:	1770126952.704	     5.009	0	2191	1	0	validate_project aztecjs_advanced
ERROR: Some project(s) failed validation

Action required: Please fix the docs examples or update them to match the current API.

cc @AztecProtocol/devrel

johnathan79717 and others added 3 commits February 3, 2026 14:23
The ffi feature is enabled by default, so 'cargo test --release' tries
to build FFI and fails without BB_LIB_DIR. Use --no-default-features
to only run the PipeBackend tests, which spawn the bb binary instead.
The ffi feature is enabled by default, so 'cargo test --release' tries
to build FFI and fails without BB_LIB_DIR. Use --no-default-features
to only run the PipeBackend tests, which spawn the bb binary instead.
@iakovenkos iakovenkos enabled auto-merge February 3, 2026 16:00
@iakovenkos iakovenkos added this pull request to the merge queue Feb 3, 2026
Merged via the queue into next with commit 416a26b Feb 3, 2026
23 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.

6 participants