Commit graph

27109 commits

Author SHA1 Message Date
Wladimir J. van der Laan
1811e488d5
Merge #20575: Do not run functions with necessary side-effects in assert()
5021810650 Make CanFlushToDisk a const member function (practicalswift)
281cf99554 Do not run functions with necessary side-effects in assert() (practicalswift)

Pull request description:

  Do not run functions with necessary side-effects in `assert()`.

ACKs for top commit:
  laanwj:
    Code review ACK 5021810650
  sipa:
    utACK 5021810650
  theStack:
    Code Review ACK 5021810650 🟢

Tree-SHA512: 38b7faccc2f16a499f9b7b1b962b49eb58580b2a2bbf63ea49dcc418a5ecc8f21a0972fa953f66db9509c7239af67cfa2f9266423fd220963d091034d7332b96
2020-12-16 23:14:53 +01:00
Jon Atack
a34eceb4cc
doc: update -externalip documentation in tor.md 2020-12-16 22:58:14 +01:00
Jon Atack
dc8a591222
doc: add tor.md section on how to get tor info via bitcoind 2020-12-16 22:58:12 +01:00
Jon Atack
e1765d8b04
doc: update tor.md address examples from onion v2 to v3 2020-12-16 22:58:10 +01:00
Wladimir J. van der Laan
4acbcfa97d
Merge #20470: build: Replace genisoimage with xorriso
7587d11ec9 build: remove cdrkit package from depends (fanquake)
0df9819126 build: Replace genisoimage with xorriso (fanquake)
22437fc72e build: Run libdmg-hfsplus's DMG tool in make deploy (Carl Dong)

Pull request description:

  This is a redo of fanquake's https://github.com/bitcoin/bitcoin/pull/18151, which, aside from switching us from the deprecated `genisoimage` to the maintained `xorriso`, is also necessary for Guix to achieve determinism without using faketime.

  > xorriso and its mkisofs/genisoimage emulation alter-ego xorrisofs are
  > more maintained, and has the right toggles for us to achieve output
  > determinism without using blunt tools like faketime.
  >
  > In this commit, we use xorrisofs from the build environment rather than
  > building it ourselves using depends. This is not necessary and can be
  > changed in the future.
  >
  > From wiki.debian.org/genisoimage?action=recall&rev=11 :
  >
  > > The classical command line interface for production of ISO 9660
  > > filesystem images is the option set established by program mkisofs.
  > > For reasons of licensing and other problems with its author, Debian
  > > ships a fork of mkisofs, called genisoimage, which was split off in
  > > 2006 and then developed independently.
  > >
  > > Meanwhile, genisoimage gets no new features and not even bug fixes. It
  > > is first choice only if its options -udf or -hfs are needed.
  > >
  > > Replacement in most uses cases, especially for bootable ISO 9660
  > > filesystems, archiving, and backup, is xorrisofs which starts the -as
  > > mkisofs emulation mode of program xorriso.

ACKs for top commit:
  laanwj:
    ACK 7587d11ec9

Tree-SHA512: 62f3aad08fa8bf21192e951d7dd33b24975586d76834cfa3498f4b8cdb586cefec8cab2c073d1951a0884b5e182fd71ef2cf3accad98f84455016776ad3c5422
2020-12-16 22:12:38 +01:00
Suhas Daftuar
0c41c10830 doc: Remove shouty enums in net_processing comments 2020-12-16 14:36:09 -05:00
MarcoFalke
ae9ee5bdb1
Merge #20651: net: Make p2p recv buffer timeout 20 minutes for all peers
ea36a453e3 [net] Make p2p recv buffer timeout 20 minutes for all peers (John Newbery)

