Page MenuHomePhabricator

[refactor] Add useful-for-dos "reason" field to CValidationState
ClosedPublic

Authored by deadalnix on Jun 24 2020, 01:00.

Details

Summary

This is a first step towards cleaning up our DoS interface - make
validation return *why* something is invalid, and let net_processing
figure out what that implies in terms of banning/disconnection/etc.

Behavior change: peers will now be banned for providing blocks
with premature coinbase spends.

Co-authored-by: Anthony Towns <aj@erisian.com.au>

Suhas Daftuar <sdaftuar@gmail.com>

This is a partial backport of Core PR15141 : https://github.com/bitcoin/bitcoin/pull/15141/commits/34477ccd39a8d4bfa8ad612f22d5a46291922185

Test Plan
ninja all check-all

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Fabien requested changes to this revision.Jun 24 2020, 08:25
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/consensus/validation.h
39 ↗(On Diff #21675)

That comment needs some segwit clearance. Not sure the enum makes much sense for us at all.

src/validation.cpp
1740 ↗(On Diff #21675)

Note to reviewers: the behavior changed in D6693, now the ban happen in CheckInputs.

This revision now requires changes to proceed.Jun 24 2020, 08:25
This revision is now accepted and ready to land.Jun 24 2020, 13:25