remove checkpoint from state

This commit is contained in:
kashepavadan 2026-05-26 00:19:18 -04:00
parent db5e5dd37a
commit e0f3bb8a35
2 changed files with 1 additions and 14 deletions

View File

@ -1,5 +1,5 @@
use lb_core::mantle::ops::channel::MsgId;
use lb_zone_sdk::{sequencer::SequencerCheckpoint, state::InscriptionInfo};
use lb_zone_sdk::state::InscriptionInfo;
use crate::message::Msg;
@ -31,9 +31,6 @@ pub trait ZoneState: Send {
fn published(&self) -> &[Msg];
fn adopted(&self) -> &[Msg];
fn finalized(&self) -> &[Msg];
fn save_checkpoint(&mut self, checkpoint: SequencerCheckpoint);
fn load_checkpoint(&self) -> Option<&SequencerCheckpoint>;
}
/// In-memory implementation of [`ZoneState`].
@ -42,7 +39,6 @@ pub struct InMemoryZoneState {
published: Vec<Msg>,
adopted: Vec<Msg>,
finalized: Vec<Msg>,
checkpoint: Option<SequencerCheckpoint>,
}
impl ZoneState for InMemoryZoneState {
@ -95,12 +91,4 @@ impl ZoneState for InMemoryZoneState {
fn finalized(&self) -> &[Msg] {
&self.finalized
}
fn save_checkpoint(&mut self, checkpoint: SequencerCheckpoint) {
self.checkpoint = Some(checkpoint);
}
fn load_checkpoint(&self) -> Option<&SequencerCheckpoint> {
self.checkpoint.as_ref()
}
}

View File

@ -163,7 +163,6 @@ async fn handle_event(
debug!(msg_id = %hex::encode(info.this_msg.as_ref()), "Published");
state.on_published(&info);
save_checkpoint(Path::new(checkpoint_path), &checkpoint);
state.save_checkpoint(checkpoint);
}
Event::FinalizedInscriptions { inscriptions } => {
state.on_finalized(&inscriptions);