This PR skips check header (PoW), only when downloading headers.
This reduces a bottleneck when downloading block headers during the initial block download.
Tested on mainnet with IBD speed increase of ~22%
What is being skipped?
Skipped CheckProofOfWork() in pow.cpp when accepting headers (during IDB).
Is this safe?
CheckProofOfWork() is already checked in several places.
CheckProofOfWork() is called by CheckBlock() which is called multiple times.
In CheckBlock()
// Check that the header is valid (particularly PoW). This is mostly
// redundant with the call in AcceptBlockHeader.
if (!CheckBlockHeader(block, state, consensusParams, fCheckPOW))
return false;
This PR skips check header (PoW), only when downloading headers.
This reduces a bottleneck when downloading block headers during the initial block download. Tested on mainnet with IBD speed increase of ~22%
What is being skipped?
Skipped
CheckProofOfWork()
inpow.cpp
when accepting headers (during IDB).Is this safe?
CheckProofOfWork()
is already checked in several places.CheckProofOfWork()
is called byCheckBlock()
which is called multiple times.In
CheckBlock()