IntersectMBO / IntersectMBO/ouroboros-consensus

Disk IO pipelining in UTxO-HD

Open
#1,546 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

UTxO-HD
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

This is a summary of the discussion held in Consensus Office Hours on 29th of April 2025.

With UTxO-HD there is an opportunity to start reading the values from the tables for the coming blocks in a thread separate from the Chain selection thread.

  • Chain selection selects a candidate in the volatile DB and then validates it. If the candidate is a chain of blocks (for example if a block arrived that filled a gap in an alternative better fork, or if we received the tip of an alternative fork that becomes better than our selection) then we could read the values for some blocks in place (1? 2?) and in the background fetch the inputs for the rest of the blocks (or maybe just fetch all in the background and validate as they become ready)
  • However most of the times when syncing blocks will arrive one by one and we will evaluate the candidates each time, so we only have a window of 1 block.
  • We considered splitting chain selection in two parts:
    • ChainSel1: finds the best candidate, gives it to ChainSel2 and spawns a thread to fetch the inputs.
    • ChainSel2: for each block in the candidate, wait for the inputs to arrive and validate it, to validate the whole candidate and if successful then adopt it.
  • However this falls in the same problem discussed above, if blocks come one by one we won't be able to pipeline the reads.
  • A second design takes advantage of the fact that we only download "plausible" candidates in BlockFetch, i.e. blocks that belong to a selection that would be better than ours. With this precondition, all blocks in the volatile DB are interesting and we would try to validate them, so as blocks arrive to the VolatileDB we could start fetching their inputs. Then we don't need to split chain selection, but we are relying on something that is uncertain if it will be preserved forever in BlockFetch.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the UTxO-HD discussion in this issue, then trace Chain selection, BlockFetch, and the VolatileDB flow to understand where candidate blocks and their inputs are handled. The issue does not name files, tests, or a settled design; done would require agreeing on a pipelining approach and defining its implementation and validation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
blockchain, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.