Pull request description:

  The timeout interval for the send and recv buffers was changed from 90
  minutes to 20 minutes in commit f1920e86 in 2013, except for peers that
  did not support the pong message (where the recv buffer timeout remained
  at 90 minutes). A few observations:

  - for peers that support BIP 31 (pong messages), this recv buffer
    timeout is almost redundant with the ping timeout. We send a ping
    message every two minutes, and set a timeout of twenty minutes to
    receive the pong response. If the recv buffer was really timing out,
    then the pong response would also time out.
  - BIP 31 is supported by all nodes of p2p version 60000 and higher, and
    has been in widespread use since 2013. I'd be very surprised if there
    are many nodes on the network that don't support pong messages.
  - The recv buffer timeout is not specified in any p2p BIP. We're free to
    set it at any value we want.
  - A peer that doesn't support BIP 31 and hasn't sent any message to us
    at all in 90 minutes is unlikely to be useful for us, and is more likely
    to be evicted AttemptToEvictConnection() since it'll have the worst
    possible ping time and isn't providing blocks/transactions.

  Therefore, we remove this check, and set the recv buffer timeout to 20
  minutes for all peers. This removes the final p2p version dependent
  logic from the net layer, so all p2p version data can move into the
  net_processing layer.

  Alternative approaches:

  - Set the recv buffer timeout to 90 minutes for all peers. This almost
    wouldn't be a behaviour change at all (pre-BIP 31 peers would still
    have the same recv buffer timeout, and we can't ever reach a recv buffer
    timeout higher than 21 minutes for post-BIP31 peers, because the pong
    timeout would be hit first).
  - Stop supporting peers that don't support BIP 31. BIP 31 has been in
    use since 2012, and implementing it is trivial.

ACKs for top commit:
  MarcoFalke:
    review ACK ea36a453e3
  promag:
    Code review ACK ea36a453e3.
  practicalswift:
    cr ACK ea36a453e3: patch looks correct
  ajtowns:
    ACK ea36a453e3
  sipa:
    utACK ea36a453e3
  jonatack:
    Code review ACK ea36a453e3

Tree-SHA512: df290bb32d2b5d9e59a0125bb215baa92787f9d01542a7437245f1c478c7f9b9831e5f170d3cd0db2811e1b11b857b3e8b2e03376476b8302148e480d81aab19
2020-12-16 20:29:31 +01:00
Wladimir J. van der Laan
427f8c2cff
Merge #20248: test: fix length of R check in key_signature_tests
89895773b7 Fix length of R check in test/key_tests.cpp:key_signature_tests (Dmitry Petukhov)

Pull request description:

  The code before the fix only checked the length of R value of the last
  signature in the loop, and only for equality (but the length can be
  less than 32)

  The fixed code checks that length of the R value is less than or equal
  to 32 on each iteration of the loop

ACKs for top commit:
  laanwj:
    ACK 89895773b7

Tree-SHA512: 73eb2bb4a6c1c5fc11dd16851b28b43037ac06ef8cfc3b1f957429a1fca295c9422d67ec6c73c0e4bb4919f92e22dc5d733e84840b0d01ad1a529aa20d906ebf
2020-12-16 19:45:16 +01:00
Wladimir J. van der Laan
5b6f970e3f
Merge #20171: Add functional test test_txid_inv_delay
bc4a230087 Remove redundant p2p lock tacking for tx download functional tests (Antoine Riard)
d3b5eac9a9 Add mutation for functional test test_preferred_inv (Antoine Riard)
06efb3163c Add functional test test_txid_inv_delay (Antoine Riard)
a07910abcd test: Makes wtxidrelay support a generic P2PInterface option (Antoine Riard)

Pull request description:

  This is a simple functional test to increase coverage of #19988, checking that txid announcements from txid-relay peers are delayed by TXID_RELAY_DELAY, assuming we have at least another wtxid-relay peer.

  You can verify new test with the following diff :

  ```
  diff --git a/src/net_processing.cpp b/src/net_processing.cpp
  index f14db379f..2a2805df5 100644
  --- a/src/net_processing.cpp
  +++ b/src/net_processing.cpp
  @@ -773,7 +773,7 @@ void PeerManager::AddTxAnnouncement(const CNode& node, const GenTxid& gtxid, std
       auto delay = std::chrono::microseconds{0};
       const bool preferred = state->fPreferredDownload;
       if (!preferred) delay += NONPREF_PEER_TX_DELAY;
  -    if (!gtxid.IsWtxid() && g_wtxid_relay_peers > 0) delay += TXID_RELAY_DELAY;
  +    //if (!gtxid.IsWtxid() && g_wtxid_relay_peers > 0) delay += TXID_RELAY_DELAY;
       const bool overloaded = !node.HasPermission(PF_RELAY) &&
           m_txrequest.CountInFlight(nodeid) >= MAX_PEER_TX_REQUEST_IN_FLIGHT;
       if (overloaded) delay += OVERLOADED_PEER_TX_DELAY;
  ```

ACKs for top commit:
  laanwj:
    ACK bc4a230087

