Skip to content

feat: batch kernel skeleton#2904

Draft
mmagician wants to merge 1 commit into
nextfrom
mmagician-claude/batch-kernel-skeleton
Draft

feat: batch kernel skeleton#2904
mmagician wants to merge 1 commit into
nextfrom
mmagician-claude/batch-kernel-skeleton

Conversation

@mmagician
Copy link
Copy Markdown
Collaborator

Summary

First PR in a two-part split of #2884 (kept as draft for reference).

Establishes the public input/output contract for the batch kernel (#1122) plus the Rust plumbing that surrounds it. The kernel does not yet perform any verification — it drops its public inputs and emits the empty word output shape. The verification chain (advice-map unhashing, per-tx header check, note-commitment computation) lands in PR 2 on top of this one.

  • main.masm drops TRANSACTIONS_COMMITMENT + BLOCK_HASH and exits; the VM's depth ≥ 16 invariant leaves the all-zero 16-felt output region in place.
  • BatchKernel Rust wrapper exposes prepare_inputs / build_input_stack / build_output_stack / parse_output_stack; build_advice_inputs returns the default empty AdviceInputs since the skeleton ignores advice data.
  • ProvenBatch carries a proof: ExecutionProof field through new_unchecked and serde.
  • LocalBatchProver::prove now runs the kernel via miden_prover::prove and attaches the proof to the returned ProvenBatch. The kernel's public outputs are not cross-checked against the proposed batch yet; that check lands with the verification logic.
  • prove_dummy retained for tests that don't want proof generation.

The smoke test builds a realistic two-transaction ProposedBatch through MockChain + MockProvenTxBuilder, runs the kernel via FastProcessor, and asserts the parsed outputs are all empty / zero. It uses FastProcessor directly rather than LocalBatchProver::prove because the mock transactions carry dummy proofs that TransactionVerifier would reject.

The TODO list at the top of main.masm enumerates the checks PR 2 will introduce.

Test plan

  • cargo nextest run -p miden-testing --lib kernel_tests::batch::batch_kernel
  • make lint
  • scripts/check-features.sh

Establishes the public input/output contract for the batch kernel (#1122)
plus the Rust plumbing that surrounds it, without any verification logic.

- main.masm drops TRANSACTIONS_COMMITMENT + BLOCK_HASH and exits; the VM's
  depth >= 16 invariant leaves the all-zero 16-felt output region in place.
- BatchKernel struct exposes prepare_inputs / build_input_stack /
  build_output_stack / parse_output_stack; build_advice_inputs returns the
  default empty AdviceInputs since the skeleton ignores advice data.
- ProvenBatch carries a proof: ExecutionProof field through
  new_unchecked and serde.
- LocalBatchProver::prove now runs the kernel via miden_prover::prove and
  attaches the proof to the returned ProvenBatch. The kernel's public
  outputs are not yet cross-checked against the proposed batch; that lands
  with the verification logic.
- prove_dummy retained for tests that don't want proof generation.

Smoke test exercises the full plumbing: builds a realistic two-transaction
ProposedBatch, runs the kernel via FastProcessor, asserts the parsed
outputs are empty / zero.

TODO list in main.masm enumerates the checks the verification PR will
introduce.
@mmagician mmagician mentioned this pull request May 12, 2026
3 tasks
@mmagician mmagician changed the title feat: skeleton batch kernel + ProvenBatch proof field feat: skeleton batch kernel May 12, 2026
@mmagician mmagician changed the title feat: skeleton batch kernel feat: batch kernel skeleton May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants