IntersectMBO / IntersectMBO/ouroboros-consensus

Chain DB: Support tentative header

Open
#791 3 comments 0 reactions 0 assignees View on GitHub
:wastebasket: :question: possibly stale
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

At the moment the only state changing API call in the chain DB is `addBlock`, which then triggers chain selection, either adding new blocks to the existing chain or changing to a fork. This in turn then notifies all the `Reader`s. This introduces propagation delays for headers through the network:

* Node A sends header 1 to Node B
* Node B requests the corresponding block 1 from node A
* After node B downloads the block and adds it to its own chain, it updates its readers
* It can now send header 1 to node C

It would be better if we could avoid block-download delay before sending the header to node C. We can do this by adding a (single) "tentative header" to the chain database. This would be the header of the block that fits (directly) on top of the current chain. This state would be _set_ by the chain sync client, but managed by the chain DB because it affects the readers, and needs to be updated whenever `addBlock`/chain selection takes place.

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.