Tree-SHA512: 150e806bc5289feda94738756ab375c7fdd23c80c12bd417d3112043e26a91a717dc325a01079ebd02a88b90975ead5bd397ec86eb745c7870ebec379a8aa711
2020-12-16 18:45:11 +01:00
Andrew Chow
23cac24dd3 tests: Test bitcoin-wallet dump and createfromdump 2020-12-16 12:33:09 -05:00
Andrew Chow
a88c320041 wallettool: Add createfromdump command
Creates a new wallet file using the dump file produced by the dump
command
2020-12-16 12:33:06 -05:00
Andrew Chow
e1e7a90d5f wallettool: Add dump command
Adds a new dump command to bitcoin-wallet which prints out all of the
wallet's records in hex.
2020-12-16 12:32:47 -05:00
fanquake
7587d11ec9 build: remove cdrkit package from depends 2020-12-16 12:29:14 -05:00
fanquake
0df9819126 build: Replace genisoimage with xorriso
xorriso and its mkisofs/genisoimage emulation alter-ego xorrisofs are
more maintained, and has the right toggles for us to achieve output
determinism without using blunt tools like faketime.

In this commit, we use xorrisofs from the build environment rather than
building it ourselves using depends. This is not necessary and can be
changed in the future.

From https://wiki.debian.org/genisoimage?action=recall&rev=11 :

> The classical command line interface for production of ISO 9660
> filesystem images is the option set established by program mkisofs.
> For reasons of licensing and other problems with its author, Debian
> ships a fork of mkisofs, called genisoimage, which was split off in
> 2006 and then developed independently.
>
> Meanwhile, genisoimage gets no new features and not even bug fixes. It
> is first choice only if its options -udf or -hfs are needed.
>
> Replacement in most uses cases, especially for bootable ISO 9660
> filesystems, archiving, and backup, is xorrisofs which starts the -as
> mkisofs emulation mode of program xorriso.
2020-12-16 12:29:14 -05:00
Wladimir J. van der Laan
ad3d4b3929
Merge #20661: Only select from addrv2-capable peers for torv3 address relay
37fe80e626 Only consider addrv2 peers for relay of non-addrv1 addresses (Pieter Wuille)
83f8821a6f refactor: add IsAddrCompatible() to CNode (Pieter Wuille)

Pull request description:

  When selecting peers to relay an address to, only pick addrv2-capable ones if the address cannot be represented in addr(v1).

  Without this I expect that propagation of torv3 addresses over the cleartext network will be very hard for a while.

ACKs for top commit:
  jonatack:
    ACK 37fe80e626
  vasild:
    ACK 37fe80e626

Tree-SHA512: 18a854ea43ad473cf89b9c5193b524109d7af75c26f7aa7e26cd72ad0db52f19c8001d566c607a7e6772bc314f770f09b6c3e07282d110c5daea193edc592cd2
2020-12-16 18:09:06 +01:00
MarcoFalke
69f1ee1922
Merge #20365: wallettool: add parameter to create descriptors wallet
173cc9b7be test: walettool create descriptors (Ivan Metlushko)
345e88eecf wallettool: add param to create descriptors wallet (Ivan Metlushko)
6d3af3ab62 wallettool: pass in DatabaseOptions into MakeWallet (Ivan Metlushko)

Pull request description:

  Rationale: expose and promote descriptor wallets in more places; make cli tool more consistent with `createwallet` rpc.

  Add `-descriptors` parameter which is off by default. When specified it will create a new descriptors wallet with sqlite backend, which is consistent with `createwallet` rpc.

  This PR is based on a suggestion from **ryanofsky** https://github.com/bitcoin/bitcoin/pull/19137#discussion_r516779603

  Example:
  ```
  $ ./src/bitcoin-wallet  -wallet=fewty -descriptors create
  Topping up keypool...
  Wallet info
  ===========
  Name: fewty
  Format: sqlite
  Descriptors: yes
  Encrypted: no
  HD (hd seed available): yes
  Keypool Size: 6000
  Transactions: 0
  Address Book: 0
  ```
  ```
  $ ./src/bitcoin-wallet  -wallet=fewty create
  Topping up keypool...
  Wallet info
  ===========
  Name: fewty
  Format: bdb
  Descriptors: no
  Encrypted: no
  HD (hd seed available): yes
  Keypool Size: 2000
  Transactions: 0
  Address Book: 0
  ```

