Skip to content

Commit

Permalink
fix(cat-gateway): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku committed Dec 19, 2024
1 parent f78a1a8 commit 8d98546
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 1 addition & 13 deletions catalyst-gateway/bin/src/cardano/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,7 @@ impl SyncTask {
},
}

// TODO: IF there is only 1 chain follower left in sync_tasks, then all
// immutable followers have finished.
// When this happens we need to purge the live index of any records that
// exist before the current immutable tip.
// Note: to prevent a data race when multiple nodes are syncing, we
// probably want to put a gap in this, so that there are X
// slots of overlap between the live chain and immutable
// chain. This gap should be a parameter.

// WIP: How do we check that only one follower is left, and that the slot buffer
// (overlap) criteria is met?
let only_one_chain_follower_left = false;
if only_one_chain_follower_left {
if self.sync_tasks.len() == 1 {
if let Err(error) = roll_forward::purge_live_index(self.immutable_tip_slot).await {
error!(chain=%self.cfg.chain, error=%error, "BUG: Purging volatile data task failed.");
}
Expand Down
1 change: 0 additions & 1 deletion catalyst-gateway/bin/src/db/index/block/roll_forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::{
};

/// Purge Data from Live Index
#[allow(unused_variables)]
pub(crate) async fn purge_live_index(purge_slot: u64) -> anyhow::Result<()> {
let persistent = false; // get volatile session
let Some(session) = CassandraSession::get(persistent) else {
Expand Down

0 comments on commit 8d98546

Please sign in to comment.