IntersectMBO / IntersectMBO/ouroboros-consensus

Chain DB: audit for repeatedly opening the same file for reading a block

Open
#773 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

While we typically use ImmutableDB iterators to efficiently stream blocks in the ChainDB, sometimes we read blocks one-by-one, in particular when we're reading from the VolatileDB, as it doesn't provide iterator-like functionality. For example, when copying blocks from the VolatileDB to the ImmutableDB, the blocks from the VolatileDB are read one-by-one, which requires opening, seeking, reading, and closing a file for each block.

* Change interface to allow keeping file handles open (VolatileDB + ChainDB)
* Discourage single-shot reads by renaming the function, e.g., `s/getBlock/getBlockInefficiently/`
* Provide the equivalent of `pread` in the FS layer?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.