ACKs for top commit:
  achow101:
    ACK 173cc9b7be
  ryanofsky:
    Code review ACK 173cc9b7be. This seems pretty nicely implemented now, with opportunities to clean up more and dedup later
  MarcoFalke:
    Concept ACK 173cc9b7be 🌠

Tree-SHA512: cc32ba336ff709de2707ee15f495b4617908e8700ede8401a58e894f44cda485c544d644023c9a6604d88a62db9d92152383ee2e8abf691688c25cf6e222c622
2020-12-16 17:43:20 +01:00
Wladimir J. van der Laan
3f205808a5
Merge #20605: init: Signal-safe instant shutdown
cd03513dc2 init: Signal-safe instant shutdown (Wladimir J. van der Laan)

Pull request description:

  Replace the 200ms polling loop with a faster and more efficient waiting operation. This should speed up short RPC tests.

  This change has been tried a few times before, but abandoned every time because solutions used a condition variable which is not safe for use in signals, as they need to be reentrant.

  On UNIX-ish OSes, use a safe way: a pipe. When shutdown is requested write a dummy byte to the pipe. Waiting for shutdown is a matter of a blocking read from the pipe.

  On Windows, there are no signals so using a condition variable is safe.

  This only affects bitcoind. The GUI is unaffected by this change, and keeps polling as before in `BitcoinGUI::detectShutdown()`. It might be possible to listen to a pipe there, too, but I'm not sure, and it's complicated by the GUI-node abstraction.

ACKs for top commit:
  jonatack:
    ACK cd03513dc2 tested on Debian 5.9.11-1 (2020-11-27) x86_64 GNU/Linux

Tree-SHA512: ed2f532f69fec4855c17bf7b8f3d0eb96e78ee2a3c13d374dd2c6add06e3ad6a190da8ed8f9d7a76532cf998222d67f57e35b206aec29675e96437448ae7e13c
2020-12-16 16:43:51 +01:00
MarcoFalke
9dbcd37105
Merge #20569: test: Fix intermittent wallet_multiwallet issue with got_loading_error
fab48da908 test: Fix intermittent wallet_multiwallet issue with got_loading_error (MarcoFalke)
fa8e15f7b7 test: pep8 wallet_multiwallet.py (MarcoFalke)

Pull request description:

  Failing the test after 10 iterations without a loading error is problematic because it may take 11 iterations to get a loading error.

  Fix that by running until a loading error occurs, which should happen in almost all runs within the first 10 iterations.

