aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-13[refactor] interfaces: Add missing LockAnnotation for cs_mainMarcoFalke
2019-05-10Merge #15744: refactor: Extract ParseDescriptorRangeMarcoFalke
510c6532ba Extract ParseDescriptorRange (Ben Woosley) Pull request description: So as to be consistently informative when the checks fail, and to protect against unintentional divergence among the checks. ACKs for commit 510c65: meshcollider: Oh apologies, yes. Thanks :) utACK https://github.com/bitcoin/bitcoin/pull/15744/commits/510c6532bae9abc5beda1c126c945923a64680cb MarcoFalke: utACK 510c6532bae9abc5beda1c126c945923a64680cb sipa: utACK 510c6532bae9abc5beda1c126c945923a64680cb Tree-SHA512: b1f0792bfaa163890a20654a0fc2c4c4a996659916bf5f4a495662436b39326692a1a0c825caafd859e48c05f5dd1865c4f7c28092be5074edda3c94f94f9f8b
2019-05-10Merge #15239: scripts and tools: Move non-linux build source tarballs to ↵MarcoFalke
"bitcoin-binaries/version" directory 5c04814b2d Move non-linux source tarball to bitcoin-binaries (Hennadii Stepanov) Pull request description: Currently, if a user makes a non-linux (`--os=w`, `--os=m` or `--os=wm`) gitian building with the `gitian-build.py` script, source tarballs are not moved to the `bitcoin-binaries/${VERSION}` directory. This PR fixes this bug. ~~In addition, the `src` subdirectory in the `gitian-builder/build/out` directory is no longer used as unnecessary.~~ ACKs for commit 5c0481: fanquake: utACK 5c04814 ken2812221: utACK 5c04814b2de179fd03ca18c19049f035a2454f81 Tree-SHA512: 8648b6cbf502c012b12642783870e37aea385bd5f4cba5cb577fee924c09685e9a117676be502e4d4783c7a8ab31a2bd495970eec42a42d78e86ac5d39323091
2019-05-10Merge #15512: Add ChaCha20 encryption option (XOR)Jonas Schnelli
2dfe27517 Add ChaCha20 bench (Jonas Schnelli) 2bc2b8b49 Add ChaCha20 encryption option (XOR) (Jonas Schnelli) Pull request description: The current ChaCha20 implementation does not support message encryption (it can only output the keystream which is sufficient for the RNG). This PR adds the actual XORing of the `plaintext` with the `keystream` in order to return the desired `ciphertext`. Required for v2 message transport protocol. ACKs for commit 2dfe27: jnewbery: Looks good. utACK 2dfe2751713c814aea53b5a7563eb74ad1baea00. jnewbery: utACK 2dfe2751713c814aea53b5a7563eb74ad1baea00 sipa: utACK 2dfe2751713c814aea53b5a7563eb74ad1baea00 ryanofsky: utACK 2dfe2751713c814aea53b5a7563eb74ad1baea00. Changes since last review are just renaming the Crypt method, adding comments, and simplifying the benchmark. Tree-SHA512: 84bb234da2ca9fdc44bc29a786d9dd215520f81245270c1aef801ef66b6091b7793e2eb38ad6dbb084925245065c5dce9e5582f2d0fa220ab3e182d43412d5b5
2019-05-09Merge #15939: gitian: Remove Windows 32 bit buildWladimir J. van der Laan
fa193dc8e6f3b96fa2dba2f1c1668f7720fed320 doc: Remove win32 from the release process (MarcoFalke) faf666f8148eeb305a9c4f78459aff2c7268016b Remove Windows 32 bit build (MarcoFalke) Pull request description: The Windows 32 bit build has been removed from https://bitcoincore.org/en/download/, so unless there are complaints, we don't need to build it even ACKs for commit fa193d: fanquake: utACK https://github.com/bitcoin/bitcoin/pull/15939/commits/fa193dc8e6f3b96fa2dba2f1c1668f7720fed320 Tree-SHA512: d6f2976a2e0c407698f720b00ac23ec4056626de4eff8621f4c5581120af0460afd1bdef72329cc0e7d92afca48d94ae5fce6777cb36bfabb60b8034ff08fd88
2019-05-09Merge #15452: Replace CScriptID and CKeyID in CTxDestination with dedicated ↵Wladimir J. van der Laan
types 78e407ad0c26190a22de1bc8ed900164a44a36c3 GetKeyBirthTimes should return key ids, not destinations (Gregory Sanders) 70946e7fee54323ce6a5ea8aeb377e2c7c790bc6 Replace CScriptID and CKeyID in CTxDestination with dedicated types (Gregory Sanders) Pull request description: The current usage seems to be an overloading of meanings. `CScriptID` is used in the wallet as a lookup key, as well as a destination, and `CKeyID` likewise. Instead, have all destinations be dedicated types. New types: `CScriptID`->`ScriptHash` `CKeyID`->`PKHash` ACKs for commit 78e407: ryanofsky: utACK 78e407ad0c26190a22de1bc8ed900164a44a36c3. Only changes are removing extra CScriptID()s and fixing the test case. Sjors: utACK 78e407a meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/15452/commits/78e407ad0c26190a22de1bc8ed900164a44a36c3 Tree-SHA512: 437f59fc3afb83a40540da3351507aef5aed44e3a7f15b01ddad6226854edeee762ff0b0ef336fe3654c4cd99a205cef175211de8b639abe1130c8a6313337b9
2019-05-09Merge #15794: docs: Clarify PR guidelines w/re documentationWladimir J. van der Laan
f4a230b627bf9ff53e14719609849ee05b022480 docs: Clarify PR guidelines w/re documentation (Carl Dong) Pull request description: PRs should change documentation accordingly when the behaviour of code changes. ACKs for commit f4a230: practicalswift: ACK f4a230b627bf9ff53e14719609849ee05b022480 fanquake: utACK f4a230b Tree-SHA512: 6d9d65d7f0f9bc8f324ee16f03169df28fb512c58bb71093128cf16797b25533cdc992bc8757034a99d6fa6423a3129ca7cf2ab2da857535f409a683486fd4ab
2019-05-09Merge #15766: scripts and tools: Upgrade gitian image before signingWladimir J. van der Laan
beda0dae953aa125e08302713d2c7b214eddbe5a Upgrade gitian image before signing (Hennadii Stepanov) Pull request description: The package upgrade in the Ubuntu repositories in the period between the building and the signing causes (particularly, using LXC) an error: ``` Creating package manifest Could not download some packages, please run gbuild --upgrade ``` For example, the [`busybox-initramfs`](https://packages.ubuntu.com/bionic/busybox-initramfs) package was [upgraded](http://changelogs.ubuntu.com/changelogs/pool/main/b/busybox/busybox_1.27.2-2ubuntu3.2/changelog) from `1:1.27.2-2ubuntu3.1` to `1:1.27.2-2ubuntu3.2` on 2019-03-06. This PR forces gitian image upgrade for the `--sign` command. Ref: [devrandom/gitian-builder/target-bin/grab-packages.sh](https://github.com/devrandom/gitian-builder/blob/04ab7c121842be8c5848b3de5076c8ded7761314/target-bin/grab-packages.sh) ``` #!/bin/sh # Get an installed package manifest set -e cd /var/cache/apt/archives # make sure all packages with installed versions are downloaded # (except for held packages, which may not be available for download) dpkg-query -W -f '${Status}\t${Package}=${Version}\n' | grep -v ^hold | cut -f2- | xargs -n 50 apt-get install -q --reinstall -y -d > /tmp/download.log grep "cannot be downloaded" /tmp/download.log && { echo Could not download some packages, please run gbuild --upgrade 1>&2 ; exit 1 ; } sha256sum *.deb | sort --key 2 ``` ACKs for commit beda0d: laanwj: utACK beda0dae953aa125e08302713d2c7b214eddbe5a fanquake: utACK beda0da Tree-SHA512: e2e3b3e3719e098d266ceec39bd69b950344a4eb2f43ae6ad3e696add70f743b363cc83676e339f7caa207d6478029869a8af01fe1f6d5690d2857003f7d8ce8
2019-05-08Merge #15890: Doc: remove text about txes always relayed from -whitelistMarcoFalke
e0bb279999 Doc: remove text about txes always relayed from -whitelist (David A. Harding) Pull request description: Updates text since -whitelistforcerelay was set to false by default in PR #15193. ACKs for commit e0bb27: fanquake: utACK e0bb279 MarcoFalke: utACK e0bb2799992afe88e6f4efc6d90ed82ddf1ec5ec Tree-SHA512: cf0c9321d72692d573039a04f8f1d048cbdf67ed86cc781523dabd3c45d2731b788f53749e6bb29d7da1ab44eb04030f352469b20489bb2a26c2c38fb61f6489
2019-05-08doc: Remove win32 from the release processMarcoFalke
2019-05-08Merge #15664: change default Python block serialization to witnessMarcoFalke
124ea38e39 change default Python block serialization to witness (Gregory Sanders) Pull request description: ACKs for commit 124ea3: stevenroose: ACK 124ea38e39320d6f63cdf24979d0c1ff92cd769c Tree-SHA512: 52877934f8a3c761cb89a618daffe73e86b008d9d32d48721392b7626aaa10d3b9aa26e4c59337729e0a2d01fc48648eef5ec3d72de531a685a2cf4f4d7579ab
2019-05-08Merge #15971: validation: Add compile-time checking for negative locking ↵MarcoFalke
requirement in LimitValidationInterfaceQueue 62d50ef308 Add LOCKS_EXCLUDED(cs_main) to LimitValidationInterfaceQueue(...) which does AssertLockNotHeld(cs_main) (practicalswift) Pull request description: This PR adds compile-time checking for negative locking requirements that follow from the run-time locking requirement `AssertLockNotHeld(cs_main)` in `LimitValidationInterfaceQueue(...)`. Changes: * Add `LOCKS_EXCLUDED(cs_main)` to `LimitValidationInterfaceQueue(...)` which does `AssertLockNotHeld(cs_main)` * Add `LOCKS_EXCLUDED(cs_main)` to `CChainState::ActivateBestChain(…)`, `CChainState:: InvalidateBlock(…)` and `CChainState::RewindBlockIndex(…)` which all call `LimitValidationInterfaceQueue(...)` which does `AssertLockNotHeld(cs_main)` * Add `LOCKS_EXCLUDED(cs_main)` to `InvalidateBlock(…)` which calls `CChainState::InvalidateBlock(...)` which in turn calls `LimitValidationInterfaceQueue(...)` which does `AssertLockNotHeld(cs_main)` * Add `LOCKS_EXCLUDED(cs_main)` to `RewindBlockIndex(…)` which calls `CChainState::RewindBlockIndex(...)` which in turn calls `LimitValidationInterfaceQueue(...)` which does `AssertLockNotHeld(cs_main)` ACKs for commit 62d50e: MarcoFalke: utACK 62d50ef308 Tree-SHA512: 73d092ccd08c851ae3c5d60370c369fc030c5793f5507e2faccb6f91c851ddc0ce059fbea3899f2856330d7a8c78f2ac6a2988e8268b03154f946be9e60e3be1
2019-05-08Merge #15978: .gitignore: Don't ignore depends patchesMarcoFalke
a3592c91a2 .gitignore: Don't ignore depends patches (Carl Dong) Pull request description: Ignoring patches might be useful for those who use `git format-patch` often, but in our depends folder we **_want_** to keep track of our patches. ACKs for commit a3592c: practicalswift: utACK a3592c91a2d39efe80eb5fe81511da12728d2687 laanwj: utACK a3592c91a2d39efe80eb5fe81511da12728d2687 jonasschnelli: utACK a3592c91a2d39efe80eb5fe81511da12728d2687 fanquake: utACK a3592c9 Tree-SHA512: 439479cc2ff05335c3d21551a23b34ef2f8a4d0eb05085d2422c2c8d7d7035f529b83dc4056f18cb96234d6fa74075adaa14f0e5fb4c99e6189a4af9078fd28e
2019-05-09Merge #15880: utils and libraries: Replace deprecated Boost Filesystem functionsMeshCollider
a0a222eec Replace deprecated Boost Filesystem function (Hennadii Stepanov) 4f65af97b Remove dead code for walletFile check (Hennadii Stepanov) Pull request description: Boost Filesystem `basename()` and `extension()` functions are [deprecated since v1.36.0](https://www.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Convenience-functions). See more: https://lists.boost.org/Archives/boost/2010/01/160905.php Also this PR prevents further use of deprecated Boost Filesystem functions. Ref: https://www.boost.org/doc/libs/1_64_0/libs/filesystem/doc/index.htm#Coding-guidelines Note: On my Linux system Boost 1.65.1 header `/usr/include/boost/filesystem/convenience.hpp` contains: ```c++ # ifndef BOOST_FILESYSTEM_NO_DEPRECATED inline std::string extension(const path & p) { return p.extension().string(); } inline std::string basename(const path & p) { return p.stem().string(); } inline path change_extension( const path & p, const path & new_extension ) { path new_p( p ); new_p.replace_extension( new_extension ); return new_p; } # endif ``` UPDATE: Also removed unused code as [noted](https://github.com/bitcoin/bitcoin/pull/15880#discussion_r279386614) by **ryanofsky**. ACKs for commit a0a222: Empact: utACK https://github.com/bitcoin/bitcoin/pull/15880/commits/a0a222eec0b7f615a756e5e0dcec9b02296f999c practicalswift: utACK a0a222eec0b7f615a756e5e0dcec9b02296f999c fanquake: utACK a0a222e ryanofsky: utACK a0a222eec0b7f615a756e5e0dcec9b02296f999c. Only change is dropping assert and squashing first two commits. Tree-SHA512: bc54355441c49957507eb8d3a5782b92d65674504d69779bc16b1b997b2e7424d5665eb6bfb6e10b430a6cacd2aca70af2f94e5f7f10bea24624202834ad35c7
2019-05-08Add LOCKS_EXCLUDED(cs_main) to LimitValidationInterfaceQueue(...) which does ↵practicalswift
AssertLockNotHeld(cs_main) Add LOCKS_EXCLUDED(cs_main) to functions calling LimitValidationInterfaceQueue(...) which does AssertLockNotHeld(cs_main) Add LOCKS_EXCLUDED(cs_main) to functions calling CChainState::InvalidateBlock(...) which calls LimitValidationInterfaceQueue(...) which in turn does AssertLockNotHeld(cs_main) Add LOCKS_EXCLUDED(cs_main) to functions calling CChainState::RewindBlockIndex(...) which calls LimitValidationInterfaceQueue(...) which in turn does AssertLockNotHeld(cs_main)
2019-05-07.gitignore: Don't ignore depends patchesCarl Dong
2019-05-07Merge #15948: refactor: rename chainActiveMarcoFalke
486c1eea86 refactoring: remove unused chainActive (James O'Beirne) 631940aab2 scripted-diff: replace chainActive -> ::ChainActive() (James O'Beirne) a3a609079c refactoring: introduce unused ChainActive() (James O'Beirne) 1b6e6fcfd2 rename: CChainState.chainActive -> m_chain (James O'Beirne) Pull request description: This is part of the assumeutxo project: Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal --- This change refactors the `chainActive` reference into a `::ChainActive()` call. It also distinguishes `CChainState`'s `CChain` data member as `m_chain` instead of the current `chainActive`, which makes it easily confused with the global data. The active chain must be obtained via function because its reference will be swapped at some point during runtime after loading a UTXO snapshot. This change, though lengthy, should be pretty easy to review since most of it is contained within a scripted-diff. Once merged, the parent PR should be easier to review. ACKs for commit 486c1e: Sjors: utACK 486c1ee promag: utACK 486c1ee. practicalswift: utACK 486c1eea863a41e597ae4fddc392f446f2518b4b Tree-SHA512: 06ed8f9e77f2d25fc9bea0ba86436d80dbbce90a1e8be23e37ec4eeb26060483e60b4a5c4fba679cb1867f61e3921c24abeb9cabdfb4d0a9b1c4ddd77b17456a
2019-05-06Merge #14266: refactor: Lift prevector default vals to the member declarationMarcoFalke
d2eee87928 Lift prevector default vals to the member declaration (Ben Woosley) Pull request description: I overlooked this possibility in #14028 ACKs for commit d2eee8: promag: utACK d2eee87, change looks good because members are always initialized. 251Labs: utACK d2eee87 nice one. ken2812221: utACK d2eee87928781ab3082d4279aa6f19641a45e801 practicalswift: utACK d2eee87928781ab3082d4279aa6f19641a45e801 scravy: utACK d2eee87928781ab3082d4279aa6f19641a45e801 Tree-SHA512: f2726bae1cf892fd680cf8571027bcdc2e42ba567eaa901fb5fb5423b4d11b29e745e0163d82cb513d8c81399cc85933a16ed66d4a30829382d4721ffc41dc97
2019-05-06Merge #15927: [tests] log thread names by default in functional testsMarcoFalke
7b29ec277b [tests] Comment for why logging config is set as command-line args. (John Newbery) ba534ccd56 [tests] log thread names by default in functional tests (John Newbery) Pull request description: More detailed logs are better ACKs for commit 7b29ec: jamesob: utACK https://github.com/bitcoin/bitcoin/pull/15927/commits/7b29ec277b2f99a526c2a70f0dec7b28f1e874a4 Tree-SHA512: 327cfedb7b7bf32f7ce1e2de5f70c7092041a8e868e14285a79176277c6cf47ebea27027f68787332f8ad21c7f64d2640dd21813eda5b2bd0e5208a65364a879
2019-05-06Merge #15730: rpc: Show scanning details in getwalletinfoWladimir J. van der Laan
b6c748f84909212dce73e4b77aa125ed1e108a10 doc: Add release notes for 15730 (João Barbosa) d3e8458365ab29017241bc43204fe81cb7fd8530 rpc: Show scanning details in getwalletinfo (João Barbosa) 90e27abe37cc84c7b206f20d28aafe32e71e7209 wallet: Track current scanning progress (João Barbosa) 2ee811e6930cf76ea51e6826fe437ed888688adc wallet: Track scanning duration (João Barbosa) Pull request description: Closes #15724. ACKs for commit b6c748: MarcoFalke: re-utACK b6c748f849 (Only change since my last review is rebase, adding release notes, and returning false instead of null) laanwj: utACK b6c748f84909212dce73e4b77aa125ed1e108a10 jonatack: ACK b6c748f84909212dce73e4b77aa125ed1e108a10, only changes appear to be rebase for https://github.com/bitcoin/bitcoin/pull/15730#discussion_r280030617 and release notes. Tree-SHA512: 8ee98f971c15f66ce8138fc92c55e51abc9faf01866a31ac7ce2ad766aa2bb88559eabee3b5815d645c84cdf1c19dc35ec03f31461e39bc5f6040edec0b87116
2019-05-06Merge #15930: rpc: Add balances RPCWladimir J. van der Laan
facfb4111d14a3b06c46690a2cca7ca91cea8a96 rpc: Deprecate getunconfirmedbalance and getwalletinfo balances (MarcoFalke) 999931cf8f167c7547f1015cdf05437a460c27f0 rpc: Add getbalances RPC (MarcoFalke) fad13e925e197163a942f3f0d1ba2c95a2b65a56 rpcwallet: Make helper methods const on CWallet (MarcoFalke) fad40ec9151248c6e8225e14980424f581d23e02 wallet: Use IsValidNumArgs in getwalletinfo rpc (MarcoFalke) Pull request description: This exposes the `CWallet::GetBalance()` struct over RPC. In the future, incorrectly named rpcs such as `getunconfirmedbalance` or rpcs redundant to this such as `getbalance` could be removed. ACKs for commit facfb4: jnewbery: utACK facfb4111d14a3b06c46690a2cca7ca91cea8a96 Tree-SHA512: 1f54fedce55df9a8ea82d2b6265354b39a956072621876ebaee2355aac0e23c7b64340c3279502415598c095858529e18b50789be956250aafda1cd3a8d948a5
2019-05-06Merge #15947: Install bitcoin-wallet manpageWladimir J. van der Laan
00d110463aed12ecdc6e9c2bf47d9ef61d19fa9d Install bitcoin-wallet manpage. (Daniel Kraft) Pull request description: This change marks the already-existing `bitcoin-wallet.1` manpage file for installation together with the others. Previously, only `bitcoind.1`, `bitcoin-cli.1`, `bitcoin-tx.1` and `bitcoin-qt.1` would be installed. ACKs for commit 00d110: laanwj: utACK 00d110463aed12ecdc6e9c2bf47d9ef61d19fa9d practicalswift: utACK 00d110463aed12ecdc6e9c2bf47d9ef61d19fa9d Tree-SHA512: ca846e414548f1dc774f460edca2e17d7d619c7e6f0d18db0c58c09e04f9d43c6964fcf2bacb5b1eae94de9c5fdda86abf258ef6b78b0f693715d070dfc10f08
2019-05-06Merge #15928: GUI: Move QRImageWidget to its own file-pairWladimir J. van der Laan
fc929842c20ac81869a33edce765e389a46e6c0c GUI: Move QRImageWidget to its own file-pair (Luke Dashjr) 77851ab682bf94f78874a245919bcc4b79dc054e GUI: Refactor actual QR code rendering into new QRImageWidget::setQR (Luke Dashjr) Pull request description: For at least QR-code based pairing of mobile wallets with nodes, it will be desirable to render QR codes even without wallet support. Therefore, this prepares by moving the QRImageWidget out of a wallet-specific file into its own `qrencoder` file-pair. ACKs for commit fc9298: laanwj: utACK fc929842c20ac81869a33edce765e389a46e6c0c jonasschnelli: utACK fc929842c20ac81869a33edce765e389a46e6c0c Tree-SHA512: 95529a38c0573a4b3f1253fb5f11ca07a5b3a9840ec24acc7d87270212f3c9f7c5b186d9274d297517a3b80494f38a57574fb9730b1574db01688539b987bd91
2019-05-04Merge #15141: Rewrite DoS interface between validation and net_processingWladimir J. van der Laan
0ff1c2a838da9e8dc7f77609adc89124bbea3e2b Separate reason for premature spends (coinbase/locktime) (Suhas Daftuar) 54470e767bab37f9b7089782b1be73d5883bb244 Assert validation reasons are contextually correct (Suhas Daftuar) 2120c31521aa51aa1984ee33250b8320506d3a0f [refactor] Update some comments in validation.cpp as we arent doing DoS there (Matt Corallo) 12dbdd7a41bac73e51ed8f7b290b7671196bf9ea [refactor] Drop unused state.DoS(), state.GetDoS(), state.CorruptionPossible() (Matt Corallo) aa502b88d10c2c3ac56d9163555849b96dc4df1e scripted-diff: Remove DoS calls to CValidationState (Matt Corallo) 7721ad64f40a0c67edefaaf7353264d78df8803e [refactor] Prep for scripted-diff by removing some \ns which annoy sed. (Matt Corallo) 5e78c5734bb0c9aae7b0a7019a745b2d7059b3d9 Allow use of state.Invalid() for all reasons (Matt Corallo) 6b34bc6b6f54f85537494cbea3846d5d195a06d9 Fix handling of invalid headers (Suhas Daftuar) ef54b486d5333dfc85c56e6b933c81735196a25d [refactor] Use Reasons directly instead of DoS codes (Matt Corallo) 9ab2a0412e96e87956fe61257387683635213035 CorruptionPossible -> BLOCK_MUTATED (Matt Corallo) 6e55b292b0ea944897b6dc2f766446fd209af484 CorruptionPossible -> TX_WITNESS_MUTATED (Matt Corallo) 7df16e70e67c753c871797ce947ea09d7cb0e519 LookupBlockIndex -> CACHED_INVALID (Matt Corallo) c8b0d22698385f91215ce8145631e3d5826dc977 [refactor] Drop redundant nDoS, corruptionPossible, SetCorruptionPossible (Matt Corallo) 34477ccd39a8d4bfa8ad612f22d5a46291922185 [refactor] Add useful-for-dos "reason" field to CValidationState (Matt Corallo) 6a7f8777a0b193fae4f976196f3464ffac01bf1b Ban all peers for all block script failures (Suhas Daftuar) 7b999103e21509e1c2dec10f68e48744ffe90f55 Clean up banning levels (Matt Corallo) b8b4c80146780f9011abbd1be72343cc965c07b9 [refactor] drop IsInvalid(nDoSOut) (Matt Corallo) 8818729013e17c650a25f030b2b80e0997389155 [refactor] Refactor misbehavior ban decisions to MaybePunishNode() (Matt Corallo) 00e11e61c0211a62788611cd6a6714a393fdc26c [refactor] rename stateDummy -> orphan_state (Matt Corallo) f34fa719cf33a51d11f1d2219cbe73ccff6fd697 Drop obsolete sigops comment (Matt Corallo) Pull request description: This is a rebase of #11639 with some fixes for the last few comments which were not yet addressed. The original PR text, with some strikethroughs of text that is no longer correct: > This cleans up an old main-carryover - it made sense that main could decide what DoS scores to assign things because the DoS scores were handled in a different part of main, but now validation is telling net_processing what DoS scores to assign to different things, which is utter nonsense. Instead, we replace CValidationState's nDoS and CorruptionPossible with a general ValidationInvalidReason, which net_processing can handle as it sees fit. I keep the behavior changes here to a minimum, but in the future we can utilize these changes for other smarter behavior, such as disconnecting/preferring to rotate outbound peers based on them providing things which are invalid due to SOFT_FORK because we shouldn't ban for such cases. > > This is somewhat complementary with, though obviously conflicts heavily with #11523, which added enums in place of DoS scores, as well as a few other cleanups (which are still relevant). > > Compared with previous bans, the following changes are made: > > Txn with empty vin/vout or null prevouts move from 10 DoS > points to 100. > Loose transactions with a dependency loop now result in a ban > instead of 10 DoS points. > ~~BIP68-violation no longer results in a ban as it is SOFT_FORK.~~ > ~~Non-SegWit SigOp violation no longer results in a ban as it > considers P2SH sigops and is thus SOFT_FORK.~~ > ~~Any script violation in a block no longer results in a ban as > it may be the result of a SOFT_FORK. This should likely be > fixed in the future by differentiating between them.~~ > Proof of work failure moves from 50 DoS points to a ban. > Blocks with timestamps under MTP now result in a ban, blocks > too far in the future continue to not result in a ban. > Inclusion of non-final transactions in a block now results in a > ban instead of 10 DoS points. Note: The change to ban all peers for consensus violations is actually NOT the change I'd like to make -- I'd prefer to only ban outbound peers in those situations. The current behavior is a bit of a mess, however, and so in the interests of advancing this PR I tried to keep the changes to a minimum. I plan to revisit the behavior in a followup PR. EDIT: One reviewer suggested I add some additional context for this PR: > The goal of this work was to make net_processing aware of the actual reasons for validation failures, rather than just deal with opaque numbers instructing it to do something. > > In the future, I'd like to make it so that we use more context to decide how to punish a peer. One example is to differentiate inbound and outbound peer misbehaviors. Another potential example is if we'd treat RECENT_CONSENSUS_CHANGE failures differently (ie after the next consensus change is implemented), and perhaps again we'd want to treat some peers differently than others. ACKs for commit 0ff1c2: jnewbery: utACK 0ff1c2a838da9e8dc7f77609adc89124bbea3e2b ryanofsky: utACK 0ff1c2a838da9e8dc7f77609adc89124bbea3e2b. Only change is dropping the first commit (f3883a321bf4ab289edcd9754b12cae3a648b175), and dropping the temporary `assert(level == GetDoS())` that was in 35ee77f2832eaffce30042e00785c310c5540cdc (now c8b0d22698385f91215ce8145631e3d5826dc977) Tree-SHA512: e915a411100876398af5463d0a885920e44d473467bb6af991ef2e8f2681db6c1209bb60f848bd154be72d460f039b5653df20a6840352c5f7ea5486d9f777a3
2019-05-03Merge #15949: test_runner: Move pruning back to extendedMarcoFalke
fa08c5cb99 test_runner: Move pruning back to extended (MarcoFalke) Pull request description: This reverts fafb55e2c2b257efd4e584f72adf62401c01d573, since the test is still too slow to run with asan enabled on a network hdd ACKs for commit fa08c5: jnewbery: utACK fa08c5cb993f07fd4309f2a6bd9ef4696f07e24c jonasschnelli: utACK fa08c5cb993f07fd4309f2a6bd9ef4696f07e24c Tree-SHA512: de16786b9d507a72210805c3e9eef360e5fc3d4bc3a81f7175b6cc70d1bc426cde7ac97bc0d1a0d4e0813067e1e251c2dd49256552cc6b52446b475251b7c32b
2019-05-03Add ChaCha20 benchJonas Schnelli
2019-05-03test_runner: Move pruning back to extendedMarcoFalke
2019-05-03refactoring: remove unused chainActiveJames O'Beirne
2019-05-03scripted-diff: replace chainActive -> ::ChainActive()James O'Beirne
Though at the moment ChainActive() simply references `g_chainstate.m_chain`, doing this change now clears the way for multiple chainstate usage and allows us to script the diff. -BEGIN VERIFY SCRIPT- git grep -l "chainActive" | grep -E '(h|cpp)$' | xargs sed -i '/chainActive =/b; /extern CChain& chainActive/b; s/\(::\)\{0,1\}chainActive/::ChainActive()/g' -END VERIFY SCRIPT-
2019-05-03refactoring: introduce unused ChainActive()James O'Beirne
in preparation for the following scripted-diff commit.
2019-05-03rename: CChainState.chainActive -> m_chainJames O'Beirne
This can't be a scripted-diff due to the confusion of the global chainActive and the CChainState member of the same name. This specific rename makes the following chainActive -> ::ChainActive() diff scriptable.
2019-05-03Add ChaCha20 encryption option (XOR)Jonas Schnelli
2019-05-03rpc: Deprecate getunconfirmedbalance and getwalletinfo balancesMarcoFalke
2019-05-03Remove Windows 32 bit buildMarcoFalke
2019-05-03[tests] Comment for why logging config is set as command-line args.John Newbery
2019-05-03Install bitcoin-wallet manpage.Daniel Kraft
This change marks the already-existing bitcoin-wallet.1 manpage file for installation together with the others. Previously, only bitcoind.1, bitcoin-cli.1, bitcoin-tx.1 and bitcoin-qt.1 would be installed.
2019-05-03Merge #15932: rpc: Serialize in getblock without cs_mainMarcoFalke
faea56400d rpc: Add lock annotations to block{,header}ToJSON (MarcoFalke) fab00a5cb9 rpc: Serialize in getblock without cs_main (MarcoFalke) fa1c3591ad rpc: Use IsValidNumArgs in getblock (MarcoFalke) Pull request description: No need to hold cs_main when serializing a struct to json Fixes: #15925 ACKs for commit faea56: jnewbery: utACK faea56400d5578023133cf4d1c761cdeb0c3e3da jonasschnelli: utACK faea56400d5578023133cf4d1c761cdeb0c3e3da Tree-SHA512: 005d378cda1e6024e9f5142f99a8adbefe202cd7bfeaafee55eb909e8990a3790aa27fcf5dd16119cc9afe9dc8bd30f660de40233316781669be166bac3018e7
2019-05-02Separate reason for premature spends (coinbase/locktime)Suhas Daftuar
2019-05-02Assert validation reasons are contextually correctSuhas Daftuar
2019-05-02[refactor] Update some comments in validation.cpp as we arent doing DoS thereMatt Corallo
2019-05-02[refactor] Drop unused state.DoS(), state.GetDoS(), state.CorruptionPossible()Matt Corallo
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2019-05-02scripted-diff: Remove DoS calls to CValidationStateMatt Corallo
-BEGIN VERIFY SCRIPT- sed -i 's/\.DoS(\(.*\), REJECT_\(.*\), \(true\|false\)/.DoS(\1, REJECT_\2/' src/validation.cpp src/consensus/tx_verify.cpp src/consensus/tx_check.cpp sed -i 's/state.GetRejectCode(), state.GetRejectReason(), [^,]\+, state.GetDebugMessage())/state.GetRejectCode(), state.GetRejectReason(), state.GetDebugMessage())/' src/validation.cpp sed -i 's/\.DoS([^,]*, /.Invalid\(/' src/validation.cpp src/consensus/tx_verify.cpp src/consensus/tx_check.cpp -END VERIFY SCRIPT- Co-authored-by: Suhas Daftuar <sdaftuar@gmail.com>
2019-05-02[refactor] Prep for scripted-diff by removing some \ns which annoy sed.Matt Corallo
2019-05-02Allow use of state.Invalid() for all reasonsMatt Corallo
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2019-05-02Fix handling of invalid headersSuhas Daftuar
We only disconnect outbound peers (excluding HB compact block peers and manual connections) when receiving a CACHED_INVALID header.
2019-05-02[refactor] Use Reasons directly instead of DoS codesMatt Corallo
2019-05-02CorruptionPossible -> BLOCK_MUTATEDMatt Corallo
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2019-05-02CorruptionPossible -> TX_WITNESS_MUTATEDMatt Corallo
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2019-05-02LookupBlockIndex -> CACHED_INVALIDMatt Corallo
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2019-05-02[refactor] Drop redundant nDoS, corruptionPossible, SetCorruptionPossibleMatt Corallo
Co-authored-by: Anthony Towns <aj@erisian.com.au>