Skip to content

chore: prepare barretenberg-rs for crates.io publishing#20496

Merged
ludamad merged 3 commits intomerge-train/barretenbergfrom
jh/commit-generated-rust-files
Feb 18, 2026
Merged

chore: prepare barretenberg-rs for crates.io publishing#20496
ludamad merged 3 commits intomerge-train/barretenbergfrom
jh/commit-generated-rust-files

Conversation

@johnathan79717
Copy link
Contributor

@johnathan79717 johnathan79717 commented Feb 13, 2026

Summary

  • Add include field to barretenberg-rs Cargo.toml so generated api.rs and generated_types.rs are packaged by cargo publish, even though they remain gitignored
  • Add release function to barretenberg/rust/bootstrap.sh — sets crate version from REF_NAME, verifies generated files exist, and runs cargo publish
  • Hook barretenberg/rust into the top-level release orchestrator (after barretenberg/ts which generates the Rust bindings)
  • Add publish = false to the tests crate

How it works

  1. Generated files stay gitignored — not committed to the repo
  2. The include field in Cargo.toml overrides .gitignore for cargo publish, so the files are packaged as long as they exist on disk
  3. During a release, barretenberg/ts runs first (which calls yarn generate), then barretenberg/rust publishes
  4. No separate workflow — follows the same unified release flow as npm packages

Test plan

  • cargo package --list --allow-dirty confirms src/api.rs and src/generated_types.rs are included
  • cargo publish --dry-run --allow-dirty --no-verify succeeds
  • Set CARGO_REGISTRY_TOKEN env var in release environment before first publish

@ludamad
Copy link
Collaborator

ludamad commented Feb 13, 2026

I'm opposed to this. this is how people get messy PR diffs and end up having to ask if they're messing something up

@johnathan79717 johnathan79717 force-pushed the jh/commit-generated-rust-files branch from b00d10e to e2ffe4a Compare February 13, 2026 17:21
@johnathan79717 johnathan79717 changed the title chore: commit generated Rust files for barretenberg-rs publishing chore: prepare barretenberg-rs for crates.io publishing Feb 13, 2026
@johnathan79717 johnathan79717 marked this pull request as draft February 13, 2026 17:22
@johnathan79717
Copy link
Contributor Author

johnathan79717 commented Feb 13, 2026

I'm opposed to this. this is how people get messy PR diffs and end up having to ask if they're messing something up

I uncommitted those files.

@johnathan79717 johnathan79717 marked this pull request as ready for review February 13, 2026 17:47
@johnathan79717 johnathan79717 removed the request for review from charlielye February 16, 2026 10:53
@johnathan79717 johnathan79717 force-pushed the jh/commit-generated-rust-files branch 3 times, most recently from 021e990 to ee3a66c Compare February 17, 2026 12:08
- Add `include` field to Cargo.toml so generated api.rs and
  generated_types.rs are packaged even though they're gitignored
- Add `release` function to barretenberg/rust/bootstrap.sh that sets
  the crate version from REF_NAME and runs `cargo publish`
- Hook barretenberg/rust into the top-level release orchestrator
  (after barretenberg/ts which generates the Rust bindings)
