Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -40,6 +40,7 @@

- Reduced optimized benchmark build time by relaxing forced inlining in processor execution helpers ([#3292](https://github.com/0xMiden/miden-vm/pull/3292)).
- Added no-op handlers for readonly debugger events to `CoreLibrary::handlers`, so hosts that load the core library can execute programs emitting those events without registering no-op handlers manually ([#3305](https://github.com/0xMiden/miden-vm/pull/3305)).
- Added trusted sparse MAST forest serialization for trace replay payloads ([#3313](https://github.com/0xMiden/miden-vm/pull/3313)).

## v0.24.0 (2026-06-24)

Expand Down
16 changes: 14 additions & 2 deletions core/src/mast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use proptest::prelude::*;
use serde::{Deserialize, Serialize};

#[cfg(feature = "serde")]
use crate::serde::{Deserializable, SliceReader};
use crate::serde::SliceReader;

mod node;
#[cfg(any(test, feature = "arbitrary"))]
Expand All @@ -71,7 +71,7 @@ use crate::{
Felt, Word,
advice::AdviceMap,
crypto::hash::Poseidon2,
serde::{ByteWriter, DeserializationError, Serializable},
serde::{ByteWriter, Deserializable, DeserializationError, Serializable},
utils::{DenseIdMap, Idx, IndexVec, hash_string_to_word},
};

Expand Down Expand Up @@ -1242,6 +1242,18 @@ impl Serializable for MastNodeId {
}
}

impl Deserializable for MastNodeId {
fn read_from<R: crate::serde::ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError> {
Ok(Self(<u32 as Deserializable>::read_from(source)?))
}

fn min_serialized_size() -> usize {
<u32 as Deserializable>::min_serialized_size()
}
}

impl fmt::Display for MastNodeId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "MastNodeId({})", self.0)
Expand Down
8 changes: 7 additions & 1 deletion core/src/mast/serialization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@
//! same contiguous array on the wire.
//!
//! Public entry points adopt these policies:
//! - [`MastForest::read_from_bytes`]: trusted execution payload, no hashless support.
//! - [`MastForest::read_from_bytes`]: trusted dense execution payload, no hashless support.
//! - [`MastForestWireView::new`]: trusted wire-backed cache access; rejects hashless and legacy
//! debug-bearing payloads.
//! - [`crate::mast::SparseMastForest::read_from_bytes`]: separate trusted sparse replay payloads
//! for serialized trace-generation inputs. Sparse payloads preserve the sparse node and digest
//! maps produced by tracing; they do not share the dense `MastForest` wire format and are not an
//! untrusted validation boundary.
//! - [`crate::mast::UntrustedMastForest::read_from_bytes`] /
//! [`crate::mast::UntrustedMastForest::read_from_bytes_with_options`]: untrusted parsing plus
//! later validation before use.
Expand Down Expand Up @@ -112,6 +116,8 @@ mod layout;
pub(super) use layout::ForestLayout;
use layout::{OffsetTrackingReader, TrackingReader, WireFlags, read_header_and_scan_layout};

mod sparse;

mod resolved;
use resolved::{ResolvedSerializedForest, basic_block_offset_for_node_index};

Expand Down
Loading
Loading