From 525417d660c40bfe3717a949c7c6fad3cba9efec Mon Sep 17 00:00:00 2001 From: Alex Pozhylenkov Date: Tue, 14 May 2024 13:10:14 +0300 Subject: [PATCH] fix(hardano): exclude last chunk file during immutable db read (#454) --- pallas-hardano/src/storage/immutable/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pallas-hardano/src/storage/immutable/mod.rs b/pallas-hardano/src/storage/immutable/mod.rs index e6c4e4f..14f1c60 100644 --- a/pallas-hardano/src/storage/immutable/mod.rs +++ b/pallas-hardano/src/storage/immutable/mod.rs @@ -118,6 +118,10 @@ fn build_stack_of_chunk_names(dir: &Path) -> Result>(); chunks.sort(); + // According to this docs https://mithril.network/doc/glossary/#immutable-file-number, + // the last chunk files are not really immutable. + // So to preserve only immutable data the last chunk files are omitted. + chunks.pop(); chunks.reverse(); Ok(chunks)