You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the readFetchedBlocks from BlockFetchConsensusInterface we provide to Network is implemented via ChainDB.getIsFetched (which in turn is implemented via VolatileDB.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 by readFetchedBlocks.1
This 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:
Upon successful completion of addFetchedBlock it must be the case that readFetchedBlocks reports the block.
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: