Skip to content

WIP: Don't download blocks unless they have more work than our current best#9428

Closed
rebroad wants to merge 1 commit intobitcoin:masterfrom
rebroad:DownloadOnlyGreaterWork
Closed

WIP: Don't download blocks unless they have more work than our current best#9428
rebroad wants to merge 1 commit intobitcoin:masterfrom
rebroad:DownloadOnlyGreaterWork

Conversation

@rebroad
Copy link
Copy Markdown
Contributor

@rebroad rebroad commented Dec 26, 2016

An alternative to #9427. #9427 assumes we wanted to download the block but more efficiently than was being done, whereas this PR assumes we don't need the block at all, until circumstances suggest we do (i.e. it's forming the longer chain).

To elaborate:-

Currently the logic for compact blocks is that it is now requested unless the work is greater than our current best, whereas the parallel fetch logic will still request blocks with work equal to our current best, which means that for competing blocks we always requested the full block even though we could have used the compact block received.

Rather than utilize the compact block, we don't need to download the block at all (saving disk space) until we are sure that it's part of a longer chain.

Currently the code for compact blocks is this, but the parallel fetch
code still wanting to download blocks with work equal to our current
best, which meant that for competing blocks we always requested the full
block even though we could have used the compact block received.

Rather than utilize the compact block, we don't need to download the
block at all (saving disk space) until we are sure that it's part of a
longer chain.
@fanquake fanquake added the P2P label Dec 26, 2016
@fanquake
Copy link
Copy Markdown
Member

@rebroad Instead of opening two pull requests, that are alternatives to each other, could you instead open a single pull request, that contains your preferred changes, and mention the alternative change in the body of the PR.

I could understand opening two separate pull requests if the two change-sets were extensive. ie both with many lines of vastly different code. However this is a similar one line change vs a two line change, so you could outline both approaches in a single PR.

There's also the problem of discussion around a similar issue becoming fragmented and/or lossed when it's spread across multiple pull requests discussing the same issue.

Apart from the above, we're also flooded with pull-requests at the moment, so while code changes/improvements are always welcome, opening multiple pull requests at a time over the same issues is unnecessarily adding to the backlog.

I'm closing this, could you please add your changes/discussion from this PR into #9427. Thanks.

@fanquake fanquake closed this Dec 26, 2016
@rebroad rebroad changed the title Don't download blocks unless they have more work than our current best WIP: Don't download blocks unless they have more work than our current best Dec 26, 2016
@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.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants