IntersectMBO / IntersectMBO/ouroboros-consensus

Avoid deserialization of blocks in BlockFetchClient

Open
#709 1 comment 0 reactions 0 assignees View on GitHub
🏎️ performance enhancement
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

At the moment, the `BlockFetchClient` is deserializing blocks, but it doesn't really have a good reason to do so. It verifies that a block matches its header, but there's not really a good reason that I can see for doing this in the block fetch client (as opposed to just in the general block validation). Delaying the deserialiation until we actually validate the block has (at least?) two advantages:

* When we write the block to disk, we avoid an unnecessary re-serialization step.
* When we cache multiple blocks (which we will start doing from https://github.com/input-output-hk/ouroboros-network/pull/1709), then queueing serialized blocks is a much more compact representation than the deserialized blocks.

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.