aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-08-05test: Set regtest.BIP66Height = 102 to speed up testsMarcoFalke
2021-08-05test: Add missing includeMarcoFalke
2021-08-05Merge bitcoin/bitcoin#22277: test: Properly set BIP34 height in ↡MarcoFalke
CreateNewBlock_validity unit test faa670d3862783017f5cd1491f37648e1875f19f test: Properly set BIP34 height in CreateNewBlock_validity unit test (MarcoFalke) Pull request description: The coinbase scriptSig in this unit test has several issues: * The BIP34 height is not the "first item" as required (See https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki#specification) * It uses the wrong encoding ( See https://github.com/bitcoin/bitcoin/blob/da69d9965a112c6421fce5649b5a18beb7513526/src/validation.cpp#L3250 ) * It uses the wrong height (off by one) While BIP34 isn't currently enforced in this unit test, this should be fixed to avoid confusion and to promote self-consistency. The change obviously requires new proof of work (`BLOCKINFO`). Also change the block version from `1` to `VERSIONBITS_TOP_BITS`, because this test shouldn't care about the block version and bumping it is required for other changes. ACKs for top commit: theStack: Code review ACK faa670d3862783017f5cd1491f37648e1875f19f Tree-SHA512: 8dbe2d5300a640f3e1817ff048906e60463aca64ba50fec8ee4f18fb1c70e511008755b0b5baba81114a1a6265fdfae9a4b7ae8acadfb2c7ad43223157a0386c
2021-08-05Merge bitcoin/bitcoin#22618: [p2p] Small follow-ups to 21528MarcoFalke
9778b0fec13c047a4c7f3ae425d044da26eadc81 [net_processing] Provide debug error if code assumptions change. (Amiti Uttarwar) aa79c912608fdc77c69dd43653aa87f1f34e01dd [docs] Add release notes for #21528 (Amiti Uttarwar) Pull request description: Adds a release note & addresses [this](https://github.com/bitcoin/bitcoin/pull/21528#discussion_r680963101) review comment to make expectations more explicit. ACKs for top commit: Zero-1729: re-ACK 9778b0fec13c047a4c7f3ae425d044da26eadc81 jonatack: ACK 9778b0fec13c047a4c7f3ae425d044da26eadc81 Tree-SHA512: 9507df5f2746d05c6df8c86b7a19364610ebfafc81af7650be7e68d7536a0685cce9fd2e5f287ef92b6245c584f8875b24a958109ba5bd8acf3c8fc9fd19eef2
2021-08-05Merge bitcoin-core/gui#393: Fix regression in "Encrypt Wallet" menu itemHennadii Stepanov
d54d94959869b0c363939163b99ba0475751dcb6 qt: Fix regression in "Encrypt Wallet" menu item (Hennadii Stepanov) Pull request description: Fix #392. Adding a new item to the `m_wallet_selector` must follow the establishment of a connection between the `WalletView::encryptionStatusChanged` signal and the `BitcoinGUI::updateWalletStatus` slot. This was a regression introduced in https://github.com/bitcoin/bitcoin/commit/20e2e24e90d782219e853ef0676ac66dc6a9de6a (#29). --- An _encrypted_ wallet being auto-loaded at the GUI startup: - on master (eaf09bda4ab21f79f89822d2c6fa3d7a3ce57b0d) ![Screenshot from 2021-08-03 22-38-49](https://user-images.githubusercontent.com/32963518/128075837-cdbb2047-5327-43ea-b2d5-2dcdef67cdc0.png) - with this PR ![Screenshot from 2021-08-03 22-34-58](https://user-images.githubusercontent.com/32963518/128075572-cb727652-ad44-4b85-bf64-edcd19f9dea1.png) ACKs for top commit: achow101: ACK d54d94959869b0c363939163b99ba0475751dcb6 jarolrod: ACK d54d94959869b0c363939163b99ba0475751dcb6 Tree-SHA512: 669615ec8e1517c2f4cdf59bd11a7c85be793ba0dda112361cf95e6c2f0636215fed331d26a86dc9b779a49defae1b248232f98dab449584376c111c288e87bb
2021-08-05Merge bitcoin-core/gui#337: test: Use Regex Search in ApptestsHennadii Stepanov
6969b2bb98a2f44e1b51c905db92ec2e28345078 qt, test: use regex search in apptests (Jarol Rodriguez) d09d1cf1a267b1c5563d8876aa55c4e8f70f0562 qt, test: introduce FindInConsole function (Jarol Rodriguez) Pull request description: This PR refactors our GUI `apptests` so that it uses regex search to find values in our console/qtextedit output regardless if it is in `plaintext`, `html`, or `markdown`. This introduces a new function `FindInConsole` which uses [QRegularExpression](https://doc.qt.io/qt-5/qregularexpression.html) to search the output of the console. The function must be provided with a [perl compatible regex](https://www.debuggex.com/cheatsheet/regex/pcre) pattern which wants to match a single group. The function then returns the matched group. If no match is found, an empty `QString` is returned. We then use this new function in `TestRpcCommand` to find the current `chain` value instead of reading with univalue. This approach can apply to a wider variety of testing scenarios as we can reuse this function to search for values when the console output is exported in a different format than `plaintext`. As an example, A follow up PR will add tests for console resizing and needs to look for the size in `html` tags after exporting the console text with `toHtml()`. ACKs for top commit: hebasto: ACK 6969b2bb98a2f44e1b51c905db92ec2e28345078 ShaMan239: ACK 6969b2bb98a2f44e1b51c905db92ec2e28345078 Tree-SHA512: 4db8bcd4a1acc4539ca64bbd7de572fe7dd6afc3e95108235abfc2891585bc4db3a56a33928fa38e8d44ac87023ce0dee3abcfadfbcd4440e3a21a52fef02536
2021-08-04[net_processing] Provide debug error if code assumptions change.Amiti Uttarwar
Currently, this call to SetupAddressRelay will never return false because of the previous guard that returns early if the peer is not an inbound connection. Rather than implicitly relying on this guarantee, throw an error in the debug build if it ever changes.
2021-08-04[docs] Add release notes for #21528Amiti Uttarwar
And fix a typo in the test.
2021-08-04Merge bitcoin/bitcoin#22621: make ParseOutputType return a ↡MarcoFalke
std::optional<OutputType> 32fa49a18497a9b8c72e36a72ae96e7b23930223 make ParseOutputType return a std::optional<OutputType> (fanquake) Pull request description: Similar to #22220. Skipped using `auto` here for the same reasons outlined in that PR. ACKs for top commit: jnewbery: utACK 32fa49a18497a9b8c72e36a72ae96e7b23930223 jonatack: Code review ACK 32fa49a18497a9b8c72e36a72ae96e7b23930223 and debian clang 13 debug build is clean / unit tests locally are green MarcoFalke: review ACK 32fa49a18497a9b8c72e36a72ae96e7b23930223 🍒 Tree-SHA512: 7752193117669b800889226185d49d164395697853828f8acb568f07651789bc5b2cddc45555957450353886e46b9a1e13c77a5e730a14c6ee621fabc8dc3d10
2021-08-04Merge bitcoin/bitcoin#22616: p2p, rpc: address relay fixupsMarcoFalke
5e33f762d44557a1e3f0ff3c280d8a3ab98e3867 p2p, rpc: address relay fixups (Jon Atack) Pull request description: Following review of new changes merged today, move a use of `statestats` in getpeerinfo to within the section guarded by `if (fStateStats)`, e.g. `PeerManagerImpl::GetNodeStateStats` true, and pass an in-param by reference to const. ACKs for top commit: amitiuttarwar: ACK 5e33f762d4 jnewbery: ACK 5e33f762d44557a1e3f0ff3c280d8a3ab98e3867 Tree-SHA512: b42f33c615b14079e2c4e6060209de8707d71b351dd1e11e04a2a6fc12d15747d0c5d9b24850217080fd1ef92e63f96d6925c4badf280b781edd696c349be7d6
2021-08-04Merge bitcoin/bitcoin#22577: Close minor startup race between main and ↡MarcoFalke
scheduler threads 703b1e612a4bd4521e20ae21eb8fb7c19f4ef942 Close minor startup race between main and scheduler threads (Larry Ruane) Pull request description: This is a low-priority bug fix. The scheduler thread runs `CheckForStaleTipAndEvictPeers()` every 45 seconds (EXTRA_PEER_CHECK_INTERVAL). If its first run happens before the active chain is set up (`CChain::SetTip()`), `bitcoind` will assert: ``` (...) 2021-07-28T22:16:49Z init message: Loading block index… bitcoind: validation.cpp:4968: CChainState& ChainstateManager::ActiveChainstate() const: Assertion `m_active_chainstate' failed. Aborted (core dumped) ``` I ran into this while using the debugger to investigate an unrelated problem. Single-stepping through threads with a debugger can cause the relative thread execution timing to be very different than usual. I don't think any automated tests are needed for this PR. I'll give reproduction steps in the next PR comment. ACKs for top commit: MarcoFalke: cr ACK 703b1e612a4bd4521e20ae21eb8fb7c19f4ef942 tryphe: tested ACK 703b1e612a4bd4521e20ae21eb8fb7c19f4ef942 0xB10C: ACK 703b1e612a4bd4521e20ae21eb8fb7c19f4ef942 glozow: code review ACK 703b1e612a4bd4521e20ae21eb8fb7c19f4ef942 - it makes sense to me to start peerman's background tasks here, after `chainstate->LoadChainTip()` and `node.connman->Start()` have been called. Tree-SHA512: 9316ad768cba3b171f62e2eb400e3790af66c47d1886d7965edb38d9710fc8c8f8e4fb38232811c9346732ce311d39f740c5c2aaf5f6ca390ddc48c51a8d633b
2021-08-04make ParseOutputType return a std::optional<OutputType>fanquake
2021-08-04Merge bitcoin/bitcoin#22576: doc: Update high-level addrman descriptionfanquake
036d7eadf5dd0e06e0734a5d78dbe28f4bfaa07f doc: Correct description of CAddrMan::Create() (Amiti Uttarwar) 318176aff1ded36d1fbc5977f288ac3bac1d8712 doc: Update high-level addrman description (Martin Zumsande) Pull request description: The high-level description of `addrman` has outdated information with respect to the eviction behavior, both for the New and Tried tables (at least since #5941) - this has confused me in the past. This PR corrects this and also adds basic info about the bucket size and position. ACKs for top commit: amitiuttarwar: reACK 036d7eadf5dd0e06e0734a5d78dbe28f4bfaa07f jnewbery: ACK 036d7eadf5dd0e06e0734a5d78dbe28f4bfaa07f Tree-SHA512: 3f0635d765f5e580a1fae31187742a833cef66ef2286d40eeb28f2253521260038e16e5f1a65741464a2ddfdbeb5c0f1bc38bf73841e600639033d59c3c534e4
2021-08-03qt: Fix regression in "Encrypt Wallet" menu itemHennadii Stepanov
Adding a new item to the m_wallet_selector must follow the establishment of signal-slot connections.
2021-08-03Merge bitcoin/bitcoin#22609: [GetTransaction] remove unneeded cs_main lock ↡fanquake
acquire 4a1b2a7ba7f804e656a8cd29d5aa80fcbd40904f [GetTransaction] remove unneeded `cs_main` lock acquire (Sebastian Falbesoner) Pull request description: This PR is a follow-up to #22383. For reading from the mempool, only `mempool.cs` needs to be locked (see [suggestion by MarcoFalke](https://github.com/bitcoin/bitcoin/pull/22383#discussion_r675069128)): https://github.com/bitcoin/bitcoin/blob/b620b2d58a55a88ad21da70cb2000863ef17b651/src/txmempool.h#L554-L558 `CTxMemPool::get()` acquires this lock: https://github.com/bitcoin/bitcoin/blob/b620b2d58a55a88ad21da70cb2000863ef17b651/src/txmempool.cpp#L822-L829 so we don't need to acquire any lock ourselves in `GetTransaction()`, as the other functions called in the remaining parts also don't need to have `cs_main` locked. ACKs for top commit: tryphe: Concept ACK. tested 4a1b2a7ba7f804e656a8cd29d5aa80fcbd40904f but not extensively. jnewbery: Code review ACK 4a1b2a7ba7f804e656a8cd29d5aa80fcbd40904f Tree-SHA512: 60e869f72e65cf72cb144be1900ea7f3d87c12f322756994f6a3ed8cd975230b36c7c90c34b60bbf41f9186f4add36decaac1d4f0d0749fb5451b3938a8aa78c
2021-08-03Merge bitcoin/bitcoin#22597: consensus/params: simplify ValidDeployment ↡MarcoFalke
check to avoid gcc warning 059171009b0138555f311cedc2553015ff618323 consensus/params: simplify ValidDeployment check to avoid gcc warning (Anthony Towns) Pull request description: Simplifies the ValidDeployment check to only check the upperbound, relying on the lower bound to be trivially true due to enum values starting at the minimum value of the underlying type (which is checked at compile time in deploymentstatus.cpp). Avoids a "comparison always true" warning in some versions of gcc. Fixes #22587 ACKs for top commit: MarcoFalke: review ACK 059171009b0138555f311cedc2553015ff618323 tryphe: retested ACK 059171009b0138555f311cedc2553015ff618323 Tree-SHA512: e53b5d478b46d35ec476d004e3c92803afb874c138dd6ef3848861f4281cc113fe88921bc4ac74fd4decbf318ed776d3f816c3a1185f99dc36a5cfecfff51f7c
2021-08-03p2p, rpc: address relay fixupsJon Atack
2021-08-03Merge bitcoin/bitcoin#16333: test: Set BIP34Height = 2 for regtestMarcoFalke
222290f54388270937cb6c174195717e2214ec0d test: Set BIP34Height = 2 for regtest (MarcoFalke) fac90c55be478f0323eafa1d560ea2c56f04fb23 test: Create all blocks with version 4 or higher (MarcoFalke) Pull request description: BIP34 is active on the current tip of mainnet, so all miners must obey it. It would be nice if it also was active in fresh regtest instances from the earliest time possible. I changed the BIP34 height to `2`, so that the block at height=1 may be used to mine a duplicate coinbase. (Needed to test mainnet behaviour) This pull is done in two commits: * test: Create all blocks with version 4 or higher: Now that BIP34 is activated earlier, we need to create blocks with a higher version number. Just bump it to 4 instead of 2 to avoid having to bump it again later. * test: Set BIP34Height = 2 for regtest: This fixes the BIP34 implementation in the tests (to match the one of the Core codebase) and updates the tests where needed ACKs for top commit: ajtowns: ACK 222290f54388270937cb6c174195717e2214ec0d jonatack: ACK 222290f54388270937cb6c174195717e2214ec0d tested and reviewed rebased to current master 5e213822f86d theStack: Tested ACK 222290f54388270937cb6c174195717e2214ec0d Tree-SHA512: d69c637a62a64b8e87de8c7f0b305823d8f4d115c1852514b923625dbbcf9a4854b5bb3771ff41702ebf47c4c182a4442c6d7c0b9f282c95a34b83e56a73939b
2021-08-03Merge bitcoin/bitcoin#22496: addrman: Remove addrman hotfixesfanquake
65332b1178c75e1f83415bad24918996a1524866 [addrman] Remove RemoveInvalid() (John Newbery) Pull request description: PRs #22179 and #22112 (EDIT: later reverted in #22497) added hotfix code to addrman to remove invalid addresses and mutate the ports of I2P entries after entering into addrman. Those hotfixes included at least two addrman data corruption bugs: - #22467 (Assertion `nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size()' failed) - #22470 (Changing I2P ports in addrman may wronly skip some entries from "new" buckets) Hotfixing addrman is inherently dangerous. There are many members that have implicit assumptions on each others' state, and mutating those directly can lead to violating addrman's internal invariants. Instead of trying to hotfix addrman, just don't insert any invalid addresses. For now, those are addresses which fail `CNetAddr::IsValid()`. ACKs for top commit: sipa: utACK 65332b1178c75e1f83415bad24918996a1524866. I tried to reason through scenarios that could introduce inconsistencies with this code, but can't find any. fanquake: ACK 65332b1178c75e1f83415bad24918996a1524866 - Skipping the addition of invalid addresses (this code was initially added for Tor addrs) rather than adding all the invalids then removing them all when finishing unserializing seems like an improvement. Especially if it can be achieved with less code. Tree-SHA512: 023113764cb475572f15da7bf9824b62b79e10a7e359af2eee59017df354348d2aeed88de0fd4ad7a9f89a0dad10827f99d70af6f1cb20abb0eca2714689c8d7
2021-08-03Merge bitcoin/bitcoin#22448: Update libsecp256k1 subtree to latest upstreamfanquake
c020cbaa5c8e9e61b2b8efd8dc09be743fcd4273 Squashed 'src/secp256k1/' changes from efad3506a8..be8d9c262f (Pieter Wuille) Pull request description: This updates our src/secp256k1 subtree to the lastest upstream master. Notable changes: * New schnorrsig API (https://github.com/bitcoin-core/secp256k1/pull/844), which adds support for variable-length messages (not used in BIP341/342 transaction signing, so not relevant for us, but it changes the API, and makes some other simplifications). Some of our call sites had to be adapted. * Don't use asm optimizations for `gen_context` (https://github.com/bitcoin-core/secp256k1/pull/965). This fixes #22441. * Various testing/CI improvements ACKs for top commit: hebasto: ACK e4ffb44716bb7a7b9f0a5d70ac07058632234370 jonatack: Light ACK e4ffb44716bb7a7b9f0a5d70ac07058632234370 debug built (debian clang 13.0), ran bitcoind node/tests/git-subtree-check.sh, lightly reviewed the diff and API changes fanquake: ACK e4ffb44716bb7a7b9f0a5d70ac07058632234370 Tree-SHA512: 89a5c3019ec010d578e84bcef756d2c679420c5c768bcdece673405c4e10955179c5a1339aafc68b8b74b1e3912e147bf2f392f44f15af73791d93f6537960b3
2021-08-03Merge bitcoin/bitcoin#22098: [test, init] DNS seed querying logicfanquake
82b6f89819e55af26f5264678e0f93052934bcb3 [style] Small style improvements to DNS parameters (Amiti Uttarwar) 4c89e24f64c1dc1a56a3bcb6b5e2b4fb95e8b29f [test] Test the delay before querying DNS seeds (Amiti Uttarwar) 6395c8ed5689ea72e9a1618f14551775246f6361 [test] Test the interactions between -forcednsseed and -dnsseed (Amiti Uttarwar) 6f6b7df6bdcf863af160c0426e3a22028ca8259a [init] Disallow starting up with conflicting paramters for -dnsseed and -forcednsseed (Amiti Uttarwar) 26d0ffe4f2573e0297c9b0e095c2a0868929b08b [test] Test -forcednsseed causes querying DNS seeds (Amiti Uttarwar) 35851450a928ffacca240fadbf1747a42d5ba256 [test] Test the interactions between -connect and -dnsseed (Amiti Uttarwar) 75c05af361552eeecd100cee8cc40d4cd5a3aa27 [test] Test logic to query DNS seeds with block-relay-only connections (Amiti Uttarwar) 9c0871977839c28636eff975748182888299cd2b [test] Introduce test logic to query DNS seeds (Amiti Uttarwar) Pull request description: This PR adds a DNS seed to the regtest chain params to enable testing the DNS seed querying logic of `CConnman::ThreadDNSAddressSeed` and relevant startup parameters. Adds coverage for the changes in #22013 (and then some). The main behavioral change to bitcoind is that this PR disallows starting up with conflicting parameters for `-dnsseed` and `-forcednsseed`. The tests include: * parameter interactions of different combinations of `-connect`, `-dnsseed` and `-forcednsseed` * the delay before querying DNS seeds depending on how many addresses are in the addrman * the behavior of `-forcednsseed` * skipping DNS querying if we have outbound full relay connections & not block-relay-only connections Huge props to mzumsande for identifying the timing technique for testing successful connections before running `ThreadDNSAddressSeed` πŸ™ŒπŸ½ ACKs for top commit: mzumsande: ACK 82b6f89819e55af26f5264678e0f93052934bcb3 jnewbery: reACK 82b6f89819e55af26f5264678e0f93052934bcb3 Tree-SHA512: 9f0c29bfbf99426727e79c0a25606ae09deab91a92e3c5cee7f84c3ca7503a8ac9ab85a85c51841d40b164ef8c991326070f0b2f41d075fb7985df26f6e95d6d
2021-08-03Merge bitcoin/bitcoin#21528: [p2p] Reduce addr blackholesfanquake
3f7250b328b8b2f5d63f323702445ac5c989b73d [test] Use the new endpoint to improve tests (Amiti Uttarwar) 3893da06db1eb622f540605700f8663f8d87b2df [RPC] Add field to getpeerinfo to indicate if addr relay is enabled (Amiti Uttarwar) 0980ca78cd930a00c9985d7f00083a3b8e8be89e [test] Test that we intentionally select addr relay peers. (Amiti Uttarwar) c061599e40dc3d379c10b914765061a7a8449dd7 [net_processing] Remove RelayAddrsWithPeer function (Amiti Uttarwar) 201e4964816f8896cfe7b4f6d8ddbfffe7102f87 [net_processing] Introduce new field to indicate if addr relay is enabled (Amiti Uttarwar) 1d1ef2db7ea0d93c7dab4a9800ec74afa7a019eb [net_processing] Defer initializing m_addr_known (Amiti Uttarwar) 6653fa3328b5608fcceda1c6ea8e68c5d58739ec [test] Update p2p_addr_relay test to prepare (Amiti Uttarwar) 2fcaec7bbb96d6fe72a7e3a5744b0c35c79733e8 [net_processing] Introduce SetupAddressRelay (Amiti Uttarwar) Pull request description: This PR builds on the test refactors extracted into #22306 (first 5 commits). This PR aims to reduce addr blackholes. When we receive an `addr` message that contains 10 or less addresses, we forward them to 1-2 peers. This is the main technique we use for self advertisements, so sending to peers that wouldn't relay would effectively "blackhole" the trickle. Although we cannot prevent this in a malicious case, we can improve it for the normal, honest cases, and reduce the overall likelihood of occurrence. Two known cases where peers would not participate in addr relay are if they have connected to you as a block-relay-only connection, or if they are a light client. This implementation defers initialization of `m_addr_known` until it is needed, then uses its presence to decide if the peer is participating in addr relay. For outbound (not block-relay-only) peers, we initialize the filter before sending the initial self announcement when processing their `version` message. For inbound peers, we initialize the filter if/when we get an addr related message (`ADDR`, `ADDRV2`, `GETADDR`). We do NOT initialize the filter based on a `SENDADDRV2` message. To communicate about these changes beyond bitcoin core & to (try to) ensure that no other software would be disrupted, I have: - Posted to the [mailing list](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-April/018784.html) - Researched other open source clients to confirm compatibility, opened issues in all the projects & documented in https://github.com/bitcoin/bitcoin/pull/21528#issuecomment-809906430. Many have confirmed that this change would not be problematic. - Raised as topic during [bitcoin-core-dev meeting](https://www.erisian.com.au/bitcoin-core-dev/log-2021-03-25.html#l-954) - Raised as topic during [bitcoin p2p meeting](https://www.erisian.com.au/bitcoin-core-dev/log-2021-04-20.html#l-439) ACKs for top commit: jnewbery: reACK 3f7250b328b8b2f5d63f323702445ac5c989b73d glozow: ACK 3f7250b328b8b2f5d63f323702445ac5c989b73d ajtowns: utACK 3f7250b328b8b2f5d63f323702445ac5c989b73d Tree-SHA512: 29069282af684c1cd37d107c395fdd432dcccb11626f3c2dabfe92fdc4c85e74c7c4056fbdfa88017fec240506639b72ac6c311f8ce7c583112eb15f47e421af
2021-08-02doc: Correct description of CAddrMan::Create()Amiti Uttarwar
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2021-08-02doc: Update high-level addrman descriptionMartin Zumsande
2021-08-02[GetTransaction] remove unneeded `cs_main` lock acquireSebastian Falbesoner
2021-08-02consensus/params: simplify ValidDeployment check to avoid gcc warningAnthony Towns
2021-08-02Merge bitcoin/bitcoin#22570: Ignore banlist.datW. J. van der Laan
fa1eddb1a3d1319ddc3643b6f34fe2014de32764 Fix whitespace in touched files (MarcoFalke) fa4e6afdae7b82df638b60edf37ac36d57a8cb4f Remove unused CSubNet serialize code (MarcoFalke) fa384fdd0b7af73d81fa9619c5fba779452cd2af Ignore banlist.dat (MarcoFalke) Pull request description: The code to read `banlist.dat` should be removed eventually. The major release (22.x) can be used to translate a `banlist.dat` into a `banlist.json`. Thus, it is now possible to remove the reading code. ACKs for top commit: Zero-1729: re-ACK fa1eddb1a3d1319ddc3643b6f34fe2014de32764 laanwj: concept and code review ACK fa1eddb1a3d1319ddc3643b6f34fe2014de32764 vasild: ACK fa1eddb1a3d1319ddc3643b6f34fe2014de32764 jonatack: Light code review utACK fa1eddb1a3d1319ddc3643b6f34fe2014de32764 Tree-SHA512: e136193b7c0ba1d6d2e79c7fb4106ba4af75fa229ed7214675ee64e98e59bb4808779e7a8a09eecce62f7a5d4bc6e16b8a5ad4596129357c8fc5e3b88f214249
2021-08-02Merge bitcoin/bitcoin#21940: refactor: Mark CAddrMan::Select and GetAddr constMarcoFalke
fae108ceb53f61d7338ba205873623ede3c1d3be Fix incorrect whitespace in addrman (MarcoFalke) fa32024d51c098441623e246f304a80f011e29d1 Add missing GUARDED_BY to CAddrMan::insecure_rand (MarcoFalke) fab755b77f88873f01cbd988051de7ad3f0150de fuzz: Actually use const addrman (MarcoFalke) fae0c79351ce34186249d44af0c5c9c7521f4b6c refactor: Mark CAddrMan::GetAddr const (MarcoFalke) fa02934c8c9d290ea4d12683e8680c70967a4d3a refactor: Mark CAddrMan::Select const (MarcoFalke) Pull request description: To clarify that a call to this only changes the random state and nothing else. ACKs for top commit: jnewbery: Code review ACK fae108ceb53f61d7338ba205873623ede3c1d3be theStack: re-ACK fae108ceb53f61d7338ba205873623ede3c1d3be 🍦 Tree-SHA512: 3ffb211d4715cc3daeb3bfcdb3fcc6b108ca96df5fa565510436fac0e8da86c93b30c9c4aad0563e27d84f615fcd729481072009a4e2360c8b3d40787ab6506a
2021-07-30Close minor startup race between main and scheduler threadsLarry Ruane
Don't schedule class PeerManagerImpl's background tasks from its constructor, but instead do that from a separate method, StartScheduledTasks(), that can be called later at the end of startup, after other things, such as the active chain, are initialzed.
2021-07-30[style] Small style improvements to DNS parametersAmiti Uttarwar
2021-07-30[init] Disallow starting up with conflicting paramters for -dnsseed and ↡Amiti Uttarwar
-forcednsseed -dnsseed determines whether we run ThreadDNSAddressSeed and potentially query the DNS seeds for addresses. -forcednsseed tells the node to force querying the DNS seeds even if we have sufficient addresses or current connections. This commit disallows starting up with explicitly conflicting parameters.
2021-07-30[test] Introduce test logic to query DNS seedsAmiti Uttarwar
This commit introduces a DNS seed to the regest chain params in order to add coverage to the DNS querying logic. The first test checks that we do not query DNS seeds if we are able to succesfully connect to 2 outbound connections. Since we participate in ADDR relay with those connections, including sending a GETADDR message during the VERSION handshake, querying the DNS seeds is unnecessary. Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2021-07-30Fix whitespace in touched filesMarcoFalke
Leaving the incorrect indentation would be frustrating because: * Some editor may fix up the whitespace when editing a file, so before commiting the whitespace changes need to be undone. * It makes it harder to use clang-format-diff on a change. Can be trivially reviewed with --word-diff-regex=. --ignore-all-space
2021-07-30Remove unused CSubNet serialize codeMarcoFalke
2021-07-30Ignore banlist.datMarcoFalke
This also allows to remove the "dirty" argument, which can now be deduced from the return value of Read().
2021-07-30contrib, p2p: update I2P hardcoded seedsJon Atack
2021-07-29[RPC] Add field to getpeerinfo to indicate if addr relay is enabledAmiti Uttarwar
2021-07-29[net_processing] Remove RelayAddrsWithPeer functionAmiti Uttarwar
Now that we have a simple boolean stored on the field, the wrapper function is no longer necessary.
2021-07-29[net_processing] Introduce new field to indicate if addr relay is enabledAmiti Uttarwar
2021-07-29[net_processing] Defer initializing m_addr_knownAmiti Uttarwar
Use SetupAddressRelay to only initialize `m_addr_known` as needed. For outbound peers, we initialize the filter before sending our self announcement (not applicable for block-relay-only connections). For inbound peers, we initialize the filter when we get an addr related message (ADDR, ADDRV2, GETADDR). These changes intend to mitigate address blackholes. Since an inbound peer has to send us an addr related message to become eligible as a candidate for addr relay, this should reduce our likelihood of sending them self-announcements.
2021-07-29[net_processing] Introduce SetupAddressRelayAmiti Uttarwar
Idempotent function that initializes m_addr_known for connections that support address relay (anything other than block-relay-only). Unused until the next commit.
2021-07-29Merge bitcoin/bitcoin#21882: build: Fix undefined reference to __mulodi4fanquake
e4c8bb62e4a6873c45f42d0d2a24927cb241a0ea build: Fix undefined reference to __mulodi4 (Hennadii Stepanov) Pull request description: When compiling with clang on 32-bit systems the `__mulodi4` symbol is defined in compiler-rt only. Fixes #21294. See more: - https://bugs.llvm.org/show_bug.cgi?id=16404 - https://bugs.llvm.org/show_bug.cgi?id=28629 ACKs for top commit: MarcoFalke: tested-only ACK e4c8bb62e4a6873c45f42d0d2a24927cb241a0ea luke-jr: utACK e4c8bb62e4a6873c45f42d0d2a24927cb241a0ea fanquake: ACK e4c8bb62e4a6873c45f42d0d2a24927cb241a0ea - it's a bit of an awkward workaround to carry, but at-least it's contained to the fuzzers. Tree-SHA512: 93edb4ed568027702b1b9aba953ad50889b834ef97fde3cb99d1ce70076d9c00aa13f95c86b12d6f59b24fa90108d93742f920e15119901a2848fb337ab859a1
2021-07-28Merge bitcoin/bitcoin#22528: refactor: move GetTransaction to ↡MarcoFalke
node/transaction.cpp f685a13bef0418663015ea6d8f448f075510c0ec doc: GetTransaction()/getrawtransaction follow-ups to #22383 (John Newbery) abc57e1f0882a1a2bb20474648419979af6e383d refactor: move `GetTransaction(...)` to node/transaction.cpp (Sebastian Falbesoner) Pull request description: ~This PR is based on #22383, which should be reviewed first~ (merged by now). In [yesterday's PR review club session to PR 22383](https://bitcoincore.reviews/22383), the idea of moving the function `GetTransaction(...)` from src/validation.cpp to src/node/transaction.cpp came up. With this, the circular dependency "index/txindex -> validation -> index/txindex" is removed (see change in `lint-circular-dependencies.sh`). Thanks to jnewbery for suggesting and to sipa for providing historical background. Relevant IRC log: ``` 17:52 <jnewbery> Was anyone surprised that GetTransaction() is in validation.cpp? It seems to me that node/transaction.cpp would be a more appropriate place for it. 17:53 <raj_> jnewbery, +1 17:53 <stickies-v> agreed! 17:54 <glozow> jnewbery ya 17:54 <jnewbery> seems weird that validation would call into txindex. I wonder if we remove this function, then validation would no longer need to #include txindex 17:54 <sipa> GetTransaction predates node/transaction.cpp, and even the generic index framework itself :) 17:55 <sipa> (before 0.8, validation itself used the txindex) 17:55 <jnewbery> (and GetTransaction() seems like a natural sibling to BroadcastTransaction(), which is already in node/transaction.cpp) 17:55 <jnewbery> sipa: right, this is not meant as a criticism of course. Just wondering if we can organize things a bit more rationally now that we have better separation between things. 17:55 <sipa> jnewbery: sure, just providing background 17:56 <sipa> seems very reasonable to move it elsewhere now ``` The commit should be trivial to review with `--color-moved`. ACKs for top commit: jnewbery: Code review ACK f685a13bef0418663015ea6d8f448f075510c0ec rajarshimaitra: tACK https://github.com/bitcoin/bitcoin/pull/22528/commits/f685a13bef0418663015ea6d8f448f075510c0ec mjdietzx: crACK f685a13bef0418663015ea6d8f448f075510c0ec LarryRuane: Code review, test ACK f685a13bef0418663015ea6d8f448f075510c0ec Tree-SHA512: 0e844a6ecb1be04c638b55bc4478c2949549a4fcae01c984eee078de74d176fb19d508fc09360a62ad130677bfa7daf703b67870800e55942838d7313246248c
2021-07-28Merge bitcoin/bitcoin#21562: [net processing] Various tidying up of ↡MarcoFalke
PeerManagerImpl ctor fde1bf4f6136638e84cdf9806eedaae08e841bbf [net processing] Default initialize m_recent_confirmed_transactions (John Newbery) 37dcd12d539e4a875581fa049aa0f7fafeb932a4 scripted-diff: Rename recentRejects (John Newbery) cd9902ac5054c01228d52616bf85f7196364d4ff [net processing] Default initialize recentRejects (John Newbery) a28bfd1d4cfa523a6abf3832dbfd6183cd546944 [net processing] Default initialize m_stale_tip_check_time (John Newbery) 9190b01d8dcf03b74e9b9e1653688a97ac171b37 [net processing] Add Orphanage empty consistency check (John Newbery) Pull request description: - Use default initialization of PeerManagerImpl members where possible - Remove unique_ptr indirection where it's not needed ACKs for top commit: MarcoFalke: ACK fde1bf4f6136638e84cdf9806eedaae08e841bbf πŸ‘ž theStack: re-ACK fde1bf4f6136638e84cdf9806eedaae08e841bbf Tree-SHA512: 7ddedcc972df8e933e1fbe5c88b8ea17df89e1e58fc769518512c5540e49dc8eddb3f47e78d1329a6fc5644d2c1d11c981f681fd633f5218bfa4b3e6a86f3d7b
2021-07-28Merge bitcoin/bitcoin#22047: index, rpc: Coinstatsindex follow-upsW. J. van der Laan
779e638ca9b2b37c247577d225b93ac762b0602f coinstats: Add comments for new coinstatsindex values (Fabian Jahr) 5b3d4e724f377834e24b1f014787cc7aa7fc30fe Index: Improve logging in coinstatsindex (Fabian Jahr) d4356d4e48f59c63894b68691cc21ed4892ee716 rpc: Block until synced if coinstatsindex is used in gettxoutsetinfo (Fabian Jahr) a5f6791139554936d13f367660283899a37ff5c7 rpc: Add missing gettxoutsetinfo help docs (Fabian Jahr) 01386bfd88019397237256cb16f91de346eb66f2 Index: Return early from failed coinstatsindex init (Fabian Jahr) 1e3842385b8c0d15086c7cd8736f8c67e6c0c285 index: Use batch writing in coinstatsindex WriteBlock (Fabian Jahr) fb65dde147f63422c4148b089c2f5be0bf5ba80f scripted-diff: Fix coinstats data member names (Fabian Jahr) 8ea8c927ac05980d6a81252e40b7444e9abb74f9 index: Avoid unnecessary type casts in coinstatsindex (Fabian Jahr) Pull request description: This is a collection of smaller follow-ups to #19521, addressing several post-merge review comments. ACKs for top commit: Sjors: re-utACK 779e638ca9b2b37c247577d225b93ac762b0602f jonatack: re-ACK 779e638ca9b2b37c247577d225b93ac762b0602f diff since last review involves doc changes only; rebased to current master and verified clean debug build/no silent conflicts, unit tests, and feature_coinstatsindex functional test laanwj: Code review ACK 779e638ca9b2b37c247577d225b93ac762b0602f Talkless: re-utACK 779e638ca9b2b37c247577d225b93ac762b0602f after cosmetic changes. Tree-SHA512: cb0d038d230c582d7fe3041c89b1e04d39971fab3739d540c609cf826754c6c513b12ded08ac92180aec7a9d7a70114ece50357bd1a902de4adaae9f30b8d699
2021-07-28Merge bitcoin/bitcoin#22530: log: sort logging categories alphabeticallyMarcoFalke
d596dba9877e7ead3fb5426cbe7e608fbcbfe3eb test: assert logging categories are sorted in rpc and help (Jon Atack) 17bbff3b88132c0c95b29b59100456b85e26df75 log, refactor: use guard clause in LogCategoriesList() (Jon Atack) 7c57297319bc386afaf06528778384fe58576ef9 log: sort LogCategoriesList and LogCategoriesString alphabetically (Jon Atack) f720cfa824f1be863349e7016080f8fb1c3c76c2 test: verify number of categories returned by logging RPC (Jon Atack) Pull request description: Sorting the logging categories seems more user-friendly with the number of categories we now have, allowing CLI users to more quickly find a particular category. before ``` $ bitcoin-cli help logging ... The valid logging categories are: net, tor, mempool, http, bench, zmq, walletdb, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation, i2p, ipc $ bitcoind -h | grep -A8 "debug=<category>" -debug=<category> ... output all debugging information. <category> can be: net, tor, mempool, http, bench, zmq, walletdb, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation, i2p, ipc. $ bitcoin-cli logging [] '["addrman"]' { "net": false, "tor": true, "mempool": false, "http": false, "bench": false, "zmq": false, "walletdb": false, "rpc": false, "estimatefee": false, "addrman": false, "selectcoins": false, "reindex": false, "cmpctblock": false, "rand": false, "prune": false, "proxy": true, "mempoolrej": false, "libevent": false, "coindb": false, "qt": false, "leveldb": false, "validation": false, "i2p": true, "ipc": false } ``` after ``` $ bitcoin-cli help logging ... The valid logging categories are: addrman, bench, cmpctblock, coindb, estimatefee, http, i2p, ipc, leveldb, libevent, mempool, mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, selectcoins, tor, validation, walletdb, zmq $ bitcoind -h | grep -A8 "debug=<category>" -debug=<category> ... output all debugging information. <category> can be: addrman, bench, cmpctblock, coindb, estimatefee, http, i2p, ipc, leveldb, libevent, mempool, mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, selectcoins, tor, validation, walletdb, zmq. $ bitcoin-cli logging [] '["addrman"]' { "addrman": false, "bench": false, "cmpctblock": false, "coindb": false, "estimatefee": false, "http": false, "i2p": false, "ipc": false, "leveldb": false, "libevent": false, "mempool": false, "mempoolrej": false, "net": false, "proxy": false, "prune": false, "qt": false, "rand": false, "reindex": false, "rpc": false, "selectcoins": false, "tor": false, "validation": false, "walletdb": false, "zmq": false } ``` ACKs for top commit: theStack: re-ACK d596dba9877e7ead3fb5426cbe7e608fbcbfe3eb Tree-SHA512: d546257f562b0a288d1b19a028f1a510aaf21bd21da058e7c84653d305ea8662ecb4647ebefd2b97411f845fe5b0b841d40d3fe6814eefcb8ce82df341dfce22
2021-07-28Merge bitcoin/bitcoin#22557: fuzz: silence a compiler warning about unused ↡fanquake
CBanEntry comparator 787296eb6744b15ab693c053e4030ff68dfc95e0 fuzz: silence a compiler warning about unused CBanEntry comparator (Vasil Dimov) Pull request description: ``` test/fuzz/banman.cpp:35:13: warning: unused function 'operator==' [-Wunused-function] static bool operator==(const CBanEntry& lhs, const CBanEntry& rhs) ^ 1 warning generated. ``` See https://github.com/bitcoin/bitcoin/pull/22517#issuecomment-886177699 ACKs for top commit: MarcoFalke: cr ACK 787296eb6744b15ab693c053e4030ff68dfc95e0 practicalswift: cr ACK 787296eb6744b15ab693c053e4030ff68dfc95e0 hebasto: ACK 787296eb6744b15ab693c053e4030ff68dfc95e0 Tree-SHA512: 72e483cef249170160879cf4b69b787fb6c539d61dda423f618e2c5f130bee8c42897487751e5b58e7679cdb0153eb80efcb104e8a85095daa60d47e39ce78b8
2021-07-27tracing: Tracepoint for connected blocks0xb10c
Can, for example, be used to benchmark block connections.
2021-07-27tracing: Tracepoints for in- and outbound P2P msgs0xb10c
Can be used to monitor in- and outbound node traffic. Based on ealier work by jb55. Co-authored-by: William Casarin <jb55@jb55.com>
2021-07-27fuzz: silence a compiler warning about unused CBanEntry comparatorVasil Dimov
``` test/fuzz/banman.cpp:35:13: warning: unused function 'operator==' [-Wunused-function] static bool operator==(const CBanEntry& lhs, const CBanEntry& rhs) ^ 1 warning generated. ```