feat: batch kernel skeleton#2904
Draft
mmagician wants to merge 1 commit into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.masmdropsTRANSACTIONS_COMMITMENT+BLOCK_HASHand exits; the VM's depth ≥ 16 invariant leaves the all-zero 16-felt output region in place.BatchKernelRust wrapper exposesprepare_inputs/build_input_stack/build_output_stack/parse_output_stack;build_advice_inputsreturns the default emptyAdviceInputssince the skeleton ignores advice data.ProvenBatchcarries aproof: ExecutionProoffield throughnew_uncheckedand serde.LocalBatchProver::provenow runs the kernel viamiden_prover::proveand attaches the proof to the returnedProvenBatch. The kernel's public outputs are not cross-checked against the proposed batch yet; that check lands with the verification logic.prove_dummyretained for tests that don't want proof generation.The smoke test builds a realistic two-transaction
ProposedBatchthroughMockChain+MockProvenTxBuilder, runs the kernel viaFastProcessor, and asserts the parsed outputs are all empty / zero. It usesFastProcessordirectly rather thanLocalBatchProver::provebecause the mock transactions carry dummy proofs thatTransactionVerifierwould reject.The
TODOlist at the top ofmain.masmenumerates the checks PR 2 will introduce.Test plan
cargo nextest run -p miden-testing --lib kernel_tests::batch::batch_kernelmake lintscripts/check-features.sh