| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
chore: port miden crypto stack to 0.24 (#3039) * chore: port miden crypto stack to 0.24 Update the VM to the 0.24 Miden crypto/STARK crates. This pulls in miden-crypto 0.24 and miden-lifted-stark 0.24, and temporarily patches midenc-hir-type to the PR branch which updates its miden-serde-utils dependency. The patch is intentionally a proof-of-concept dependency bridge until midenc-hir-type is released with the compatible dependency set. Adapt the Rust API changes from the new stack. Field construction now uses the checked/unchecked constructors required by miden-field 0.24, DSA tests and helpers use SigningKey in place of the removed SecretKey export, MMR append sites handle the new Result return, and removed crypto re-exports are replaced where needed. Keep a local LexicographicWord compatibility shim because the upstream type was removed once Word itself gained lexicographic ordering. Port proof handling to the lifted STARK API. Proof serialization now stores StarkProof directly, AirWitness is re-exported from miden-lifted-stark, verifier/prover code consumes the new AirInstance and instance-shape data, and recursive verification derives the trace height from the proof instance instead of carrying the old log-trace-height side channel. Update the recursive verifier transcript and FRI query flow for the 0.24 protocol. The random coin no longer absorbs the trace height before public inputs, absorbs the new trace-height point at the protocol position, keeps query indices in natural domain order, and converts only at the MASM fri_ext2fold4 boundary where the native opcode still expects the old row-slot convention. Refresh generated constraints and protocol constants after the dependency upgrade. This includes the Poseidon2 M4 matrix, relation digest, AIR shape snapshot, regenerated constraints_eval.masm, and the changed processor/assembly snapshots caused by the new hash and proof encodings. Validation: make check; make test-fast; make lint; make check-features. * docs: annotate MASM stack effects Add missing stack-state comments around the new FRI query-index conversion and random-coin trace-height observation helper introduced by the crypto 0.24 port. Also update the query-word store comment to describe the new domain-order index layout instead of the old bit-reversed index. Validation: make check; make test-fast; make lint; make check-features. * chore: use Word ordering directly miden-crypto 0.24 gives Word the lexicographic ordering semantics that the removed LexicographicWord wrapper used to supply. Keeping a local compatibility shim would leave two representations of the same digest ordering in the VM, so this switches MAST digest sorting, debug-info procedure maps, sorted-array search keys, and package registry digest filters to store and compare Word directly. The package registry changes are intentionally a hard cutoff: digest-bearing versions now hold Option<Word>, display it directly, and compare package digest requirements without wrapping or unwrapping a compatibility type. Validation also exposed two issues unrelated to the API shape but made visible by this cleanup. The u32 CLZ negative-path helper now builds a real basic-block node in a MastForest instead of executing against an unchecked node id, and the chiplet trace builder performs its narrow column-to-row transpose locally instead of routing through the upgraded dependency's generic SIMD transpose path. * chore: Changelog * chore: use published midenc-hir-type release Switch the workspace dependency from the temporary midenc-hir-type git branch to the published 0.5.4 crate, which carries the miden-serde-utils 0.24 update needed by the crypto port. Refresh the merkle_store MASM example roots for the current miden-crypto 0.24 Merkle hashing behavior. The example input data is unchanged; only the hard-coded roots needed by mtree_get were stale. Add stack-state comments around those instructions while touching the file. * chore: remove unused trace height plumbing Drop the unused log_trace_height parameter from the recursive verifier Merkle advice builders. The trace height still seeds the initial stack, but Merkle advice reconstruction reads only the parsed STARK transcript and LMCS configuration. Validation: make check; make test-fast; make lint; make check-features. | 6 个月前 | |
feat: AdviceInputs constructors and ProgramExecutor trait (#3540) * feat(core/advice): add AdviceInputs::new and From<AdviceMap> constructors Add a full constructor that assembles AdviceInputs from owned parts, and a From<AdviceMap> impl that defaults the stack and store. These complement the existing builder-style accessors (with_advice_stack, with_map, with_merkle_store). * refactor(processor)!: remove free execute()/execute_sync() functions No downstream consumer calls these. The only callers were in-repo tests and the miden-vm re-export. The prover and miden-base use FastProcessor directly because they need the trace or package-debug path. Removed the free functions and the miden-vm re-export, and moved every caller onto FastProcessor::new_with_options(...).execute[_sync](...). BREAKING CHANGE: use FastProcessor::new_with_options(...) followed by execute()/execute_sync() instead of the free functions. Refs #3538 * feat(processor): add ProgramExecutor trait with FastProcessor default impl Introduces a pluggable program-execution abstraction in miden-processor so that alternative execution backends (debuggers, instrumented executors, or other VMs) can be swapped in without touching the surrounding executor wiring. The trait is byte-for-byte faithful to the one already in miden-tx (which carries a TODO to move it into miden-vm), so downstream can later delete its local copy and re-export this one. FastProcessor is the default implementation: - new() wraps FastProcessor::new_with_options(), panicking on invalid advice inputs (matching the existing infallible-from-the-trait contract). - execute() delegates to FastProcessor::execute(). - execute_with_package_debug_info() routes to the package-debug entrypoints, selecting the source-node-anchored variant when an entrypoint node is given and falling back to the package-rooted variant otherwise. Documented on new() that, for the concrete FastProcessor type, the trait constructor is shadowed by the inherent 1-arg FastProcessor::new and so must be invoked via fully-qualified syntax <FastProcessor as ProgramExecutor>::new. Added three trait-dispatch tests: the default execute() path, the no-entrypoint-node fallback in execute_with_package_debug_info(), and the Some(entrypoint_source_node) arm routed through the trait (mirroring the existing package_source_debug_execution_uses_manifest_entrypoint_source_node inherent-method test). Refs #3538 * chore: Changelog * docs(miden-vm): fix README doctest after execute_sync removal The execution example doctest imported the free execute_sync from miden_vm and called it directly. That function was removed when the free execute()/ execute_sync() entrypoints were dropped in favor of FastProcessor. Rewrite the example to construct a FastProcessor via new_with_options and call execute_sync on it, matching the new API. Fixes the doc-tests CI failure on #3540. * refactor: address PR review feedback * chore: fix nightly formatting | 2 个月前 |