Page MenuHomePhabricator

Merge #11458: Don't process unrequested, low-work blocks
ClosedPublic

Authored by jasonbcox on Oct 26 2018, 22:37.

Details

Summary

01b52ce Add comment explaining forced processing of compact blocks (Suhas Daftuar)
08fd822 qa: add test for minchainwork use in acceptblock (Suhas Daftuar)
ce8cd7a Don't process unrequested, low-work blocks (Suhas Daftuar)

Pull request description:

A peer could try to waste our resources by sending us unrequested blocks with
low work (eg to fill up our disk).  Since e265200 we no longer request blocks until we
know we're on a chain with more than nMinimumChainWork (our anti-DoS
threshold), but we would still process unrequested blocks that had more work
than our tip (which generally has low-work during IBD), even though we may not
yet have found a headers chain with sufficient work.

Fix this and add a test.

Tree-SHA512: 1a4fb0bbd78054b84683f995c8c3194dd44fa914dc351ae4379c7c1a6f83224f609f8b9c2d9dde28741426c6af008ffffea836d21aa31a5ebaa00f8e0f81229e

Backport of Core PR11458
Completes T457

Co-authored-by: Jason B. Cox <contact@jasonbcox.com>

Test Plan

test_runner.py p2p-acceptblock

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pr11458
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3702
Build 5479: Bitcoin ABC Buildbot (legacy)
Build 5478: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Oct 26 2018, 23:32
deadalnix added inline comments.
src/net_processing.cpp
2846 ↗(On Diff #5555)

You missed a comment here.

2945 ↗(On Diff #5555)

dito

This revision now requires changes to proceed.Oct 26 2018, 23:32
jasonbcox added inline comments.
src/net_processing.cpp
2846 ↗(On Diff #5555)

I removed them because we don't do that stylistically. Would you prefer I add it back in?

src/net_processing.cpp
2846 ↗(On Diff #5555)

bool params are very cryptic and best avoided in general. A comment is the next best thing.

This revision is now accepted and ready to land.Oct 27 2018, 00:08
This revision was automatically updated to reflect the committed changes.