ACKs for top commit:
  ryanofsky:
    Code review ACK fab48da908. This seems like a good workaround. I think more ideally think load and unload RPCs would not have racy status reporting (suggested previously https://github.com/bitcoin/bitcoin/pull/19300#pullrequestreview-435362710 and

Tree-SHA512: 6b80b26d916276efe2a01af93bca7dbf71a3e67db9d3deb15175070719bf7d1325a1410d93e74c0316942e388faa2ba185dc9d3759c82d1c73c3c509b9997f05
2020-12-16 15:47:23 +01:00
Wladimir J. van der Laan
2d4eeaf9c5
Merge #20601: doc: Update for FreeBSD 12.2, add GUI Build Instructions
c175690561 doc: Update for FreeBSD 12.2, add GUI Build Instructions (Jarol Rodriguez)

Pull request description:

  The current FreeBSD Build documentation is a little outdated and underwhelming. This PR intends to keep the build-freebsd.md doc up to date. Here are the main improvements:
  - Introduce dependency information
  - New instructions for building the GUI
  - Instructions for supporting descriptor wallets
  - Various notes on the build and compile process

  **Before/Master:** [render](https://github.com/bitcoin/bitcoin/blob/master/doc/build-freebsd.md)

  **After/PR:** [render](2e8b9a5aac/doc/build-freebsd.md)

ACKs for top commit:
  laanwj:
    utACK c175690561

Tree-SHA512: 64aeb743c7f4ed167451454564b53d13c5c30d82bd2423799655c7b5b465a75733072fb0c574927c2588a46e89a68c6c57b008220acfd25336d445c9dc309f3b
2020-12-16 15:39:28 +01:00
practicalswift
546a0764f3 fuzz: Fill various small fuzzing gaps 2020-12-16 14:24:16 +00:00
Adam Jonas
010eed3ce0 doc: warn that incoming conns are unlikely when not using default ports 2020-12-16 09:24:03 -05:00
MarcoFalke
fa09f97bea
fuzz: Call SendMessages after ProcessMessage to increase coverage 2020-12-16 15:08:27 +01:00
MarcoFalke
a023094fc4
Merge #20276: test: run mempool_expiry.py even with wallet disabled
3b064fcb9d test: run mempool_expiry.py even with wallet disabled (Michael Dietz)

Pull request description:

  Run the mempool expiry test even when the wallet was not compiled, as proposed in https://github.com/bitcoin/bitcoin/issues/20078.

ACKs for top commit:
  MarcoFalke:
    ACK 3b064fcb9d

Tree-SHA512: 5860dc021d02bc3752268ec1e859505bec87174953223b34b1af8a8e4ab66d645458fbf9571c0b816a9de891c3ff41314996e580869671fccd6972c093e78154
2020-12-16 14:52:34 +01:00
Hennadii Stepanov
87fe104537
depends: Use more legible qmake commands in qt package
This change gets rid of multiple `../` that makes reasoning about the
script and its maintaining much easier.

Co-authored-by: fanquake <fanquake@gmail.com>
2020-12-16 15:21:31 +02:00
Hennadii Stepanov
bf35a8da6e
depends: Do not set build_subdir for qt package
This change makes the next commit possible without exporting the PATH
variable.
2020-12-16 15:21:24 +02:00
practicalswift
5a9ee0869b tests: Add fuzzing harness for node eviction logic 2020-12-16 13:00:47 +00:00
Jonas Schnelli
6af8a6232b
Merge #20650: depends: Drop workaround for a fixed bug in Qt build system
267f259c0d depends: Drop workaround for a fixed bug in Qt build system (Hennadii Stepanov)

Pull request description:

  This PR drops workaround that was [introduced](1dec09b341) for Qt 5.2.1 for a bug in Qt build system that has been fixed in Qt 5.3.0.

  The bug reports:
   - https://bugreports.qt.io/browse/QTBUG-35444
   - https://bugreports.qt.io/browse/QTBUG-32519

  I've noted this change is a part of the #19716, but I think that a separate commit with the documented reason will benefit it.

ACKs for top commit:
  laanwj:
    Code review ACK 267f259c0d
  jonasschnelli:
    code Review ACK 267f259c0d
  practicalswift:
    cr ACK 267f259c0d: patch looks correct

Tree-SHA512: b994f94776b4f8bb2f996095c87c7fef55e74d1e64852a890d664275e3739ec890ee388b10baa15445dd24ec7b971ce57d396cb062dbed933c18b6b69525349f
2020-12-16 13:59:04 +01:00
MarcoFalke
b440c33179
Merge #20477: net: Add unit testing of node eviction logic
fee88237e0 Assert eviction at >= 29 candidates. Assert non-eviction at <= 20 candidates. (practicalswift)
685c428de0 test: Add unit testing of node eviction logic (practicalswift)
ed73f8cee0 net: Move eviction node selection logic to SelectNodeToEvict(...) (practicalswift)

Pull request description:

  Add unit testing of node eviction logic.

  Closes #19966.

ACKs for top commit:
  jonatack:
    ACK fee88237e0
  MarcoFalke:
    ACK fee88237e0 🐼

Tree-SHA512: 0827c35609122ca42bfabb17feaaee35c191ab4dc2e428282af425a6c176eaeaff2789b74a4f7eb4ca6b8cb10603068e90ca800e6ef3bc3904d50e76616f7a2b
2020-12-16 13:30:55 +01:00
practicalswift
fee88237e0 Assert eviction at >= 29 candidates. Assert non-eviction at <= 20 candidates. 2020-12-16 12:00:15 +00:00
practicalswift
685c428de0 test: Add unit testing of node eviction logic 2020-12-16 12:00:15 +00:00
practicalswift
ed73f8cee0 net: Move eviction node selection logic to SelectNodeToEvict(...) 2020-12-16 12:00:15 +00:00
Luke Dashjr
198fff88f3 GUI: Define MAX_DIGITS_BTC for magic number in BitcoinUnits::format 2020-12-15 22:21:26 +00:00
Wladimir J. van der Laan
dff0f6f753
Merge #20611: Move TX_MAX_STANDARD_VERSION to policy
fade6195b1 Move TX_MAX_STANDARD_VERSION to policy (MarcoFalke)

Pull request description:

  `primitives` should only be used for the raw datastructures (parsing and format). It is not the right place to document relay policy.

ACKs for top commit:
  laanwj:
    Code review ACK fade6195b1
  lontivero:
    Concept ACK fade6195b1

Tree-SHA512: f809c4aecd14d7e9feaa7b50b9c0697232991eef36190cd960bcfb0ad6e20c71a4f6aab48c7747cf8a681eb14feda60c55b09a37f128673d519567224f29cd97
2020-12-15 22:46:49 +01:00
Wladimir J. van der Laan
c434e2cca9
Merge #20615: cirrus: Schedule one task with paid credits for faster CI feedback
faf2c6e32e cirrus: Schedule one task with paid credits for faster CI feedback (MarcoFalke)

Pull request description:

  During times of high activity in the repo, the scheduling of Cirrus CI tasks might put them a few hours in the future. This is fine when all the tasks eventually pass. Though for failing tasks, a failure should ideally be shown to the author and reviewer as soon as possible.

  Compute credits can be used to schedule immediately: https://cirrus-ci.org/pricing/#compute-credits. Running all tasks with compute credits will probably be more expensive than our previous CI invoice. However, they are also more flexible.

  As a start we could enable only a single task and revisit/re-evaluate the next steps in a month.

ACKs for top commit:
  laanwj:
    Concept ACK faf2c6e32e
  fanquake:
    ACK faf2c6e32e
  practicalswift:
    cr ACK faf2c6e32e: patch looks correct

Tree-SHA512: df599e1c4cc0394f7f03413ad29954ddc87b163b02640d8bfc0497a5dc8d237b8c963c1dd9d01ac83c4a044f575300763097dac2ea6d1a4a163a1cece342b743
2020-12-15 21:49:46 +01:00
Pieter Wuille
37fe80e626 Only consider addrv2 peers for relay of non-addrv1 addresses 2020-12-15 12:45:41 -08:00
Pieter Wuille
83f8821a6f refactor: add IsAddrCompatible() to CNode 2020-12-15 12:45:32 -08:00
Wladimir J. van der Laan
d9a4738c9d
Merge #20660: Move signet onion seed from v2 to v3
3e6657a14d Move signet onion seed from v2 to v3 (Sjors Provoost)

Pull request description:

  Since v0.21 hidden services use the longer v3 address format.

  It may make sense to backport this to the v0.21 branch, although onion nodes can always use the non-onion seeds.

ACKs for top commit:
  MarcoFalke:
    Concept ACK 3e6657a14d
  laanwj:
    ACK 3e6657a14d
  Saibato:
    tACK 3e6657a14d  👍

Tree-SHA512: 9bb4d82345ab25d6ea971f8f106c30778ade2ba11a292e8d7449ea39581b91e51c4b34851b5c06f5dfbe07e7b04e5dc92c48c98c47a1c7ef3d5f350c3a3ad4f7
2020-12-15 21:38:33 +01:00
Dhruv Mehta
739d39022d ci: Move linter task to cirrus 2020-12-15 10:13:55 -08:00
MarcoFalke
8bb40d5f56
Merge #20560: fuzz: Link all targets once
fa13e1b0c5 build: Add option --enable-danger-fuzz-link-all (MarcoFalke)
44444ba759 fuzz: Link all targets once (MarcoFalke)

Pull request description:

  Currently the linker is invoked more than 150 times when compiling with `--enable-fuzz`. This is problematic for several reasons:

  * It wastes disk space north of 20 GB, as all libraries and sanitizers are linked more than 150 times
  * It wastes CPU time, as the link step can practically not be cached (similar to ccache for object files)
  * It makes it a blocker to compile the fuzz tests by default for non-fuzz builds #19388, for the aforementioned reasons
  * The build file is several thousand lines of code, without doing anything meaningful except listing each fuzz target in a highly verbose manner
  * It makes writing new fuzz tests unnecessarily hard, as build system knowledge is required; Compare that to boost unit tests, which can be added by simply editing an existing cpp file
  * It encourages fuzz tests that re-use the `buffer` or assume the `buffer` to be concatenations of seeds, which increases complexity of seeds and complexity for the fuzz engine to explore; Thus reducing the effectiveness of the affected fuzz targets

  Fixes #20088

ACKs for top commit:
  practicalswift:
    Tested ACK fa13e1b0c5
  sipa:
    ACK fa13e1b0c5. Reviewed the code changes, and tested the 3 different test_runner.py modes (run once, merge, generate). I also tested building with the new --enable-danger-fuzz-link-all

Tree-SHA512: 962ab33269ebd51810924c51266ecc62edd6ddf2fcd9a8c359ed906766f58c3f73c223f8d3cc49f2c60f0053f65e8bdd86ce9c19e673f8c2b3cd676e913f2642
2020-12-15 19:00:36 +01:00
MarcoFalke
a35a3466ef
Merge #20653: doc: Move addr relay comment in net to correct place
fa86217e97 doc: Move add relay comment in net to correct place (MarcoFalke)

Pull request description:

  The comment was previously attached to `m_addr_known`, but now it is attached to `id`, which is wrong.

  Fix that by moving the comment to `RelayAddrsWithConn`.

ACKs for top commit:
  practicalswift:
    cr ACK fa86217e97: patch looks correct
  jnewbery:
    ACK fa86217e97
  theStack:
    Code review ACK fa86217e97 🌳

Tree-SHA512: ec3d5f1996aded38947d2a5fd0bb63539e88f83964cd3254984002edfd51abb4dde813c7c81619a8a3a5c55b7e9ae83c8c5be8ad6c84b4593ed3bbf463fe8979
2020-12-15 17:56:11 +01:00
Wladimir J. van der Laan
ec6149c01e
Merge #20616: Check CJDNS address is valid
f7264fff0a Check if Cjdns address is valid (Lucas Ontivero)

Pull request description:

  CJDNS addresses start with 0xFC and for that reason if a netaddr was unserialized with network type cjdns but its address prefix is not 0xFC then that netaddr should be considered invalid.

ACKs for top commit:
  jonatack:
    ACK f7264fff0a
  practicalswift:
    cr ACK f7264fff0a: patch looks correct
  theStack:
    ACK f7264fff0a ✔️

Tree-SHA512: 5300df2ffbbd69c40271b6d8df96cca98eb3e1ee76aba62c9c76025d083788ab1f1332775890c63b06e02ca593863a867cd53956bce5962383e8450487898669
2020-12-15 17:51:41 +01:00
Wladimir J. van der Laan
cd03513dc2 init: Signal-safe instant shutdown
Replace the 200ms polling loop with a faster and more efficient waiting
operation.

This was tried a few times before, but given up every time because
solutions use a condition variable which is not safe for use in signals
as they need to be reentrant.

On UNIX-ish OSes, use a safe way: a pipe. When shutdown is requested
write a dummy byte to the pipe. Waiting for shutdown is a matter of a
blocking read from the pipe.

On Windows, there are no signals so using a condition variable is safe.
2020-12-15 17:21:06 +01:00
MarcoFalke
70150824dc
Merge #20437: fuzz: Avoid time-based "non-determinism" in fuzzing harnesses by using mocked GetTime()
8c09c0c1d1 fuzz: Avoid time-based "non-determinism" in fuzzing harnesses by using mocked GetTime() (practicalswift)

Pull request description:

  Avoid time-based "non-determinism" in fuzzing harnesses by using mocked `GetTime()`.

  Prior to this commit the fuzzing harnesses `banman`, `connman`, `net` and `rbf` had time-based "non-determinism". `addrman` is fixed in #20425. `process_message` and `process_messages` are left to fix: simply using mock time is not enough for them due to interaction with `IsInitialBlockDownload()`.

  See [`doc/fuzzing.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md) for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the [Bitcoin Core fuzzing corpus repo](https://github.com/bitcoin-core/qa-assets).

  Happy fuzzing :)

ACKs for top commit:
  MarcoFalke:
    review ACK 8c09c0c1d1
  practicalswift:
    > review ACK [8c09c0c](8c09c0c1d1)

Tree-SHA512: 32dfbead3dfd18cf4ff56dc2ea341aa977441b4e19a54879cf54fa5820c7e2b14b92c7e238d32fd785654f3b28cc82826ae66c03e94c292633c63c41196ba9a8
2020-12-15 17:11:59 +01:00
Sjors Provoost
3e6657a14d
Move signet onion seed from v2 to v3 2020-12-15 14:12:01 +01:00
fanquake
f1f2418433
Merge #20253: net: use std::chrono throughout maxOutbound logic
0475c8ba4d net: use std::chrono throughout maxOutbound logic (fanquake)
f805933e70 init: set nMaxOutboundLimit connection option directly (fanquake)
173d0d35f1 net: remove nMaxOutboundTimeframe from connection options (fanquake)
b117eb1486 net: remove SetMaxOutboundTimeframe (fanquake)
2f3f1aec1f net: remove SetMaxOutboundTarget (fanquake)

Pull request description:

  Switch to using `std::chrono` types for the max outbound related logic.
  Removes some unnecessary code from init.

ACKs for top commit:
  jnewbery:
    utACK 0475c8ba4d
  MarcoFalke:
    review ACK 0475c8ba4d 🎭

Tree-SHA512: 5a6d5b61e0d4c08a235cfc0257dae65d09a5df019d8d230b1a58a3e2483ddf4a31efdefc885c4a02e4715e4180b0ed92ebc0a1c08b2bf476a391945114593514
2020-12-15 20:48:21 +08:00
Jonas Schnelli
33d6337269
Merge bitcoin-core/gui#115: Replace "Hide tray icon" option with positive "Show tray icon" one
03edb52eee qt: Remove redundant BitcoinGUI::setTrayIconVisible (Hennadii Stepanov)
17174f8328 gui: Replace "Hide tray icon" option with positive "Show tray icon" one (Hennadii Stepanov)

Pull request description:

  This change makes easier both (1) using this option, and (2) reasoning about the code.

ACKs for top commit:
  jonasschnelli:
    utACK 03edb52eee

Tree-SHA512: 38e317492210d4fb13302dea383bd1f4f0ae1219d7ff2fdcb78607f15ac61a51969acaadb59b72c3f075b6356ef54368eb46fb49e6e1bd42db6d5804b97e232b
2020-12-15 09:28:50 +01:00
Wladimir J. van der Laan
94a9cd25fd
Merge #20594: Fix getauxval calls in randomenv.cpp
836a3dc02c Avoid weak-linked getauxval support on non-linux platforms (like macOS) (Jonas Schnelli)
41a413b317 Define correct symbols for getauxval (Jonas Schnelli)

Pull request description:

  PR #20358 made use of the two preprocessor symbols `HAVE_STRONG_GETAUXVAL` as well as `HAVE_WEAK_GETAUXVAL`.

  These symbols have not been defined in configure.ac. They where only passed selective as CRC32 CPPFLAGS in https://github.com/bitcoin/bitcoin/blob/master/src/Makefile.crc32c.include#L16.

  PR #20358 would have broken the macOS build since `getauxval` is not supported on macOS (but weak-linking does pass).

  This PR defines the two symbols correctly and reduces calls to `getauxval` to linux.

ACKs for top commit:
  laanwj:
    Code review ACK 836a3dc02c
  jonatack:
    utACK 836a3dc02c

Tree-SHA512: 6527f4a617b937f4c368a3cb1c162f1ac38a6f5e6341295554961eaf322906e9b27398a6f7b00819854ceebb5c828d3e6ce0a779edd769adc4053ce8beda3739
2020-12-14 21:03:40 +01:00
Lucas Ontivero
f7264fff0a Check if Cjdns address is valid 2020-12-14 14:48:52 -03:00
MarcoFalke
fa86217e97
doc: Move add relay comment in net to correct place
Can be reviewed with
--ignore-all-space --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
2020-12-14 18:15:51 +01:00
MarcoFalke
fff7d056a9
Merge #20599: net processing: Tolerate sendheaders and sendcmpct messages before verack
b316dcb758 [net processing] Tolerate sendheaders and sendcmpct messages before verack (John Newbery)

Pull request description:

  BIP 130 (sendheaders) and BIP 152 (compact blocks) do not specify at
  which stage the `sendheaders` or `sendcmpct` messages should be sent.
  Therefore we should tolerate them being sent before the version-verack
  handshake is complete.

ACKs for top commit:
  MarcoFalke:
    review ACK b316dcb758 📒
  jonatack:
    Code review re-ACK b316dcb758 per `git range-diff b103fdcb 82d0a43 b316dcb`, rebase only
  luke-jr:
    utACK b316dcb758, only code movement from after verack check to before

Tree-SHA512: a8da3990a786a53c195a33cd278eb9d1b6b09e9a33717674d5bc6ef5629811189216f3eda1a3dd11f6972b9680c7b7a532bf7343b6e7440009dd831bef128e1d
2020-12-14 17:10:55 +01:00