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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", packa
curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", tag = "patch-4.1.1-sp1-4.0.0" }
p256 = { git = "https://github.com/sp1-patches/elliptic-curves", tag = "patch-p256-13.2-sp1-4.1.0" }
k256 = { git = "https://github.com/sp1-patches/elliptic-curves", tag = "patch-k256-13.4-sp1-4.1.0" }
celestia-types = { git = "https://github.com/deltadevsde/lumina.git" }
celestia-types = { git = "https://github.com/deltadevsde/lumina.git" }
lumina-node = { git = "https://github.com/deltadevsde/lumina.git" }

[workspace.features]
Expand Down
7 changes: 2 additions & 5 deletions crates/da/src/celestia/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ use lumina_node::{blockstore::IndexedDbBlockstore, store::IndexedDbStore};
use lumina_node::NodeBuilder;

#[cfg(not(target_arch = "wasm32"))]
use {
blockstore::EitherBlockstore,
redb::Database,
tokio::task::spawn_blocking,
};
use {blockstore::EitherBlockstore, redb::Database, tokio::task::spawn_blocking};

#[cfg(feature = "uniffi")]
use lumina_node_uniffi::types::NodeConfig;
Expand Down Expand Up @@ -183,6 +179,7 @@ impl LightDataAvailabilityLayer for LightClientConnection {
Err(e) => return Err(anyhow!("Failed to fetch header: {}", e)),
};

// TODO(Zombeescott): Implement retries + timeout
match node.request_all_blobs(&header, self.snark_namespace, None).await {
Ok(blobs) => {
let epochs: Vec<VerifiableEpoch> = blobs
Expand Down
23 changes: 19 additions & 4 deletions crates/da/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use lumina_node::events::{NodeEvent, EventSubscriber as LuminaEventSub};
use lumina_node::events::{EventSubscriber as LuminaEventSub, NodeEvent};
use prism_common::digest::Digest;
use serde::Serialize;
use std::{fmt, sync::Arc};
Expand All @@ -14,7 +14,9 @@ const EVENT_CHANNEL_CAPACITY: usize = 1024;
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
pub enum PrismEvent {
SyncStarted { height: u64 },
Ready,
BackwardsSyncStarted { height: u64 },
BackwardsSyncCompleted { height: Option<u64> },
UpdateDAHeight { height: u64 },
EpochVerificationStarted { height: u64 },
EpochVerified { height: u64 },
Expand All @@ -35,8 +37,21 @@ pub enum PrismEvent {
impl fmt::Display for PrismEvent {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
PrismEvent::SyncStarted { height } => {
write!(f, "Starting sync at height {}", height)
PrismEvent::Ready => {
write!(
f,
"Node is ready to start sync and listening for incoming headers"
)
}
PrismEvent::BackwardsSyncStarted { height } => {
write!(f, "Starting backwards sync at height {}", height)
}
PrismEvent::BackwardsSyncCompleted { height } => {
write!(
f,
"Backwards sync complete, found epoch: {}",
height.is_some()
)
}
PrismEvent::UpdateDAHeight { height } => {
write!(f, "Updated DA height to {}", height)
Expand Down
1 change: 1 addition & 0 deletions crates/da/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl From<EpochCommitments> for (Digest, Digest) {

/// `VerifiableStateTransition` is a trait wrapper around `FinalizedEpoch` that allows for mocking.
/// The only concrete implementation of this trait is by `FinalizedEpoch`.
#[automock]
pub trait VerifiableStateTransition: Send {
fn verify(
&self,
Expand Down
3 changes: 3 additions & 0 deletions crates/node_types/lightclient/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
pub mod lightclient;
pub use lightclient::LightClient;

#[cfg(test)]
mod tests;
Loading
Loading