Skip to content

Commit 1cb9b49

Browse files
committed
feat: add sps62-checkpoint-types crate with SSZ serialization
1 parent 1dc83bc commit 1cb9b49

File tree

5 files changed

+411
-4
lines changed

5 files changed

+411
-4
lines changed

Cargo.lock

Lines changed: 82 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ members = [
7171
"crates/service",
7272
"crates/simple-ee",
7373
"crates/snark-acct-types",
74+
"crates/sps62-checkpoint-types",
7475
"crates/state",
7576
"crates/status",
7677
"crates/storage",
@@ -396,9 +397,14 @@ sha2 = "0.10"
396397
shrex = { version = "1", features = ["serde"] }
397398
shrex_macros = "1"
398399
sled = "0.34.7"
400+
ssz = { git = "https://github.com/alpenlabs/ssz-gen", branch = "main" }
401+
ssz_derive = { git = "https://github.com/alpenlabs/ssz-gen", branch = "main" }
402+
ssz_types = { git = "https://github.com/alpenlabs/ssz-gen", branch = "main" }
399403
tempfile = "3.10.1"
400404
terrors = "0.3.0"
401405
thiserror = "2.0.11"
406+
tree_hash = { git = "https://github.com/alpenlabs/ssz-gen", branch = "main" }
407+
tree_hash_derive = { git = "https://github.com/alpenlabs/ssz-gen", branch = "main" }
402408
threadpool = "1.8"
403409
tokio = { version = "1.37", features = ["full"] }
404410
toml = "0.5"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "sps62-checkpoint-types"
3+
version = "0.1.0"
4+
edition = "2021"
5+
description = "SPS-62 checkpoint types with SSZ serialization"
6+
7+
[lints]
8+
workspace = true
9+
10+
[dependencies]
11+
ssz = { workspace = true }
12+
ssz_derive = { workspace = true }
13+
ssz_types = { workspace = true }
14+
tree_hash = { workspace = true }
15+
tree_hash_derive = { workspace = true }
16+
17+
[dev-dependencies]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//! SPS-62 Checkpoint Types
2+
//!
3+
//! This crate implements the checkpoint data structures as defined in the SPS-62 specification.
4+
//! All types use SSZ (Simple Serialize) for serialization and support merkleization via
5+
//! `tree_hash`.
6+
//!
7+
//! ## Specification
8+
//!
9+
//! These types follow the SPS-62 checkpoint specification which defines how orchestration layer
10+
//! checkpoints are structured, represented on L1, and interpreted as part of a sequence.
11+
//!
12+
//! ## Main Types
13+
//!
14+
//! - [`CheckpointHeader`] - Minimally necessary information to construct an EpochSummary
15+
//! - [`CheckpointPayload`] - Output components including state diffs and messages
16+
//! - [`CheckpointData`] - Container combining header, payload, and state diff
17+
//! - [`Checkpoint`] - Complete checkpoint with data and proof
18+
//! - [`SignedCheckpoint`] - Checkpoint with signature (used off-chain)
19+
//! - [`EpochSummary`] - Summary of epoch state for validation
20+
21+
#![warn(missing_debug_implementations)]
22+
#![warn(missing_docs)]
23+
24+
mod types;
25+
26+
pub use ssz;
27+
pub use tree_hash;
28+
pub use types::*;

0 commit comments

Comments
 (0)