- Add `publish = false` to the tests crate
@johnathan79717 johnathan79717 force-pushed the jh/commit-generated-rust-files branch from ee3a66c to 32cd2c2 Compare February 17, 2026 12:10
Account for min_start and max_end across all polynomials when batching,
so that reordering polynomials (e.g. if the 0th poly has a greater start
index) doesn't silently produce incorrect results.
@ludamad ludamad merged commit 94047ad into merge-train/barretenberg Feb 18, 2026
9 checks passed
@ludamad ludamad deleted the jh/commit-generated-rust-files branch February 18, 2026 16:08
github-merge-queue bot pushed a commit that referenced this pull request Feb 18, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk rec ver 0 (#20506)
fix: allocate non-gate selectors at trace-active size instead of dyadic
size (#20600)
chore: numeric audit 0 (#20491)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
chore: add build_bench to ci-barretenberg-full (#20650)
chore: add component graphs for app-proving benchmarks (#20649)
END_COMMIT_OVERRIDE
@johnathan79717
Copy link
Contributor Author

Backporting this to v4 because we need to publish v4 barretenberg-rs releases for ZKPassport.

AztecBot pushed a commit that referenced this pull request Mar 4, 2026
## Summary
- Add `include` field to barretenberg-rs `Cargo.toml` so generated `api.rs` and `generated_types.rs` are packaged by `cargo publish`, even though they remain gitignored
- Add `release` function to `barretenberg/rust/bootstrap.sh` — sets crate version from `REF_NAME`, verifies generated files exist, and runs `cargo publish`
- Hook `barretenberg/rust` into the top-level release orchestrator (after `barretenberg/ts` which generates the Rust bindings)
- Add `publish = false` to the tests crate

## How it works
1. Generated files stay **gitignored** — not committed to the repo
2. The `include` field in `Cargo.toml` overrides `.gitignore` for `cargo publish`, so the files are packaged as long as they exist on disk
3. During a release, `barretenberg/ts` runs first (which calls `yarn generate`), then `barretenberg/rust` publishes
4. No separate workflow — follows the same unified release flow as npm packages

## Test plan
- [x] `cargo package --list --allow-dirty` confirms `src/api.rs` and `src/generated_types.rs` are included
- [x] `cargo publish --dry-run --allow-dirty --no-verify` succeeds
- [ ] Set `CARGO_REGISTRY_TOKEN` env var in release environment before first publish
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 4, 2026

✅ Successfully backported to backport-to-v4-staging #21064.

alexghr added a commit that referenced this pull request Mar 5, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ledwards2225 <ledwards2225@users.noreply.github.com>
Co-authored-by: PhilWindle <PhilWindle@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: mrzeszutko <mrzeszutko@users.noreply.github.com>
Co-authored-by: spalladino <spalladino@users.noreply.github.com>
Co-authored-by: johnathan79717 <johnathan79717@users.noreply.github.com>
Co-authored-by: nventuro <nventuro@users.noreply.github.com>
Co-authored-by: alexghr <alexghr@users.noreply.github.com>
Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
ludamad added a commit that referenced this pull request Mar 10, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ledwards2225 <ledwards2225@users.noreply.github.com>
Co-authored-by: PhilWindle <PhilWindle@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: mrzeszutko <mrzeszutko@users.noreply.github.com>
Co-authored-by: spalladino <spalladino@users.noreply.github.com>
Co-authored-by: johnathan79717 <johnathan79717@users.noreply.github.com>
Co-authored-by: nventuro <nventuro@users.noreply.github.com>
Co-authored-by: alexghr <alexghr@users.noreply.github.com>
Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: mverzilli <mverzilli@users.noreply.github.com>
Co-authored-by: benesjan <benesjan@users.noreply.github.com>
Co-authored-by: danielntmd <danielntmd@users.noreply.github.com>
Co-authored-by: deffrian <deffrian@users.noreply.github.com>
Co-authored-by: benesjan <janbenes1234@gmail.com>
ludamad added a commit that referenced this pull request Mar 11, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
fix: Simulate gas in n tps test. Set min txs per block to 1 (backport
#21312) (#21329)
fix(log): do not log validation error if unregistered handler (#21111)
fix(node): fix index misalignment in findLeavesIndexes (#21327)
fix: limit parallel blocks in prover to max AVM parallel simulations
(#21320)
fix: use native sha256 to speed up proving job id generation (#21292)
fix(validator): wait for l1 sync before processing block proposals
(#21336)
fix(txpool): cap priority fee with max fees when computing priority
(#21279)
chore: reduce severity of errors due to HA node not acquiring signature
(#21311)
fix: (A-643) add buffer to maxFeePerBlobGas for gas estimation and fix
bump loop truncation (#21323)
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