aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-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-03Merge bitcoin/bitcoin#22532: test : improve mempool_accept_wtxid.pyMarcoFalke
91b05974fc1ea38062f12d36152201af81bda1a2 Improve mempool_accept_wtxid.py (naiza) Pull request description: Follow-up to #22253 adding changes suggested in [#22253 (review)](https://github.com/bitcoin/bitcoin/pull/22253#discussion_r666933370) ACKs for top commit: glozow: utACK 91b05974fc1ea38062f12d36152201af81bda1a2 Tree-SHA512: 383064138a5b2160d769c9df370470fd585c91682083013a6fa15e14448a4b481bc09b3a0ed6e75554db2c378df6b2263c65f209f973c9e9d577e15814a4be1d
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-03Improve mempool_accept_wtxid.pynaiza
Improve mempool_accept_wtxid.py Improve mempool_accept_wtxid.py Improve mempool_accept_wtxid.py Improve mempool_accept_wtxid.py
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-02Merge bitcoin/bitcoin#22378: test: remove confusing `MAX_BLOCK_BASE_SIZE`MarcoFalke
607076d01bf23c69ac21950c17b01fb4e1130774 test: remove confusing `MAX_BLOCK_BASE_SIZE` (Sebastian Falbesoner) 4af97c74edcda56cd15523bf3a335adea2bad14a test: introduce `get_weight()` helper for CBlock (Sebastian Falbesoner) a084ebe1330bcec15715e08b0f65319142927ad1 test: introduce `get_weight()` helper for CTransaction (Sebastian Falbesoner) Pull request description: This is a very late follow-up PR to #10618, which removed the constant `MAX_BLOCK_BASE_SIZE` from the core implementation about four years ago (see also #10608 in why it was considered confusing and superfluous). Since there is also no point in still keeping it in the functional test framework, the PR switches to weight-based accounting on the relevant test code parts and use `MAX_BLOCK_WEIGHT` instead for the block limit checks. To prepare that, the first two commits introduce `get_weight()` helpers for the classes CTransaction and CBlock, respectively. ACKs for top commit: MarcoFalke: review ACK 607076d01bf23c69ac21950c17b01fb4e1130774 🚴 Tree-SHA512: d59aa0b6b3dfd0a849b8063e66de275d252f705f99e25cd3bf6daec028b47d946777ee5b42a060f5283cb18e917ac073119c2c0e11bbc21211f69ef0a6ed335a
2021-08-02consensus/params: simplify ValidDeployment check to avoid gcc warningAnthony Towns
2021-08-02Merge bitcoin/bitcoin#22001: doc: Generate doxygen documentation for test ↵W. J. van der Laan
sources 5d37cc44f9200861a278d074f8caa99e8db6be02 Generate doxygen documentation for test sources (Patrick Kamin) Pull request description: Fixes #19248 While searching for the documentation of the test utilities I realized they were excluded from doxygen. I agree with the statement in #19248. It's also helpful for new contributors to gain a broader understanding of the class dependencies visually (see BasicTestSetup) ACKs for top commit: laanwj: ACK 5d37cc44f9200861a278d074f8caa99e8db6be02 Tree-SHA512: 32f0abab2970c65621af5cee7f620c2653bd9688366e125543262bd078841e64a5a1e24cf0241e9f6ec538b8759e06108d5ff056449aa1c98d5f287deef18c86
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-08-02Merge bitcoin/bitcoin#22593: test: refactor: remove `hex_str_to_bytes` helperMarcoFalke
ca6c154ef116e8d2e0484cdb1af13b34a0c86c17 test: refactor: remove `hex_str_to_bytes` helper (Sebastian Falbesoner) Pull request description: Use the built-in class method `bytes.fromhex()` instead, which is available since Python 3.0 (https://docs.python.org/3.0/library/stdtypes.html?highlight=fromhex#bytes.fromhex). This would be nice to solve with a scripted-diff, but it's tricky to also tackle the imports (which need to be removed in the same commit, otherwise the linter would complain). ACKs for top commit: theStack: For the previous ACK (thanks Zero-1729!), it can be trivially re-reviewed via `git range-diff ee5462683...ca6c154ef` practicalswift: cr ACK ca6c154ef116e8d2e0484cdb1af13b34a0c86c17 tryphe: Concept ACK, cr ACK ca6c154ef116e8d2e0484cdb1af13b34a0c86c17 Zero-1729: re-ACK ca6c154ef116e8d2e0484cdb1af13b34a0c86c17, clean rebase. Tree-SHA512: 1cda70e7bad523ed937239f6e999c2b43754533a507b18b3ff2503fd0b0ab604efbef23e155726818b970621569d5bcfd42927f1e329184fc1bcbc92651e47ca
2021-08-02Merge bitcoin/bitcoin#22589: net, doc: update I2P hardcoded seeds and docs ↵W. J. van der Laan
for 22.0 d2dffd5be4c8f6a1942dd971d09707c3620a1689 doc: add info to i2p.md about IBD time and multiple networks (Jon Atack) 2962640c49cf38f76345e45e63045a8f0eed5c61 contrib, p2p: update I2P hardcoded seeds (Jon Atack) Pull request description: - Update the I2P seeds with the latest ones I can connect to (feedback welcome). - Update the I2P doc with frequently asked and reported info: IBD speed and running with other networks. ACKs for top commit: tryphe: ACK d2dffd5be4c8f6a1942dd971d09707c3620a1689 duncandean: ACK d2dffd5 willcl-ark: ACK d2dffd5be4c8f6a1942dd971d09707c3620a1689 laanwj: ACK d2dffd5be4c8f6a1942dd971d09707c3620a1689 vasild: ACK d2dffd5be4c8f6a1942dd971d09707c3620a1689 Tree-SHA512: 1edda0eb77b4e224b44961849b36c5a13e1eb14bdc50f909ec44d7fe926c259cada62404906594a1cf68ffd96254647ac49f24248214b42403ecebae45135e63
2021-08-01test: refactor: remove `hex_str_to_bytes` helperSebastian Falbesoner
Use the built-in class method bytes.fromhex() instead, which is available since Python 3.0.
2021-08-01Merge bitcoin/bitcoin#22429: test: refactor: fix segwit terminology ↵MarcoFalke
(s/witness_program/witness_script/) 8a2b58db9ee6a14d36b5d8e430b35f18e7c7b0c5 test: fix segwit terminology (s/witness_program/witness_script/) (Sebastian Falbesoner) Pull request description: This PR fixes wrong uses of the term "witness program", which according to [BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Witness_program) is defined as follows: > A scriptPubKey (or redeemScript as defined in BIP16/P2SH) that consists of a 1-byte push opcode (for 0 to 16) followed by a data push between 2 and 40 bytes gets a new special meaning. The value of the first push is called the "version byte". **The following byte vector pushed is called the "witness program".** In most cases where "witness program" is used in tests (concerns comments, variable names and in one instance even a function name) what we really want to denote is the "witness script". Thanks to [MarcoFalke for pointing this out in a review comment](https://github.com/bitcoin/bitcoin/pull/22363#discussion_r666794261)! Some historical background: At the time when the P2P segwit tests were first introduced (commit 330b0f31ee5719d94f9e52dfc83c5d82168241f9, PR #8149), the term "witness program" was not used consistently in BIP141: https://bitcoin.stackexchange.com/questions/46451/what-is-the-precise-definition-of-witness-program This was fixed in PR https://github.com/bitcoin/bips/pull/416 later. So in some way, this PR can be seen as a very late follow-up to the BIP141 fix that also reflects these changes in the tests. ACKs for top commit: josibake: tACK https://github.com/bitcoin/bitcoin/pull/22429/commits/8a2b58db9ee6a14d36b5d8e430b35f18e7c7b0c5 Tree-SHA512: f36bb9e53d1b54b86bfa87ec12f33e3ebca64b5f59d97e9662fe35ba12c25e1c9a4f93a5425d0eaa3879dce9e50368d345555b927bfab76945511f873396892b
2021-07-31Merge bitcoin/bitcoin#22573: fuzz: document faster throughput configurationMarcoFalke
8a4f0fcd3fc1a35c1482975114555b0fed75a1c0 Document faster throughput configuration (Alex Groce) Pull request description: This is a small change to the fuzzing doc that I think might help more people improve the corpus coverage, which I think is low partly just due to lack of long, low-overhead, runs, in addition to the need to apply a more diverse set of fuzzers and coverage notions. ACKs for top commit: practicalswift: ACK 8a4f0fcd3fc1a35c1482975114555b0fed75a1c0 tryphe: ACK 8a4f0fcd3fc1a35c1482975114555b0fed75a1c0 Tree-SHA512: 0f1802f5c551d6ade7393cd2ac439ffd485786b17c4fd0f1a321f69f8ed0db1167ae04b5cae7bf904e89aba03e89b6d974bff564bfc6a78a571893719f323434
2021-07-30[style] Small style improvements to DNS parametersAmiti Uttarwar
2021-07-30[test] Test the delay before querying DNS seedsAmiti Uttarwar
When starting up with a populated addrman, ThreadDNSAddressSeed adds a delay during which time the node may be able to connect to some peers. This commit tests the delay changes based on the number of addresses in the addrman.
2021-07-30[test] Test the interactions between -forcednsseed and -dnsseedAmiti Uttarwar
Test that passing conflicting parameters for the two causes a startup error. This logic also impacts -connect, which soft sets -dnsseed, so add a test for that too.
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] Test -forcednsseed causes querying DNS seedsAmiti Uttarwar
2021-07-30[test] Test the interactions between -connect and -dnsseedAmiti Uttarwar
2021-07-30[test] Test logic to query DNS seeds with block-relay-only connectionsAmiti Uttarwar
When a node is able to properly shutdown, it will persist its block-relay-only connections to the addrman. On startup, it will attempt to reconnect to these anchors. Since block-relay-only connections do not participate in ADDR relay, succesful connections are insufficient to skip querying the DNS seeds. This test fails prior to the changes in #22013. Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
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-30Merge bitcoin/bitcoin#22330: test: use MiniWallet for simple doublespend ↵MarcoFalke
sub-test in feature_rbf.py aa02c64540cd77199c2834549786b9bc91fd4bc9 test: use MiniWallet for simple doublespend test in feature_rbf.py (Sebastian Falbesoner) a3f6397c7390ca033311f2219094ac90f6e582f9 test: feature_rbf.py: make MiniWallet instance available for all sub-tests (Sebastian Falbesoner) 84c874794cc1e1aa48f2edf08c355ec2a5696cb6 test: remove unneeded initialization code in feature_rbf.py (Sebastian Falbesoner) Pull request description: This PR's goal is to prepare the functional test `feature_rbf.py` for more MiniWallet usage. It first gets rid of unused initialization code (I guess that was needed at times when the nodes were still in IBD at the start of tests?), then makes the MiniWallet instance introduced in #22210 available for all sub-tests, and finally, uses that instance in the first sub-test `test_simple_doublespend`. Note that the same idea of replacing the `make_utxo` calls with MiniWallet can be also applied to other sub-tests too; this just serves as a first proof-of-concept. ACKs for top commit: MarcoFalke: re-ACK aa02c64540cd77199c2834549786b9bc91fd4bc9 🌯 Tree-SHA512: 2902dd15d493d83b0790028c92d14fbd99ca05ace704c7011fb38261ce6517aeb810ef9f360fcb701d95887975b6a2911cfe538858d38fceb2c1c2a40afdbe6b
2021-07-30Merge bitcoin/bitcoin#22490: test: Disable automatic connections per default ↵MarcoFalke
in the functional tests 8ca51af1ece371b6f1bdb88b96f16020cc787d13 test: Disable automatic connections by default (Martin Zumsande) Pull request description: A node normally doesn't make automatic connections to peers in the functional tests because neither DNS seeds nor hardcoded peers are available on regtest. However, when random entries are inserted into addrman as part of a functional test (e.g. while testing addr relay), `ThreadOpenConnections` will periodically try to connect to them, resulting in log entries such as: `[opencon] [net.cpp:400] [ConnectNode] trying connection 18.166.1.1:8333 lastseen=0.0hrs` I don't think it's desirable that functional tests try to connect to random computers on the internet, aside from the possibility that at some point in time someone out there might actually answer in a way to ruin a test. This PR fixes this problem by disabling `ThreadOpenConnections` by adding `-connect=0` to the default args, and adding exceptions only when needed for the test to pass. ACKs for top commit: tryphe: Concept ACK, light code review ACK 8ca51af1ece371b6f1bdb88b96f16020cc787d13 Tree-SHA512: bcfb2de610e6c35a97a2bd7ad6267e968b1ac7529638d99276993cd5bc93ce9919d54e22d6dc84e1b02ecd626ab6554e201693552ea065c29794eece38c43f7d
2021-07-30Merge bitcoin/bitcoin#22520: test: improve rpc_blockchain.py tests and ↵MarcoFalke
assert on time and mediantime ef5e9304cd407adab1563f24215da1b582274c20 test: update logging and docstring in rpc_blockchain.py (Jon Atack) d548dc71e4849f638fccaea6be86ac4fa5304f01 test: replace magic values by constants in rpc_blockchain.py (Jon Atack) 78c361086fc0bf27612e8142bd33e05e37a36af6 test: assert on mediantime in getblockheader and getblockchaininfo (Jon Atack) 0a9129c588ab016eb0453b40a0cae918ca4aa6a2 test: assert on the value of getblockchaininfo#time (Jon Atack) Pull request description: Follow-up to #22407 improving test coverage per https://github.com/bitcoin/bitcoin/pull/22407#pullrequestreview-702077013. ACKs for top commit: tryphe: untested ACK ef5e9304cd407adab1563f24215da1b582274c20 Tree-SHA512: f746d56f430331bc6a2ea7ecd27b21b06275927966aacf1f1127d8d5fdfd930583cabe72e23df3adb2e005da904fc05dc573b8e5eaa2f86e0e193b89a17a5734
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-30doc: add info to i2p.md about IBD time and multiple networksJon Atack
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-30Merge bitcoin/bitcoin#22584: test: Add temporary sanitizer suppression ↵MarcoFalke
implicit-signed-integer-truncation:netaddress.cpp fa865287e5f35e0a376785834e966dd202d2959e test: Add temporary sanitizer suppression implicit-signed-integer-truncation:netaddress.cpp (MarcoFalke) Pull request description: This is required to unbreak the fuzzers while a fix is being worked on. https://cirrus-ci.com/task/4787303177519104?logs=ci#L3020 ``` netaddress.cpp:1190:18: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) ACKs for top commit: practicalswift: cr ACK fa865287e5f35e0a376785834e966dd202d2959e tryphe: untested ACK fa865287e5f35e0a376785834e966dd202d2959e lsilva01: ACK https://github.com/bitcoin/bitcoin/pull/22584/commits/fa865287e5f35e0a376785834e966dd202d2959e Tree-SHA512: 4a54ec68c014c7a4c9ab268c3a04321db5eb9b2857646b41406d8d4908a3d349848b4549e80aea6afd9a0c3639522a48fe578527139519b12439eae9f0c4c46c
2021-07-29[test] Use the new endpoint to improve testsAmiti Uttarwar
2021-07-29[RPC] Add field to getpeerinfo to indicate if addr relay is enabledAmiti Uttarwar
2021-07-29[test] Test that we intentionally select addr relay peers.Amiti Uttarwar
This test checks that we only relay addresses with inbound peers who have sent us an addr related message. Uses a combination of GETADDR and ADDR to verify when peers are eligible.
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[test] Update p2p_addr_relay test to prepareAmiti Uttarwar
Use an init param to make clear whether a getaddr message should be sent when the P2PConnection receives a version message. These changes are in preparation for upcoming commits that modify the behavior of a bitcoind node and the test framework.
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-29test: Add temporary sanitizer suppression ↵MarcoFalke
implicit-signed-integer-truncation:netaddress.cpp
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