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

Rewrite DoS interface between validation and net_processing #15141

Merged
merged 20 commits into from May 4, 2019
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8818729
[refactor] Refactor misbehavior ban decisions to MaybePunishNode()
TheBlueMatt Apr 16, 2018
b8b4c80
[refactor] drop IsInvalid(nDoSOut)
TheBlueMatt Jan 17, 2019
f34fa71
Drop obsolete sigops comment
TheBlueMatt Jan 18, 2019
00e11e6
[refactor] rename stateDummy -> orphan_state
TheBlueMatt Jan 22, 2019
7b99910
Clean up banning levels
TheBlueMatt Jan 23, 2019
6a7f877
Ban all peers for all block script failures
sdaftuar Apr 16, 2019
34477cc
[refactor] Add useful-for-dos "reason" field to CValidationState
TheBlueMatt Jan 16, 2019
c8b0d22
[refactor] Drop redundant nDoS, corruptionPossible, SetCorruptionPoss…
TheBlueMatt Jan 18, 2019
7df16e7
LookupBlockIndex -> CACHED_INVALID
TheBlueMatt Jan 17, 2019
6e55b29
CorruptionPossible -> TX_WITNESS_MUTATED
TheBlueMatt Jan 17, 2019
9ab2a04
CorruptionPossible -> BLOCK_MUTATED
TheBlueMatt Jan 18, 2019
ef54b48
[refactor] Use Reasons directly instead of DoS codes
TheBlueMatt Nov 8, 2017
6b34bc6
Fix handling of invalid headers
sdaftuar Jan 15, 2019
5e78c57
Allow use of state.Invalid() for all reasons
TheBlueMatt Jan 20, 2019
7721ad6
[refactor] Prep for scripted-diff by removing some \ns which annoy sed.
TheBlueMatt Nov 8, 2017
aa502b8
scripted-diff: Remove DoS calls to CValidationState
TheBlueMatt Apr 11, 2019
12dbdd7
[refactor] Drop unused state.DoS(), state.GetDoS(), state.CorruptionP…
TheBlueMatt Jan 18, 2019
2120c31
[refactor] Update some comments in validation.cpp as we arent doing D…
TheBlueMatt Apr 17, 2018
54470e7
Assert validation reasons are contextually correct
sdaftuar Feb 21, 2019
0ff1c2a
Separate reason for premature spends (coinbase/locktime)
sdaftuar Mar 8, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

CorruptionPossible -> TX_WITNESS_MUTATED

Co-authored-by: Anthony Towns <aj@erisian.com.au>
  • Loading branch information...
2 people authored and sdaftuar committed Jan 17, 2019
commit 6e55b292b0ea944897b6dc2f766446fd209af484
@@ -1777,7 +1777,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se
// Has inputs but not accepted to mempool
// Probably non-standard or insufficient fee
LogPrint(BCLog::MEMPOOL, " removed orphan tx %s\n", orphanHash.ToString());
if (!orphanTx.HasWitness() && !orphan_state.CorruptionPossible()) {
if (!orphanTx.HasWitness() && orphan_state.GetReason() != ValidationInvalidReason::TX_WITNESS_MUTATED) {
// Do not use rejection cache for witness transactions or
// witness-stripped transactions, as they can have been malleated.
// See https://github.com/bitcoin/bitcoin/issues/8279 for details.
@@ -2494,7 +2494,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
recentRejects->insert(tx.GetHash());
}
} else {
if (!tx.HasWitness() && !state.CorruptionPossible()) {
if (!tx.HasWitness() && state.GetReason() != ValidationInvalidReason::TX_WITNESS_MUTATED) {
// Do not use rejection cache for witness transactions or
// witness-stripped transactions, as they can have been malleated.
// See https://github.com/bitcoin/bitcoin/issues/8279 for details.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.