diff --git a/rust/cardano-chain-follower/Cargo.toml b/rust/cardano-chain-follower/Cargo.toml index 3497d5792f..fad5890a66 100644 --- a/rust/cardano-chain-follower/Cargo.toml +++ b/rust/cardano-chain-follower/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cardano-chain-follower" -version = "0.0.18" +version = "0.0.19" edition.workspace = true authors.workspace = true homepage.workspace = true diff --git a/rust/cardano-chain-follower/src/mithril_snapshot_iterator.rs b/rust/cardano-chain-follower/src/mithril_snapshot_iterator.rs index 810b46f0ff..c75ba4c7b3 100644 --- a/rust/cardano-chain-follower/src/mithril_snapshot_iterator.rs +++ b/rust/cardano-chain-follower/src/mithril_snapshot_iterator.rs @@ -187,8 +187,17 @@ impl MithrilSnapshotIterator { from: &Point, previous_point: Option, ) -> Result { + // If "from" is 0, it is origin. + // This is added to avoid the case where point 0 is considered + // as fuzzy and not origin. + let from = if from.slot_or_default() == 0.into() { + Point::ORIGIN + } else { + from.clone() + }; + if from.is_fuzzy() || (!from.is_origin() && previous_point.is_none()) { - return Ok(Self::fuzzy_iterator(chain, path, from).await); + return Ok(Self::fuzzy_iterator(chain, path, &from).await); } let previous = if from.is_origin() { @@ -202,7 +211,7 @@ impl MithrilSnapshotIterator { debug!("Actual Mithril Iterator Start: {}", from); - let iterator = make_mithril_iterator(path, from, chain).await?; + let iterator = make_mithril_iterator(path, &from, chain).await?; Ok(MithrilSnapshotIterator { path: path.to_path_buf(),