Reference
Serialization and Determinism
Rules for serialization, hashing, and deterministic IDs.
This document defines the serialization and hashing rules required for reproducible kernel runs.
Serialization Rules
- All core objects derive
serde::Serializeandserde::Deserialize. - JSON and CBOR round-trips must preserve semantic equality.
TraceEvent.sequenceis strictly monotonic within aRunId.
Timestamp Handling
TraceEvent.timestampis captured at emission time and persisted verbatim.- Replay and audit tooling must use stored timestamps instead of wall-clock time.
Content Hashing
ContentHash uses blake3 for deterministic digests. The canonical string
format is:
{algorithm}:{hex_digest}Snapshot IDs
SnapshotId is derived directly from the snapshot bytes:
SnapshotId = ContentHash::blake3(state_bytes)State Node Hashing
StateNodeId is derived from a serialized StateNodeHashInput payload:
{
parent_ids: [StateNodeId],
data_hash: ContentHash,
metadata: StateMetadata
}The payload is serialized with serde_json and hashed with BLAKE3. Any change
in ordering or field representation will produce a new node ID.