Suboptimal Block Checks #5163

issue ghost opened this issue on October 29, 2014
  1. ghost commented at 1:42 AM on October 29, 2014: none

    Every valid block Proccess(ed) is CheckBlock(ed) three times:

    • 1. ProcessBlock -> CheckBlock
    • 2. ProcessBlock -> AcceptBlock -> CheckBlock
    • 3. ProcessBlock -> ActivateBestChain -> ActivateBestChainStep -> ConnectTip -> ConnectBlock -> CheckBlock

    'Tis is an opportunity to optimize.

  2. unknown cross-referenced this on Nov 13, 2014 from issue Check block header when accepting headers from peers. by domob1812
  3. laanwj added the label Improvement on Dec 5, 2014
  4. unknown cross-referenced this on Feb 28, 2015 from issue Optimize block validation code and block propagation speed by gavinandresen
  5. laanwj commented at 3:51 PM on February 16, 2016: member

    "Eliminate unnecessary call to CheckBlock #7225" fixes one of these

  6. ghost commented at 4:58 AM on April 6, 2016: none

    Great: #7225 eliminates the first call referenced (1. ProcessBlock -> CheckBlock).

  7. adamjonas commented at 8:11 PM on December 16, 2020: member

    ref #9765 which effectively reverted #7225

  8. MarcoFalke commented at 8:03 AM on December 17, 2020: member

    What is the issue here? Performance can't be the issue because of the cache:

    bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
    {
        // These are checks that are independent of context.
    
        if (block.fChecked)
            return true;
    
  9. MarcoFalke commented at 8:03 AM on December 17, 2020: member

    The feature request didn't seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open issues.

    Closing due to lack of interest. Pull requests with improvements are always welcome.

  10. MarcoFalke closed this on Dec 17, 2020

  11. bitcoin locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC