Skip to content

Commit

Permalink
fix(hardano): exclude last chunk file during immutable db read (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy authored May 14, 2024
1 parent e1504a2 commit 525417d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pallas-hardano/src/storage/immutable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ fn build_stack_of_chunk_names(dir: &Path) -> Result<ChunkNameSack, std::io::Erro
.collect::<Vec<_>>();

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)
Expand Down

0 comments on commit 525417d

Please sign in to comment.