Skip to content

fix(pxe): support custom PrivateKernelProver and unify EmbeddedWalletOptions#22348

Merged
Thunkar merged 6 commits intomerge-train/fairiesfrom
claudebox/embedded-wallet-custom-prover
Apr 8, 2026
Merged

fix(pxe): support custom PrivateKernelProver and unify EmbeddedWalletOptions#22348
Thunkar merged 6 commits intomerge-train/fairiesfrom
claudebox/embedded-wallet-custom-prover

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented Apr 7, 2026

Summary

  • Fixes EmbeddedWallet silently ignoring custom PrivateKernelProver implementations passed via pxeOptions.proverOrOptions
  • The instanceof BBPrivateKernelProver check in all three createPXE utils only matched BB's own prover subclasses — custom implementations fell through and were destructured as config options, causing runtime errors
  • Replaced with a duck-type isPrivateKernelProver() guard using createChonkProof as the distinguishing method
  • Unified the confusing pxeConfig/pxeOptions split in EmbeddedWalletOptions into a single pxe field that accepts both config and dependency overrides

New API

// Before (confusing — which one do I use?)
const wallet = await EmbeddedWallet.create(nodeUrl, {
  pxeConfig: { proverEnabled: true },
  pxeOptions: { proverOrOptions: myCustomProver },
});

// After (single unified option)
const wallet = await EmbeddedWallet.create(nodeUrl, {
  pxe: {
    proverEnabled: true,
    proverOrOptions: myCustomProver,
  },
});

The old pxeConfig/pxeOptions fields are kept but marked @deprecated.

Test plan

  • Existing BB provers still pass the duck-type check (they implement createChonkProof)
  • Plain BBPrivateKernelProverOptions objects correctly fall through to create default provers
  • Custom PrivateKernelProver implementations are now correctly detected and used as-is
  • Old pxeConfig/pxeOptions usage still works (backward compatible)
  • New pxe field merges correctly with deprecated fields

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 7, 2026
@AztecBot AztecBot changed the title fix(pxe): support custom PrivateKernelProver in EmbeddedWallet fix(pxe): support custom PrivateKernelProver and unify EmbeddedWalletOptions Apr 7, 2026
@Thunkar Thunkar changed the base branch from next to merge-train/fairies April 7, 2026 08:23
@Thunkar Thunkar self-requested a review April 7, 2026 08:23
@Thunkar Thunkar self-assigned this Apr 7, 2026
@Thunkar Thunkar requested a review from alejoamiras April 7, 2026 08:23
AztecBot added 4 commits April 7, 2026 08:24
The instanceof BBPrivateKernelProver check in createPXE utils only
recognized BB's own prover subclasses. Custom PrivateKernelProver
implementations were silently treated as options and spread into
a default BB prover constructor. Replace with duck-type check.
Merge the confusing pxeConfig/pxeOptions split into a single 'pxe'
option that accepts both PXEConfig fields and dependency injection
(prover, store, simulator). The old fields are kept but deprecated.

Also update the type guard to use createChonkProof as the duck-type
check for PrivateKernelProver detection.
@AztecBot AztecBot force-pushed the claudebox/embedded-wallet-custom-prover branch from 2860439 to 3641dae Compare April 7, 2026 08:26
AztecBot added 2 commits April 7, 2026 08:29
proverEnabled is already part of PXEConfig via KernelProverConfig,
so Partial<PXEConfig> already includes it.
@Thunkar Thunkar marked this pull request as ready for review April 7, 2026 09:29
@Thunkar Thunkar merged commit cac2411 into merge-train/fairies Apr 8, 2026
18 checks passed
@Thunkar Thunkar deleted the claudebox/embedded-wallet-custom-prover branch April 8, 2026 07:47
@AztecBot
Copy link
Copy Markdown
Collaborator Author

AztecBot commented Apr 8, 2026

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

AztecBot added a commit that referenced this pull request Apr 8, 2026
…mbeddedWalletOptions (#22348)

Cherry-pick of merge commit cac2411 with conflicts in migration_notes.md.
github-merge-queue bot pushed a commit that referenced this pull request Apr 8, 2026
BEGIN_COMMIT_OVERRIDE
fix(pxe): support custom PrivateKernelProver and unify
EmbeddedWalletOptions (#22348)
fix: subfield note selectors (#22211)
fix: pass additionalScopes to executeUtility (#22411)
feat(e2e): support running tests against legacy noir contract artifacts
(#22410)
END_COMMIT_OVERRIDE
Thunkar added a commit that referenced this pull request Apr 9, 2026
…Options (backport #22348) (#22391)

## Summary

Backport of #22348
to v4-next.

Cherry-pick of merge commit cac2411 with one conflict in
`migration_notes.md` (trivially resolved — empty HEAD side, accepted
incoming migration note).

### Changes
- Replace `instanceof BBPrivateKernelProver` with duck-type
`isPrivateKernelProver()` check using `createChonkProof` as
distinguishing method
- Unify `pxeConfig`/`pxeOptions` into single `pxe` field on
`EmbeddedWalletOptions`
- Add `splitPxeOptions` helper and `EmbeddedWalletPXEOptions` type
- Add migration note for the API change

### Commit structure (3-commit backport)
1. Cherry-pick with conflict markers as-is
2. Conflict resolution (accept migration note)


ClaudeBox log: https://claudebox.work/s/947bc828b6966f6c?run=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v4-next ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants