Suboptimal Block Checks #5163

issue ghost openend 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. laanwj added the label Improvement on Dec 5, 2014
  3. laanwj commented at 3:51 pm on February 16, 2016: member
    “Eliminate unnecessary call to CheckBlock #7225” fixes one of these
  4. ghost commented at 4:58 am on April 6, 2016: none
    Great: #7225 eliminates the first call referenced (1. ProcessBlock -> CheckBlock).
  5. adamjonas commented at 8:11 pm on December 16, 2020: member
    ref #9765 which effectively reverted #7225
  6. 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:

    0bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
    1{
    2    // These are checks that are independent of context.
    3
    4    if (block.fChecked)
    5        return true;
    
  7. 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.

  8. MarcoFalke closed this on Dec 17, 2020

  9. DrahtBot 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: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me