Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from Dec 8, 2016
Merged

Conversation

gmaxwell
Copy link
Contributor

@gmaxwell gmaxwell commented Dec 6, 2016

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).

@maflcko
Copy link
Member

maflcko commented Dec 6, 2016

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?)

TheBlueMatt and others added 4 commits December 6, 2016 17:09
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: fd46136
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: 2082b55
This avoids a corner case (mostly visible on testnet) where bogus
 headers can keep nodes in IsInitialBlockDownload.

Github-Pull: #9053
Rebased-From: e141beb
@gmaxwell
Copy link
Contributor Author

gmaxwell commented Dec 6, 2016

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

@maflcko
Copy link
Member

maflcko commented Dec 6, 2016

utACK 5998a09

@laanwj
Copy link
Member

laanwj commented Dec 8, 2016

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

LGTM

@laanwj laanwj merged commit 5998a09 into bitcoin:0.13 Dec 8, 2016
laanwj added a commit that referenced this pull request Dec 8, 2016
…d not using header timestamp (#9053)

5998a09 IsInitialBlockDownload no longer uses header-only timestamps. (Gregory Maxwell)
5b93eee Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. (Gregory Maxwell)
ad20cdd IBD check uses minimumchain work instead of checkpoints. (Gregory Maxwell)
4c71fc4 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants