[0.13 Backport] IBD using chainwork instead of height and not using header timestamp (#9053) #9293

pull gmaxwell wants to merge 4 commits into bitcoin:0.13 from gmaxwell:9053_backport changing 8 files +21 −52
  1. gmaxwell commented at 8:57 AM on December 6, 2016: contributor

    This is a backport of PR #9053 -- we passed on backporting it right after it was merged, but it's been in master for over a month now with no issue.

    This resolves some frequent annoying misbehavior on testnet (in theory the problems it solves are also possible on mainnet but aren't likely there without miner funny business).

  2. MarcoFalke commented at 11:31 AM on December 6, 2016: member

    GetTotalBlocksEstimate() is still used in another place in main.

    Style nit: Please use the backport script by @luke-jr, so that there is a reference to the original pull and commit hash? (@luke-jr would you mind to put that script in our repo?)

  3. Remove duplicate nBlocksEstimate cmp (we already checked IsIBD())
    Github-Pull: #8865
    Rebased-From: 0278fb5f48ae9e42ec0772f85e201051077f633c
    4c71fc42fb
  4. IBD check uses minimumchain work instead of checkpoints.
    This introduces a 'minimum chain work' chainparam which is intended
     to be the known amount of work in the chain for the network at the
     time of software release.  If you don't have this much work, you're
     not yet caught up.
    
    This is used instead of the count of blocks test from checkpoints.
    
    This criteria is trivial to keep updated as there is no element of
    subjectivity, trust, or position dependence to it. It is also a more
    reliable metric of sync status than a block count.
    
    Github-Pull: #9053
    Rebased-From: fd46136dfaf68a7046cf7b8693824d73ac6b1caf
    ad20cddce2
  5. Remove GetTotalBlocksEstimate and checkpoint tests that test nothing.
    GetTotalBlocksEstimate is no longer used and it was the only thing
     the checkpoint tests were testing.
    
    Since checkpoints are on their way out it makes more sense to remove
     the test file than to cook up a new pointless test.
    
    Github-Pull: #9053
    Rebased-From: 2082b5574cec783f4ff99941492d92e05680b293
    5b93eeebb4
  6. IsInitialBlockDownload no longer uses header-only timestamps.
    This avoids a corner case (mostly visible on testnet) where bogus
     headers can keep nodes in IsInitialBlockDownload.
    
    Github-Pull: #9053
    Rebased-From: e141beb6a9816b7e1e680fb0a8bae16d42a3e557
    5998a09546
  7. gmaxwell commented at 5:48 PM on December 6, 2016: contributor

    @MarcoFalke K. I believe I addressed your comments (I just imitated the style by hand.)

  8. MarcoFalke commented at 6:15 PM on December 6, 2016: member

    utACK 5998a09

  9. fanquake added this to the milestone 0.13.2 on Dec 8, 2016
  10. fanquake added the label Consensus on Dec 8, 2016
  11. fanquake added the label Refactoring on Dec 8, 2016
  12. laanwj commented at 12:11 PM on December 8, 2016: member

    I believe I addressed your comments (I just imitated the style by hand.)

    LGTM

  13. laanwj merged this on Dec 8, 2016
  14. laanwj closed this on Dec 8, 2016

  15. laanwj referenced this in commit e591c1049f on Dec 8, 2016
  16. MarcoFalke locked this on Sep 8, 2021

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-04-18 21:15 UTC

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