Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### Changes
- `FastProcessor` `restore_call_state()` and `restore_context()` now return `OperationError::Internal` instead of panicking on empty stacks ([#3371](https://github.com/0xMiden/miden-vm/pull/3371), fixes [#3296](https://github.com/0xMiden/miden-vm/issues/3296)).

- Opened the `LargeSmtForest` backend API for external implementations: made `LineageMutation::new` and `AppliedLineageMutation::new` public and added `LineageId::as_bytes`.
- [BREAKING] Renamed module and kernel metadata APIs from `ModuleInfo`/`Kernel` to `ModuleDescriptor`/`KernelDescriptor`, including matching module descriptor method names ([#3356](https://github.com/0xMiden/miden-vm/pull/3356)).
- Aligned workspace crate versions at `0.28.0`, except `midenc-hir-type`, so VM and crypto crates release as one version line.
- Imported the Miden crypto crates, benches, fuzz targets, and Wycheproof tests into this workspace ([#3366](https://github.com/0xMiden/miden-vm/pull/3366)).
Expand Down
8 changes: 8 additions & 0 deletions crates/crypto/src/merkle/smt/large_forest/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ impl LineageId {
pub fn new(bytes: [u8; 32]) -> Self {
Self(bytes)
}

/// Returns the raw bytes of the lineage ID.
///
/// This is primarily useful for [`Backend`](super::backend::Backend) implementations that
/// need to persist lineage identifiers.
pub fn as_bytes(&self) -> &[u8; 32] {
&self.0
}
}

impl core::fmt::Display for LineageId {
Expand Down
13 changes: 7 additions & 6 deletions crates/crypto/src/merkle/smt/large_forest/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ pub struct LineageMutation {
impl LineageMutation {
/// Constructs a lineage mutation.
///
/// This constructor is crate-private because callers must not be able to fabricate mutation
/// metadata that is inconsistent with the backend-prepared data in an [`SmtForestMutationSet`].
pub(crate) fn new(
/// This is intended for [`Backend`] implementations returning computed mutations. The
/// metadata must stay consistent with the backend-prepared data in the corresponding
/// [`SmtForestMutationSet`].
pub fn new(
lineage: LineageId,
old_version: Option<VersionId>,
new_version: VersionId,
Expand Down Expand Up @@ -207,10 +208,10 @@ pub struct AppliedLineageMutation {
impl AppliedLineageMutation {
/// Constructs an applied lineage mutation.
///
/// This constructor is crate-private because backend implementations must keep the returned
/// history payload consistent with the prepared mutation data they just applied.
/// [`Backend`] implementations must keep the returned history payload consistent with the
/// prepared mutation data they just applied.
#[allow(clippy::too_many_arguments)]
pub(crate) fn new(
pub fn new(
lineage: LineageId,
old_version: Option<VersionId>,
new_version: VersionId,
Expand Down
Loading