Skip to content

feat: batch kernel skeleton#2904

Draft
mmagician wants to merge 9 commits into
nextfrom
mmagician-claude/batch-kernel-skeleton
Draft

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

Conversation

@mmagician
Copy link
Copy Markdown
Collaborator

@mmagician mmagician commented May 12, 2026

Summary

First PR in a two-part split of #2884.

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.

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
Comment thread CHANGELOG.md Outdated
Comment thread crates/miden-protocol/asm/kernels/batch/main.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/batch/main.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/batch/main.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/batch/main.masm Outdated
Comment thread crates/miden-protocol/src/batch/kernel.rs Outdated
Comment thread crates/miden-protocol/src/batch/proven_batch.rs Outdated
Comment thread crates/miden-protocol/build.rs Outdated
Comment thread crates/miden-testing/src/kernel_tests/batch/batch_kernel.rs Outdated
Comment thread crates/miden-tx-batch-prover/src/local_batch_prover.rs Outdated
mmagician and others added 8 commits May 27, 2026 16:38
Co-authored-by: Marti <marcin.gorny.94@protonmail.com>
The batch kernel is compiled separately and its MASM errors are not
extracted by generate_error_constants (which only scans the transaction
kernel dir), so the BATCH entry in TX_KERNEL_ERROR_CATEGORIES is inert.
Batch error handling will be added properly alongside the verification
logic.
Pass transactions_commitment before block_hash so the parameter order
matches the documented input stack [TRANSACTIONS_COMMITMENT, BLOCK_HASH].
Also drop the now-stale reference to the main.masm TODO from the
BatchKernel doc comment.
Replace the two separate pad-word checks with a single scan over every
cell after batch_expiration_block_num, dropping the EXPIRATION_PAD_WORD_*
and TRAILING_PAD_WORD_FELT_IDX constants.
Expose TestSetup and setup_chain from the proposed_batch test module and
reuse them in the batch kernel smoke test instead of re-implementing the
identical TestSetup/setup/generate_account fixtures.
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