IntersectMBO / IntersectMBO/ouroboros-consensus

Simplify nextFreeRelSlot in ImmDB logic

Open
#1,212 1 comment 0 reactions 0 assignees View on GitHub
needs-grooming :question:
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

For the file-backed index, the relatively complicated `nextFreeRelSlot` logic avoids an extra read from disk (although: we're imminently writing to the same page, so does read+write necessarily cost much more than just the write? I don't recall.)

But with the cache, the necessary info is already in memory: `nextFreeRelSlot = length currentChunkOffsets - 1`.

This could alternatively be added as an assertion, perhaps.

Contributor guide

Open the contributing guide

Research direction

Start by reading the ImmDB logic around `nextFreeRelSlot`, comparing the file-backed index path with the cache path and how `currentChunkOffsets` is maintained. Determine whether the cached length can replace the existing calculation or serve as an assertion, then verify that both paths retain the same slot behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
databases
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.