Skip to content

feat: opt-in round-parallel MSM for prover agents (BB_LEGACY_MSM) - #24980

Draft
AztecBot wants to merge 2 commits into
merge-train/spartan-v5from
cb/prover-agent-fast-msm
Draft

feat: opt-in round-parallel MSM for prover agents (BB_LEGACY_MSM)#24980
AztecBot wants to merge 2 commits into
merge-train/spartan-v5from
cb/prover-agent-fast-msm

Conversation

@AztecBot

@AztecBot AztecBot commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Adds a knob so prover agents on the v5 line can opt into the new Pippenger implementation. Legacy stays the default.

What

scalar_multiplication::use_legacy_msm() defaults to the legacy MSM; the round-parallel _fast path is opt-in via BB_MSM_NEW, the bbapi SetMsmLegacy command, or the bb.js legacyMsm backend option. Nothing in yarn-project set that option, so prover agents had no way to switch short of the raw env var on the bb child.

This threads the bb.js option through the prover's bb.js plumbing and exposes it as config:

  • BBJsFactoryOptions.legacyMsmBBJsInstance.createBackendOptions.legacyMsm, so each spawned bb process gets a SetMsmLegacy on startup (configureMsmBackend in barretenberg/ts/src/barretenberg/index.ts runs for the NativeUnixSocket backend).
  • New BBConfig.bbLegacyMsm / BB_LEGACY_MSM env var, defaulting to true (legacy). BBNativeRollupProver passes config.bbLegacyMsm ?? true.
  • To opt a prover agent into the round-parallel MSM: BB_LEGACY_MSM=false. It reaches both agent entrypoints — getProverNodeAgentConfigFromEnv (standalone aztec start --prover-agent) and proverClientConfigMappings (in-process agents).

Scope and behavior notes

  • Proving only. BBCircuitVerifier and BatchChonkVerifier (node-side IVC/chonk verify) are untouched, as is client-side BBPrivateKernelProver.
  • Because BBNativeRollupProver now always sets an explicit override, BB_MSM_NEW=1 in a prover agent's environment is shadowed and has no effect — BB_LEGACY_MSM=false is the switch for agents. Say the word if you'd rather the TS layer stay silent when the config is unset so bb's own env default still applies.
  • Default behavior is unchanged from today, so this is a no-op until someone flips the env var.

Testing

Not built or run locally — this container has no submodules checked out, no build cache credentials, and Rust 1.85 vs the expected 1.89, so a cold full-stack build was not viable. Relying on CI for typecheck. The MSM implementations themselves already have coverage in scalar_multiplication.test.cpp, scalar_multiplication_safe_mode.test.cpp, and bbapi.test.cpp.


Created by claudebox · group: slackbot · requested by Adam Domurad · Slack thread

Prover agents now start their bb processes with the round-parallel
Pippenger/MSM implementation instead of the legacy one. The bb.js
`legacyMsm` backend option is threaded through BBJsFactory and defaulted
to false in BBNativeRollupProver, with BB_LEGACY_MSM=true available to
fall back without a code change.

Scoped to the proving path only: the node's IVC/chonk verifiers keep
bb's own default.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. port-to-next Forward-port this merged PR into next labels Jul 25, 2026
@AztecBot AztecBot changed the title feat: use the round-parallel MSM in prover agents feat: opt-in round-parallel MSM for prover agents (BB_LEGACY_MSM) Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. port-to-next Forward-port this merged PR into next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant