BlockFetchConsensusInterface.readFetchedBlocks
: report blocks as fetched as soon as they are enqueued
#952
Labels
BlockFetchConsensusInterface.readFetchedBlocks
: report blocks as fetched as soon as they are enqueued
#952
Currently, the
readFetchedBlocks
fromBlockFetchConsensusInterface
we provide to Network is implemented viaChainDB.getIsFetched
(which in turn is implemented viaVolatileDB.getIsMember
). When a new block is added from a BlockFetch client, it might therefore take a bit of time until the block has been written to disk, and is hence reported as fetched byreadFetchedBlocks
.1This might occasionally lead the BlockFetch decision logic to unnecessarily request the block from another peer, even though it has already been downloaded, just not yet written to disk.
I implemented an ad-hoc fix for this (also reporting blocks in the queue as fetched) here: main...amesgen/getIsFetched-bg-queue
@karknu tested this change, and observed that it fixes the behavior described above.
It would be nice to validate and clean-up this patch.
Footnotes
This is the (weaker) requirement that is currently stated on
↩mkAddFetchedBlock
:The text was updated successfully, but these errors were encountered: