HomePhabricator

net: Serve blocks directly from disk when possible

Description

net: Serve blocks directly from disk when possible

Summary:
In ProcessGetBlockData, send the block data directly from disk if
a non-compact block is requested. This is a valid shortcut as the
on-disk format matches the network format.

This is expected to increase performance because a deserialization and
subsequent serialization roundtrip is avoided.

This is a backport of core#13151

Note that this is a very old PR (2018) so we need to include a number of other changes that were ignored in previous backports (or not yet fully backported). Some notable ones are:

Test Plan:
ninja all check-all

run on mainnet for a while, check the logs to make sure we are not unexpectedly disconneted by peers receiving our blocks

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18952

Details

Provenance
PiRKAuthored on Tue, Nov 18, 10:17
PiRKPushed on Wed, Nov 19, 08:01
Reviewer
Restricted Project
Differential Revision
D18952: net: Serve blocks directly from disk when possible
Parents
rABCadfccaa7072a: [cashtab-faucet] Tighten IP rate limits
Branches
Unknown
Tags
Unknown