Skip to content

Commit

Permalink
misc: changed a few things to try to address broken things
Browse files Browse the repository at this point in the history
  • Loading branch information
delbonis committed Dec 19, 2024
1 parent 9fb5e5c commit ff4adb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion bin/strata-client/src/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ impl<D: Database + Send + Sync + 'static> StrataApiServer for StrataRpcImpl<D> {

async fn sync_status(&self) -> RpcResult<RpcSyncStatus> {
let sync_state = self.status_channel.get_sync_state();
let cur_epoch = self.status_channel.get_cur_l2_epoch().unwrap_or(0);
let cur_epoch = self.status_channel.get_cur_l2_epoch().unwrap_or_else(|| {
warn!("cur_epoch unset, using default 0");
0
});
Ok(sync_state
.map(|sync| RpcSyncStatus {
tip_height: sync.tip_height(),
Expand Down
6 changes: 4 additions & 2 deletions crates/chaintsn/src/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use strata_state::{
tx::ProtocolOperation,
};

use crate::{errors::TsnError, slot_rng::SlotRng};
use crate::{errors::TsnError, macros::*, slot_rng::SlotRng};

/// Rollup epoch-level input.
pub struct EpochData<'b> {
Expand Down Expand Up @@ -56,7 +56,9 @@ pub fn process_epoch(

// Increment the epoch counter.
let cur_epoch = state.state().cur_epoch();
state.set_cur_epoch(cur_epoch + 1);
let new_epoch = cur_epoch + 1;
state.set_cur_epoch(new_epoch);
info!(%new_epoch, "internally advanced epoch");

Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions crates/state/src/state_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub struct StateCache {
original_epoch_state: EpochState,
new_ch_state: Chainstate,
new_epoch_state: Option<EpochState>,

// Unused right now, will likely use later.
write_ops: Vec<StateOp>,
}

Expand Down

0 comments on commit ff4adb3

Please sign in to comment.