Page MenuHomePhabricator

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

Authored by deadalnix on Wed, Jun 24, 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Wed, Jun 24, 01:00
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Jun 24, 01:00
deadalnix requested review of this revision.Wed, Jun 24, 01:00
teamcity edited the summary of this revision. (Show Details)Wed, Jun 24, 01:00

[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.Wed, Jun 24, 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.Wed, Jun 24, 08:25
deadalnix updated this revision to Diff 21683.Wed, Jun 24, 13:19

dewitnessify

Fabien accepted this revision.Wed, Jun 24, 13:25
This revision is now accepted and ready to land.Wed, Jun 24, 13:25