aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-09-23Merge bitcoin/bitcoin#21526: validation: UpdateTip/CheckBlockIndex ↵W. J. van der Laan
assumeutxo support 673a5bd3377929a0a6a62eda8b560e47bc2cca0c test: validation: add unittest for UpdateTip behavior (James O'Beirne) 2705570109a2a90ecfd3f4180944498626fc2707 test: refactor: separate CreateBlock in TestChain100Setup (James O'Beirne) 298bf5d563cc740c6ae71750d86942e0278b22d6 test: refactor: declare NoMalleation const auto (James O'Beirne) 071200993f3a9412821ce5387851d659baf85327 move-only: unittest: add test/util/chainstate.h (James O'Beirne) 8f5710fd0ac5173b577e5d00708485170b321bcc validation: fix CheckBlockIndex for multiple chainstates (James O'Beirne) 5a807736dacfc3e6fa57231219336acf08be38fb validation: insert assumed-valid block index entries into candidates (James O'Beirne) 01a9b8fe719efab2c268dc738bc93cfbdf92edb7 validation: set BLOCK_ASSUMED_VALID during snapshot load (James O'Beirne) 42b2520db93fd9feb3df4101654391fa7d3e2140 chain: add BLOCK_ASSUMED_VALID for use with assumeutxo (James O'Beirne) b217020df78bc981d221fe04497c831120ef969f validation: change UpdateTip for multiple chainstates (James O'Beirne) 665072a36df2e4c88705fedd4ac7c955d7f6a488 doc: add comment for g_best_block (James O'Beirne) ac4051d891e2d5c8ac130da16b85b9d880b44720 refactor: remove unused assumeutxo methods (James O'Beirne) 9f6bb539359b98d5b39482ab8a28a68608f0c645 validation: add chainman ref to CChainState (James O'Beirne) Pull request description: This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11) (parent PR: #15606) --- Modify UpdateTip and CheckBlockIndex for use with multiple chainstates. Includes a new unittest verifying `g_best_block` behavior (previously untested at the unit level) and various changes necessary for running and testing `ProcessNewBlock()`-like behavior on the background validation chainstate. This changeset introduces a new block index `nStatus` flag called `BLOCK_ASSUMED_VALID`, and it is applied to block index entries that are beneath the UTXO snapshot base block upon snapshot load. Once each block is validated (during async background validation), the flag is removed. This allows us to avoid (ab)using `BLOCK_VALID_*` flags for snapshot chain block entries, and preserves the original meaning of those flags. Note: this PR previously incorporated changes to `LoadBlockIndex()` and `RewindBlockIndex()` as noted in Russ' comments below, but once I generated the changes necessary to test the UpdateTip change, I decided to split this changes out into another PR due to the size of this one. ACKs for top commit: achow101: ACK 673a5bd3377929a0a6a62eda8b560e47bc2cca0c jonatack: Code-review re-ACK 673a5bd3377929a0a6a62eda8b560e47bc2cca0c reviewed diff, rebased to master/debug build/ran unit+functional tests naumenkogs: ACK 673a5bd3377929a0a6a62eda8b560e47bc2cca0c fjahr: Code review ACK 673a5bd3377929a0a6a62eda8b560e47bc2cca0c ariard: utACK 673a5bd3 ryanofsky: Code review ACK 673a5bd3377929a0a6a62eda8b560e47bc2cca0c. Just linker fix and split commit changes mentioned https://github.com/bitcoin/bitcoin/pull/21526#issuecomment-921064563 since last review benthecarman: ACK 673a5bd3377929a0a6a62eda8b560e47bc2cca0c Tree-SHA512: 0a6dc23d041b27ed9fd0ee1f3e5971b92fb1d2df2fc9b655d5dc48594235321ab1798d06de2ec55482ac3966a9ed56de8d56e9e29cae75bbe8690bafc2dda383
2021-09-23Merge bitcoin/bitcoin#23057: log: Consolidate timedata loggingW. J. van der Laan
64e1ddd255771e57a88a20f07dbde04a83bf0c75 log: call LogPrint only once with time data samples (Martin Zumsande) Pull request description: When timedata samples are logged, `LogPrint()` is currently invoked multiple times on the same log entry. This can lead to chaos in the log when other threads log concurrently, as in this example which motivated this PR: ``` 2021-09-20T00:28:57Z -48  -26  -11  -8  -6  Addrman checks started: new 37053, tried 83, total 37136 2021-09-20T00:28:57Z -3  -1  -1  -1  -1  +0  |  nTimeOffset = -3  (+0 minutes) ``` Fix this by building the log message in a string and logging it one `LogPrint()` call. I also changed the wording slightly so that it becomes understandable what is being logged, example: ``` 2021-09-21T21:03:24Z time data samples: -43 -18 -12 -4 -1 -1 +0 +0 +268 | median offset = -1 (+0 minutes) ``` ACKs for top commit: jnewbery: Tested ACK 64e1ddd255 laanwj: Tested ACK 64e1ddd255771e57a88a20f07dbde04a83bf0c75, new message lgtm Tree-SHA512: ffb7a93166cc8fd6a39200b9e03a9d1e8e975b7ded822ccddd015f553258b991162a5cb867501f426d3ebcfef4f32f0e06e17b18e6b01486b967595d102f8379
2021-09-23Merge bitcoin/bitcoin#23072: log: Remove unnecessary timing of Callbacks benchmerge-script
ab278007991b912299eaf794d87a636423521d27 log: Remove unnecessary timing logs for Callbacks bench (Douglas Chimento) Pull request description: Logging of Callbacks are no longer needed and records times that are not relevant for performance analysis. resolves #23071 ACKs for top commit: laanwj: Thanks. re-ACK ab278007991b912299eaf794d87a636423521d27 jonatack: Code review ACK ab278007991b912299eaf794d87a636423521d27 Tree-SHA512: be1ea780c4db9407a8799065a8824b9d3610abac72af5907809ed62d493d5a54e65735de45ec5fdd0edb85ef21ec6036105abe8ca00093942980f6f92e7fec50
2021-09-23log: Remove unnecessary timing logs for Callbacks benchDouglas Chimento
Logging of Callbacks are no longer needed and records events that are not relevant for performance analysis.
2021-09-23Merge bitcoin/bitcoin#22855: RBF move 3/3: move followups + improve RBF ↵fanquake
documentation 0ef08f8bed537435f3f9db1e38b7d6f3551fe830 add missing includes in policy/rbf (glozow) c6abeb76fbb877f3f16d699c73a1828c7da2e6d1 make MAX_BIP125_RBF_SEQUENCE constexpr (glozow) 3cf46f6055f7cd2e5da81e0d29cafc51ad4aafba [doc] improve RBF documentation (glozow) c78eb8651b0949fefcafb22940512f4ef98d3358 [policy/refactor] pass in relay fee instead of using global (glozow) Pull request description: Followups to #22675 and documentation-only changes intended to clarify the code/logic concerning mempool Replace-by-Fee. ACKs for top commit: jnewbery: utACK 0ef08f8bed537435f3f9db1e38b7d6f3551fe830 fanquake: ACK 0ef08f8bed537435f3f9db1e38b7d6f3551fe830 Tree-SHA512: 6797ae758beca0c9673cb00ce85da48e9a4ac5cb5100074ca93e004cdb31d24d91a1a7721b57fc2f619addfeb4950d8caf45fee0f5b7528defbbd121eb4d271f
2021-09-23Merge bitcoin/bitcoin#23054: Use C++11 member initializer in CTxMemPoolEntryfanquake
fa08d4cfb1e3447a76093d46edc1c9de5ceee454 Use C++11 member initializer in CTxMemPoolEntry (MarcoFalke) Pull request description: This removes a bunch of boilerplate, makes the code easier to read. Also, C++11 member initialization avoids accidental uninitialized members. Can be reviewed with the git option "--word-diff-regex=." or with "git difftool --tool=meld". ACKs for top commit: jnewbery: Code review ACK fa08d4cfb1e3447a76093d46edc1c9de5ceee454 shaavan: Code Review ACK fa08d4cfb1e3447a76093d46edc1c9de5ceee454 Tree-SHA512: 2424861002fbcef2a3f01845662c115b973a7a5103f359305b5d9237c055eb003aa7646fc1cb30e6eaf90810d662f94cedc6f90795e30b56680f9c81f631d64b
2021-09-23Merge bitcoin/bitcoin#22798: doc: Fix RPC result documentationfanquake
fa10fbc6658fb8d87118cd550e4de406dca45f23 doc: Fix RPC result documentation (MarcoFalke) Pull request description: Fix: * Incorrectly named fields * Add missing ones * Add missing optional flag ACKs for top commit: fanquake: ACK fa10fbc6658fb8d87118cd550e4de406dca45f23 Tree-SHA512: 2b302e6f7ac8253a55882bc032ddda1932b728abddd12b0adb5fba814b12fb998a67b91e6dd124ebbe0ac16dccdace01332ade01c1dc00a3768647118dd3a2d2
2021-09-22log: call LogPrint only once with time data samplesMartin Zumsande
This prevents malformed log entries caused by other threads logging concurrently.
2021-09-22Merge bitcoin/bitcoin#23044: refactor: Remove unused validation includesmerge-script
fa45a1338adb127d69aee982920e29519bc1fed6 refactor: Remove unused validation includes (MarcoFalke) Pull request description: Unused includes will cause needless recompilation when headers are changed. Also, they pretend there are dependencies that don't exist. Fix both by removing them. ACKs for top commit: laanwj: Code review ACK fa45a1338adb127d69aee982920e29519bc1fed6 theStack: ACK fa45a1338adb127d69aee982920e29519bc1fed6 ♻️ Tree-SHA512: 69190fd09184b75bce34ce3f315a1817e09ea32779f9ddc2d4790c89b0887b6cebd88aba66fa054c43c9183fc66202a556d982dd7034fc389a75802d8aaac83a
2021-09-21Use C++11 member initializer in CTxMemPoolEntryMarcoFalke
This removes a bunch of boilerplate, makes the code easier to read. Also, C++11 member initialization avoids accidental uninitialized members. Can be reviewed with the git option "--word-diff-regex=." or with "git difftool --tool=meld".
2021-09-21doc: Fix RPC result documentationMarcoFalke
2021-09-21fuzz: Move all addrman fuzz targets to one fileMarcoFalke
Can be reviewed with --color-moved=dimmed-zebra
2021-09-21addrman: Replace assert with throw on corrupt dataMarcoFalke
Assert should only be used for program internal logic errors, not to sanitize external user input.
2021-09-21Refactor: Turn the internal addrman check helper into a forced checkMarcoFalke
2021-09-21move-only: Move CAddrMan::Check to cpp fileMarcoFalke
This speeds up compilation of the whole program because the included header file is smaller. Can be reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
2021-09-21Merge bitcoin/bitcoin#22831: test: add addpeeraddress "tried", test addrman ↵merge-script
checks on restart with asmap cdaab90662a54e331de0e49a89596bbb94a8ac45 Add test for addrman consistency check on restart with asmap (Jon Atack) 869f136816c6900ce84bc4b5a9c93c0deab85193 Add test for rpc addpeeraddress with "tried" argument (Jon Atack) ef242f52137f2a79a739447251d7759bd4705be0 Allow passing "tried" to rpc addpeeraddress to call CAddrMan::Good() (Jon Atack) Pull request description: This pull adds a `tried` argument to RPC addpeeraddress and a regression test for the recent addrman/asmap changes and issue. PR #22697 introduced a reproducible bug in commit 181a1207 that fails addrman consistency checks and causes it to significantly lose peer entries when the `-asmap` configuration option is used. The issue occurs upon bitcoind restart due to an initialization order change in `src/init.cpp` in that commit, whereby CAddrman asmap is set after deserializing `peers.dat`, rather than before. Issue reported on the `#bitcoin-core-dev` IRC channel starting at https://www.erisian.com.au/bitcoin-core-dev/log-2021-08-23.html#l-263. ``` addrman lost 22813 new and 2 tried addresses due to collisions or invalid addresses ADDRMAN CONSISTENCY CHECK FAILED!!! err=-17 bitcoind: ./addrman.h:707: void CAddrMan::Check() const: Assertion `false' failed. Aborted ``` How to reproduce: - `git checkout 181a1207`, build, and launch bitcoind with the `-asmap` and `-checkaddrman=1` configuration options enabled - restart bitcoind - bitcoind aborts on the second call to the addrman consistency checks in `CAddrMan::Check()` How to test this pull: - `git checkout 181a1207`, cherry pick the first commit of this branch, build, git checkout this branch, run `test/functional/rpc_net.py`, which should pass, and then run `test/functional/feature_asmap.py`, which should fail with the following output: ``` AssertionError: Unexpected stderr bitcoind: ./addrman.h:739: void CAddrMan::Check() const: Assertion `false' failed. ``` ACKs for top commit: jnewbery: utACK cdaab90662a54e331de0e49a89596bbb94a8ac45 mzumsande: re-ACK cdaab90662a54e331de0e49a89596bbb94a8ac45 (based on code review of diff to d586817) vasild: ACK cdaab90662a54e331de0e49a89596bbb94a8ac45 Tree-SHA512: 0251a18fea629b62486fc907d7ab0e96c6df6fadb9e4d62cff018bc681afb6ac31e0e7258809c0a88f91e4a36c4fb0b16ed294ce47ef30585217de89c3342399
2021-09-21Merge bitcoin/bitcoin#23050: log: change an incorrect fee to fee rate, and ↵merge-script
vice-versa c17f554fcc63e9e1f6ba64750df475d8a8d11f2e Fix BlockAssembler::AddToBlock, CTxMemPool::PrioritiseTransaction logging (Jon Atack) Pull request description: This is a tale of two fees, er, fee rates... indeed, one is misdescribed as a fee, and the other is incorrectly called a fee rate. From this review discussion: https://github.com/bitcoin/bitcoin/pull/22689#discussion_r695866211 (thanks to John Newbery). ACKs for top commit: laanwj: Code review ACK c17f554fcc63e9e1f6ba64750df475d8a8d11f2e Tree-SHA512: 3d9df3209a72562c5f9bbf815923d5b089d04491b8d19caa2c04158c501b47ef01e47f1c32d89adcbaf3c6357329507f65b4bb2963214c3451bbfa61ac812530
2021-09-21Merge bitcoin/bitcoin#23001: doc: Enable TLS in links in documentationfanquake
9bdda50151dd808cbad094d457bf0ed7939a7c87 Enable TLS in links in documentation (Jeremy Rand) Pull request description: This PR enables TLS in several documentation links, which improves security. ACKs for top commit: fanquake: ACK 9bdda50151dd808cbad094d457bf0ed7939a7c87 Tree-SHA512: 9d04d8771a9daf3c3b9914ff324e2eabfdf3ff5ae7f7dc92b84a1f3527010ceb860e73873a8f24d6051763eb472d9ea324ccbd6129a40318a520ca88c05f0586
2021-09-20Fix BlockAssembler::AddToBlock, CTxMemPool::PrioritiseTransaction loggingJon Atack
2021-09-20Merge bitcoin/bitcoin#22974: addrman: Improve performance of GoodW. J. van der Laan
57ce20307e604530f78ef4f0f8d9fb94f80ca81b fuzz: allow lower number of sources (Martin Zumsande) acf656d540a82e6fc30421590305cfe295eabbb5 fuzz: Use public interface to fill addrman tried tables (Martin Zumsande) eb2e113df13c7b1ede279878f5cbad877af49f8e addrman: Improve performance of Good (Martin Zumsande) Pull request description: Currently, `CAddrman::Good()` is rather slow because the process of moving an addr from new to tried involves looping over the new tables twice: 1) In `Good_()`, there is a loop searching for a new bucket the addr is currently in, but this information is never used except for aborting if it is not found anywhere (since [this commit](https://github.com/bitcoin/bitcoin/commit/e6b343d880f50d52390c5af8623afa15fcbc65a2#diff-49d1faa58beca1ee1509a247e0331bb91f8604e30a483a7b2dea813e6cea02e2R263) it is no longer passed to `MakeTried`) This is unnecessary because in a non-corrupted addrman, an address that is not in New must be either in Tried or not at all in addrman, both cases in which we'd return early in `Good_()` and never get to this point. I removed this loop (and left a check for `nRefCount` as a belt-and-suspenders check). 2) In `MakeTried()`, which is called from `Good_()`, another loop removes all instances of this address from new. This can be spedup by stopping the search at `nRefCount==0`. Further reductions in `nRefCount` would only lead to an assert anyway. Moreover, the search can be started at the bucket determined by the source of the addr for which `Good` was called, so that if it is present just once in New, no further buckets need to be checked. While calls to `Good()` are not that frequent normally, the performance gain is clearly seen in the fuzz target `addman_serdeser`, where, because of the slowness in creating a decently filled addrman, a shortcut was created that would directly populate the tried tables by reaching into addrman's internals, bypassing `Good()` (#21129). I removed this workaround in the second commit: Using `Good()` is still slower by a factor of 2 (down from a factor of ~60 before), but I think that this compensated by the advantages of not having to reach into the internal structures of addrman (see https://github.com/jnewbery/bitcoin/pull/18#issuecomment-775218676). [Edit]: For benchmark results see https://github.com/bitcoin/bitcoin/pull/22974#issuecomment-919435266 and https://github.com/bitcoin/bitcoin/pull/22974#issuecomment-920445700 - the benchmark `AddrManGood` shows a significant speedup by a factor >100. ACKs for top commit: naumenkogs: ACK 57ce20307e604530f78ef4f0f8d9fb94f80ca81b jnewbery: ACK 57ce20307e laanwj: Code review ACK 57ce20307e604530f78ef4f0f8d9fb94f80ca81b theStack: ACK 57ce20307e604530f78ef4f0f8d9fb94f80ca81b vasild: ACK 57ce20307e604530f78ef4f0f8d9fb94f80ca81b Tree-SHA512: fb6dfc198f2e28bdbb41cef9709828f22d83b4be0e640a3155ca42e771b6f58466de1468f54d773e794f780a79113f9f7d522032e87fdd75bdc4d99330445198
2021-09-20Merge bitcoin/bitcoin#12677: RPC: Add ancestor{count,size,fees} to ↵W. J. van der Laan
listunspent output 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 doc/release-notes: Add new listunspent fields (Luke Dashjr) 0be2f17ef5649c2d77efbbbdd9222332b2ebf0d2 QA: Add tests for listunspent ancestor{count,size,fees} to mempool_packages (Luke Dashjr) 6966e80f453c46d5d0a923118205f19ac2f4e336 RPC: Add ancestor{count,size,fees} to listunspent output (Luke Dashjr) 3f77dfdaf0f0bfe0c4662a616d6943f31bdd5bf4 Expose ancestorsize and ancestorfees via getTransactionAncestry (Luke Dashjr) Pull request description: Requested by a user ACKs for top commit: prayank23: reACK https://github.com/bitcoin/bitcoin/commit/6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 fjahr: Code review re-ACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 kiminuo: ACK [6cb60f3](https://github.com/bitcoin/bitcoin/commit/6cb60f3e6d652ffa4cf570426a7cf1f690d15c45) achow101: Code Review ACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 naumenkogs: ACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 darosior: utACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 Tree-SHA512: 5d16e5799558691e5853ab7ea2cc85514cb45da3ce69134d855c71845beef32ec6af5ab28d4462683e9800c8ea126f162773a9d3d5660edac08fd8edbfeda173
2021-09-20add missing includes in policy/rbfglozow
2021-09-20make MAX_BIP125_RBF_SEQUENCE constexprglozow
2021-09-20cli: Display all proxies in -getinfoklementtan
2021-09-20refactor: Remove unused validation includesMarcoFalke
2021-09-17Merge bitcoin/bitcoin#22896: refactor: net: avoid duplicate map lookups to ↵merge-script
`mapLocalHost` 330d3aa1a2c740dfa31bed3a6ed6b5f88e5426ad refactor: net: avoid duplicate map lookups to `mapLocalHost` (Sebastian Falbesoner) Pull request description: This simple refactoring PR aims to avoid duplicate lookups to `mapLocalHost`: instead of calling `count()` (to first find out whether a key is in the map) and then `operator[]` (to get the value to the passed key, or default-construct one if not found), use either * `find()` and dereference the returned iterator (for simple lookups), see https://www.cplusplus.com/reference/map/map/find/ * `emplace()` and use the returned <iterator, inserted> pair (for lookups where a new element should be inserted if the key isn't found), see https://www.cplusplus.com/reference/map/map/emplace/ ACKs for top commit: naumenkogs: ACK 330d3aa1a2c740dfa31bed3a6ed6b5f88e5426ad jonatack: Code review ACK 330d3aa1a2c740dfa31bed3a6ed6b5f88e5426ad plus rebase to master + debug build Tree-SHA512: d13da6a927ff561eee8ac6b093bf3586dfe31d6c94173a5a6d8f3698e0ee224fb394d3635155d5141c165da59d2c2c37260122eb4f2e8bcda3e8a29b901d213e
2021-09-17Merge bitcoin/bitcoin#22226: doc: add unittest core dump instructionsmerge-script
12313382e60c84f106127566d004c03384ca5abf doc: test: unittest segfault gdb (James O'Beirne) Pull request description: Quick note on how to get core dumps out of the unittests. ACKs for top commit: theStack: ACK 12313382e60c84f106127566d004c03384ca5abf Tree-SHA512: d749d9117f96af85f9053884c57df766ac1d29e57b2555d4fc63bd9dc29df47487954cee1c7cd78ee420ae1c9c7da7ddc9797b6c636ce7641eae20622eaa3fee
2021-09-17Merge bitcoin/bitcoin#22941: wallet: refactor: inline functions ↵fanquake
`{Read,Write}OrderPos` 98cf19ca32785c991628324c313e01349c2986af wallet: refactor: avoid duplicate lookup on `mapValue["timesmart"]` (Sebastian Falbesoner) 973d8ba93d0fa00bed4569287e32696300036ab8 wallet: refactor: inline function WriteOrderPos() (Sebastian Falbesoner) 65ed198295e58cf1bc339aa17349b83490872f70 wallet: refactor: inline function ReadOrderPos() (Sebastian Falbesoner) Pull request description: The functions `ReadOrderPos` and `WriteOrderPos` have been introduced in commit 9c7722b7c5ce49130bd978b932f73b629ce5cebe in 2012. Since accounts have been removed in #13825 (commit c9c32e6b844fc79467b7e24c6c916142a0d08484), they are only called at one place in `CWalletTx::{Serialize,Unserialize}` and thus can be directly inlined instead. Additionally, this PR aims to avoids duplicate lookups on the map `mapValue` (affects keys "n" and "timesmart"). ACKs for top commit: laanwj: Code review ACK 98cf19ca32785c991628324c313e01349c2986af achow101: Code Review ACK 98cf19ca32785c991628324c313e01349c2986af Tree-SHA512: 8af63c174c79e589bd713f04e8e40caba9f93ec2978c805427cac50d48049808a8c23ff5eea9ef589c9bd79fc66087f43ff5ab28e3cda51dd03f37c0164e2e4c
2021-09-16doc: test: unittest segfault gdbJames O'Beirne
Feedback from Jon Atack and Marco Falke.
2021-09-16Enable TLS in links in documentationJeremy Rand
2021-09-16RPC: Add ancestor{count,size,fees} to listunspent outputLuke Dashjr
2021-09-16Merge bitcoin/bitcoin#22626: Remove txindex migration codeW. J. van der Laan
fa20f815a9cb438c5ab61e97a453612ddd8b21b5 Remove txindex migration code (MarcoFalke) fae878603345854527c211ebb7d1967f12c8bb9d doc: Fix validation typo (MarcoFalke) fab89006d656261770503e54fdd01ac9167bdd49 Add missing includes and forward declarations, remove unused ones (MarcoFalke) Pull request description: No supported version of Bitcoin Core used the legacy txindex, so all relevant nodes can be assumed to have upgraded. Thus, there is no need to keep this code any longer. As a temporary courtesy, provide a one-time warning on how to free the disk space used by the legacy txindex. Fixes #22615 ACKs for top commit: laanwj: Code review ACK fa20f815a9cb438c5ab61e97a453612ddd8b21b5 hebasto: ACK fa20f815a9cb438c5ab61e97a453612ddd8b21b5, tested on Linux Mint 20.2 (x86_64). Zero-1729: crACK fa20f815a9cb438c5ab61e97a453612ddd8b21b5 theStack: Approach ACK fa20f815a9cb438c5ab61e97a453612ddd8b21b5 Tree-SHA512: 68aa32d064d1e3932e6e382816a4b5de417bd7e82861fea1ee50660e8c397f4efeb88ae4ed54a8ad1952c3563eb0b8449d7ccf883c353cc4d4dc7e15c53d78e8
2021-09-16Merge bitcoin/bitcoin#22930: build: remove glibc back compatW. J. van der Laan
76630cbfb9247a78c7760aa8dca62c6b599a0c7c doc: add glibc to dependencies.md (fanquake) a907704e7f0f1989e70b9b073c25b740e9d5003d compat: remove glibc_compat.cpp (fanquake) 62e45da94537ffaecc51441896242ef5123106a5 build: remove glibc-back-compat from build system (fanquake) 2ef0accefc1653ea0845683db8256dddf3b55e04 remove --enable-glibc-back-compat from CI and docs (fanquake) Pull request description: This removes our glibc backwards compatibility code (glibcxx sanity checks remain), which is [no-longer used for release builds](https://github.com/bitcoin/bitcoin/pull/22405). With these changes our minimum required glibc remains at 2.17, as Guix builds [are done with `--disable-thread-local`](https://github.com/bitcoin/bitcoin/blob/d2dd1697cee9d6d0f13f9cb351bce84eaa4a72b4/contrib/guix/libexec/build.sh#L242). Guix builds: ```bash d9024376ac06b836800b942fcbe8a6454866ded652e41c43d605255f840e8183 guix-build-76630cbfb924/output/aarch64-linux-gnu/SHA256SUMS.part bea9607f111b7a501e2410e59ccfca6f83ea075edb299d2f9b878860a4f1ad50 guix-build-76630cbfb924/output/aarch64-linux-gnu/bitcoin-76630cbfb924-aarch64-linux-gnu-debug.tar.gz b41d7eaec5b598f146ead32a40c0e2281d22138c02a7000fb154fe8ff341ab9d guix-build-76630cbfb924/output/aarch64-linux-gnu/bitcoin-76630cbfb924-aarch64-linux-gnu.tar.gz 9ec0e1b2cd4ca55d5c12354325d7c4552333f1bad7e620db247eb24e15500210 guix-build-76630cbfb924/output/arm-linux-gnueabihf/SHA256SUMS.part dbb3e92a3b7d6460e0d5319f49c91eb65593d8604807c1b3084c9d657b198271 guix-build-76630cbfb924/output/arm-linux-gnueabihf/bitcoin-76630cbfb924-arm-linux-gnueabihf-debug.tar.gz ff2fa70b01f92b9fba9f0216deebc3e511d84ff93a7316f6766a405160a20483 guix-build-76630cbfb924/output/arm-linux-gnueabihf/bitcoin-76630cbfb924-arm-linux-gnueabihf.tar.gz 486586b4f3e81855a52e5410127b92f6dde9d1eede2720de260b13552a4b4823 guix-build-76630cbfb924/output/dist-archive/bitcoin-76630cbfb924.tar.gz 466ccc848c39c0ca85c4575c2bfcd1bc7aba2caa5ba8a42147cce60be5120bf6 guix-build-76630cbfb924/output/powerpc64-linux-gnu/SHA256SUMS.part 4c739da127df3738e993dcef48ec8f005b7d7938060197c718e771cdd18c2087 guix-build-76630cbfb924/output/powerpc64-linux-gnu/bitcoin-76630cbfb924-powerpc64-linux-gnu-debug.tar.gz 2294fc23c170d63fc03085d56ba8653e3cf0cff15c8bd5680faa7b7552e1db07 guix-build-76630cbfb924/output/powerpc64-linux-gnu/bitcoin-76630cbfb924-powerpc64-linux-gnu.tar.gz 7be025478c51a1ba7884a7c2f090a1311651fc218d706051b1830cbc4e82ee4d guix-build-76630cbfb924/output/powerpc64le-linux-gnu/SHA256SUMS.part 30600ad6d9bfe70b68a2a4bedc733b56b26232a45d4491b1a6fa30b76cd3f690 guix-build-76630cbfb924/output/powerpc64le-linux-gnu/bitcoin-76630cbfb924-powerpc64le-linux-gnu-debug.tar.gz 70528805fae16b95d1df46011511ca1c2616fb89422c0164e30d02fa0193b6a1 guix-build-76630cbfb924/output/powerpc64le-linux-gnu/bitcoin-76630cbfb924-powerpc64le-linux-gnu.tar.gz 20f4daaa095803e9c34ed8b119f948e3e61d03b4d5814e4b15ca285c2ba5a109 guix-build-76630cbfb924/output/riscv64-linux-gnu/SHA256SUMS.part 6f969d6b6561ea87d1e54a3a643640da54e4e33d2470dbc607ad27f3a87a0f1d guix-build-76630cbfb924/output/riscv64-linux-gnu/bitcoin-76630cbfb924-riscv64-linux-gnu-debug.tar.gz 7c1e925d199d21781c96e9ee8d63d5eac995cbe2574ccedd81c0938531f694c1 guix-build-76630cbfb924/output/riscv64-linux-gnu/bitcoin-76630cbfb924-riscv64-linux-gnu.tar.gz d0f13a7a9fcd95669cbab3b637940c2014632405037959989768ec2ffa7fd861 guix-build-76630cbfb924/output/x86_64-apple-darwin18/SHA256SUMS.part ff23fbdd72fd42140bf11773866061cd5571b66d65bbd769b1345969d195b7ce guix-build-76630cbfb924/output/x86_64-apple-darwin18/bitcoin-76630cbfb924-osx-unsigned.dmg 1b51f4a7611b85d4f599291f42887643ddd59babfc6fb71284793123d8a6be33 guix-build-76630cbfb924/output/x86_64-apple-darwin18/bitcoin-76630cbfb924-osx-unsigned.tar.gz e0dc9be66c3dc9ba30c5224cf0499ef02b3b7e213081561a6d57d5cc76b3e9a7 guix-build-76630cbfb924/output/x86_64-apple-darwin18/bitcoin-76630cbfb924-osx64.tar.gz ae3fb0320a0f39dae48354fe74f3d071b16b33920b3b7b27244658439fdfbc93 guix-build-76630cbfb924/output/x86_64-linux-gnu/SHA256SUMS.part 9545ccf26a930a3f876058bb0c4965e1320a354ee2d9ce27d95f8bdd2e8679a6 guix-build-76630cbfb924/output/x86_64-linux-gnu/bitcoin-76630cbfb924-x86_64-linux-gnu-debug.tar.gz 4827206220eaa2b36ebb44b68035c6bda0cec0c2f1b27c08b8349f2f7b3f56d5 guix-build-76630cbfb924/output/x86_64-linux-gnu/bitcoin-76630cbfb924-x86_64-linux-gnu.tar.gz c2ad3ed62b2ac41a25a43e1c38869a588bf93853cae4502880adf0b66ce30369 guix-build-76630cbfb924/output/x86_64-w64-mingw32/SHA256SUMS.part a88ee3a0cb715d32cf12cb164d8fe4d9c4c810cc417426f3aacc4e7f08460271 guix-build-76630cbfb924/output/x86_64-w64-mingw32/bitcoin-76630cbfb924-win-unsigned.tar.gz 7673ac8df641d185ea7a150ed27eeee9645168e126d186c6ae935eefdff9edae guix-build-76630cbfb924/output/x86_64-w64-mingw32/bitcoin-76630cbfb924-win64-debug.zip b90d243d292d1b603d744639e5061917035bd8fba6acd0bb61f10479a200f5aa guix-build-76630cbfb924/output/x86_64-w64-mingw32/bitcoin-76630cbfb924-win64-setup-unsigned.exe fe69d000da647e0fb7ab19252149be4b45af742223b4c37630200b1d5b43de33 guix-build-76630cbfb924/output/x86_64-w64-mingw32/bitcoin-76630cbfb924-win64.zip ``` ACKs for top commit: laanwj: Code review ACK 76630cbfb9247a78c7760aa8dca62c6b599a0c7c Tree-SHA512: 6bd1e344f0f37cfb0017fb8b2b0eee41c6a043f23f8ccb2ad1d59e7f2a47f4b84fe431d7d059c409b63263a0af38be955961c4b2ba7b03538f77a0597abb7880
2021-09-16Merge bitcoin/bitcoin#22544: cli -addrinfo: drop torv2; torv3 becomes onion ↵W. J. van der Laan
per GetNetworkName() 49d503aefa74f11e5d93432987fa3775ed82c979 doc: update -addrinfo in release-notes.md and tor.md (Jon Atack) 75ea9ecf11bfeb120c58dc6c62539021a94ef97c cli -addrinfo: drop torv2, torv3 becomes onion per GetNetworkName() (Jon Atack) Pull request description: #22050 removed torv2 support from 22.0. For 23.0 and subsequent releases, we can probably remove torv2 from -addrinfo. before ``` "addresses_known": { "ipv4": 58305, "ipv6": 5138, "torv2": 0, "torv3": 5441, "i2p": 14, "total": 68898 } ``` after ``` "addresses_known": { "ipv4": 58305, "ipv6": 5138, "onion": 5441, "i2p": 14, "total": 68898 } ``` Per the naming of `netbase.{h, cpp}::GetNetworkName()`, torv3 becomes onion, which is what is printed in the output of getpeerinfo, getnetworkinfo and getnodeaddresses. ACKs for top commit: practicalswift: cr ACK 49d503aefa74f11e5d93432987fa3775ed82c979 Zero-1729: tACK 49d503aefa74f11e5d93432987fa3775ed82c979 🧉 klementtan: Code review and tested ACK 49d503aefa74f11e5d93432987fa3775ed82c979 Tree-SHA512: bca52520d8b12c26f1c329d661b9e22c567954ed2af7d2a16d7669eae1a221eada20944f8b2f4e78e31a7190d5f3d3fbfd37509e5edf2d9a3747a0a8f4e375bb
2021-09-16Merge bitcoin/bitcoin#22895: consensus: don't call GetBlockPos in ↵W. J. van der Laan
ReadBlockFromDisk without cs_main lock 350e034e64d175f3db4c85ddca42e76e279912f6 consensus: don't call GetBlockPos in ReadBlockFromDisk without lock (Jon Atack) Pull request description: Commit ccd8ef65 "Reduce cs_main lock in ReadBlockFromDisk, only read GetBlockPos under the lock" in #11281 moved the cs_main lock from caller to `ReadBlockFromDisk()` for calling `CBlockIndex::GetBlockPos()`, but the second invocation doesn't have the lock, and IIUC there is no guarantee the compiler can know if state has changed. Use the `blockPos` local variable instead, rename it to `block_pos`, and make it const. ACKs for top commit: laanwj: Code review ACK 350e034e64d175f3db4c85ddca42e76e279912f6 theStack: Code-review ACK 350e034e64d175f3db4c85ddca42e76e279912f6 promag: Code review ACK 350e034e64d175f3db4c85ddca42e76e279912f6. Tree-SHA512: 0df0614ab1876885c85f7b53c604a759a29008da8027e95503b4726d2b820ec6d27546020c613337ff954406e01cb5d191978ba4a12124052fed6e1b0e9a226f
2021-09-16Merge bitcoin/bitcoin#22955: p2p: Rename fBlocksOnly, Add testW. J. van der Laan
fa66a7d732f9fd60d72f22087f0d5aadf3064bfb p2p: Rename fBlocksOnly, Add test (MarcoFalke) fac66d0a39cb0b4bc565b57087ba84dd932e9b6d test: Simplify p2p_blocksonly test with new miniwallet rescan_utxos method (MarcoFalke) Pull request description: `fBlocksOnly` has several issues: * The name is confusing * It is untested Fix both. ACKs for top commit: laanwj: Code review ACK fa66a7d732f9fd60d72f22087f0d5aadf3064bfb Tree-SHA512: 4218f455eeb37297f74603d7d44895288605844ae828a40dfb7a70215f1a058ac5ad945a22732f5ebcad3ad375d54ba360bea69ea79639a30d4c88b042448f0f
2021-09-16Merge bitcoin/bitcoin#22995: doc: Remove stale comment for CPrivKeyW. J. van der Laan
5008dd87b2c9a8eeee21f2a11367a7ada9c324ed doc: Remove stale comment for CPrivKey (Calvin Kim) Pull request description: Removes stale doc about `secure_allocator` being defined in `allocators.h`. ACKs for top commit: laanwj: ACK 5008dd87b2c9a8eeee21f2a11367a7ada9c324ed theStack: Code-review ACK 5008dd87b2c9a8eeee21f2a11367a7ada9c324ed Tree-SHA512: eb65aff6db5b27d0db2b86f1d1dc6e066daccdaf00f7f9f95b5bee507167fcea2601316cdbd70da4ba32f1fab1e28e440a7e3cabd7b1a72c07dd20b1367361f0
2021-09-16doc: Remove stale comment for CPrivKeyCalvin Kim
2021-09-16Merge bitcoin/bitcoin#22952: Cleanup headers after #20788merge-script
317442525586ba9ff8b9af6c506b48f87cd8cd87 Cleanup headers after #20788 (Hennadii Stepanov) Pull request description: This is a header cleanup after #20788. ACKs for top commit: vasild: ACK 317442525586ba9ff8b9af6c506b48f87cd8cd87 Tree-SHA512: 1c21b1ba43841880625289174f10e5b333f6eb857f448e1e4114b1ecdf32a6044ec91c5987c1d66806c1d408a4e3d46569eb41d69a0acb8296601d7c203d9f1d
2021-09-15Fix Qt test broken by #22219Russell Yanofsky
It looks like this should have been caught by CI but perhaps there was a conflict with a recently merged PR. Failure reported by fanquake <fanquake@gmail.com> https://github.com/bitcoin/bitcoin/pull/22219#issuecomment-920496509
2021-09-16Merge bitcoin/bitcoin#22979: doc: Fix walletdisplayaddress RPC docfanquake
fa22ddc7d570feda649bedebeacd42a3b67ce24c doc: Fix walletdisplayaddress RPC doc (MarcoFalke) Pull request description: Previously the description was empty ACKs for top commit: fanquake: ACK fa22ddc7d570feda649bedebeacd42a3b67ce24c Tree-SHA512: f8898f9545378dd9f68eba036745776c1bc8d43c4753a19fcd9c3d945a11d9e07cd394d9ed215c2d090964830f785f812f18608f04fc7e2fb73730fc77c5d807
2021-09-16Merge bitcoin/bitcoin#22219: multiprocess: Start using init makeNode, ↵fanquake
makeChain, etc methods e4709c7b56612553fb7cbf16ef2d5099c5b732d0 Start using init makeNode, makeChain, etc methods (Russell Yanofsky) Pull request description: Use `interfaces::Init::make*` methods instead of `interfaces::Make*` functions, so interfaces can be constructed differently in different executable without having to change any code. (So for example `bitcoin-gui` can make an `interfaces::Node` pointer that communicates with a `bitcoin-node` subprocess, while `bitcoin-qt` can make an `interfaces::Node` pointer that controls node code in the same process.) --- This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). The commit was first part of larger PR #10102. ACKs for top commit: jamesob: reACK https://github.com/bitcoin/bitcoin/commit/e4709c7b56612553fb7cbf16ef2d5099c5b732d0 achow101: ACK e4709c7b56612553fb7cbf16ef2d5099c5b732d0 benthecarman: utACK e4709c7b56612553fb7cbf16ef2d5099c5b732d0 Tree-SHA512: 580c1979dbb2ef444157c8e53041e70d15ddeee77e5cbdb34f70b6d228cc2d2fe3843825f172da84e506200c58f7e0932f7cd4c006bb5058c1f4e43259394834
2021-09-16fuzz: allow lower number of sourcesMartin Zumsande
2021-09-16fuzz: Use public interface to fill addrman tried tablesMartin Zumsande
After the performance improvement for Good(), the direct method is only 2x faster as opposed to 60x before.
2021-09-16addrman: Improve performance of GoodMartin Zumsande
This is done by removing an unnecessary loop in Good_() and looping through the new tables in MakeTried() more efficiently, choosing a starting value that allow us to stop early in typical cases. Co-authored-by: John Newbery <john@johnnewbery.com>
2021-09-15test: validation: add unittest for UpdateTip behaviorJames O'Beirne
2021-09-15test: refactor: separate CreateBlock in TestChain100SetupJames O'Beirne
This is so we can create blocks within unittests and have them be processed by specific chainstates (instead of the just the active one).
2021-09-15test: refactor: declare NoMalleation const autoJames O'Beirne
To avoid linker error on some platforms: https://github.com/bitcoin/bitcoin/pull/21526#discussion_r709404714 Co-authored-by: Russ Yanofsky <russ@yanofsky.org>
2021-09-15move-only: unittest: add test/util/chainstate.hJames O'Beirne
and move `CreateAndActivateUTXOSnapshot()` into it for reuse in future test modules.
2021-09-15validation: fix CheckBlockIndex for multiple chainstatesJames O'Beirne
Adjust CheckBlockIndex to account for - assumed-valid block indexes lacking transaction data, and - setBlockIndexCandidates for the background chainstate not containing certain entries which rely on assumed-valid ancestors.