Commit Graph

27574 Commits

Author SHA1 Message Date
gzhao408
f82baf0762 [refactor] return MempoolAcceptResult
This creates a cleaner interface with ATMP, allows us to make results const,
and makes accessing values that don't make sense (e.g. fee when tx is
invalid) an error.
2021-02-09 07:01:52 -08:00
Kiminuo
059e8ccc1e Change BOOST_CHECK to BOOST_CHECK_EQUAL to see mismatched values when a check fails.
See https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref/assertion_boost_level_eq.html
2021-02-09 15:00:02 +01:00
Bruno Garcia
c9095b738f test: remove unnecessary assignment in bdb 2021-02-09 10:22:50 -03:00
Wladimir J. van der Laan
b847f49717
Merge #20557: addrman: Fix new table bucketing during unserialization
4676a4fb5b [addrman] Don't repeat "Bucketing method was updated" log multiple times (John Newbery)
436292367c [addrman] Improve serialization comments (John Newbery)
ac3547eddd [addrman] Improve variable naming/code style of touched code. (John Newbery)
a5c9b04959 [addrman] Don't rebucket new table entries unnecessarily (John Newbery)
8062d928ce [addrman] Rename asmap version to asmap checksum (John Newbery)
009b8e0fdf [addrman] Improve variable naming/code style of touched code. (John Newbery)
b4c5fda417 [addrman] Fix new table bucketing during unserialization (John Newbery)

Pull request description:

  This fixes three issues in addrman unserialization.

  1. An addrman entry can appear in up to 8 new table buckets. We store this entry->bucket indexing during shutdown so that on restart we can restore the entries to their correct buckets. Commit ec45646de9 broke the deserialization code so that each entry could only be put in up to one new bucket.

  2. Unserialization may result in an entry appearing in a 9th bucket. If the entry already appears in 8 buckets don't try to place it in another bucket.

  3. We unnecessarily rebucket when reading a peers.dat with file version 1. Don't do that.

ACKs for top commit:
  vasild:
    ACK 4676a4fb5b
  glozow:
    re-ACK 4676a4fb5b, changes were a rename, comments, and removing repeat-logging.
  naumenkogs:
    ACK 4676a4f
  laanwj:
    Code review ACK 4676a4fb5b
  dhruv:
    ACK 4676a4fb5b
  ryanofsky:
    Code review ACK 4676a4fb5b. I'm not previously familiar with this code but all the changes here do make sense and seem like improvements. Left some notes and comments, but they aren't important so feel to ignore.

Tree-SHA512: b228984f6dec5910be23c3740ae20258da33bcf66ceb7edb10e5a53163450f743bab349e47f09808b7e8d40f27143119ec3e0981d7e678aa494d8559a1c99c23
2021-02-09 12:36:32 +01:00
MarcoFalke
3641ec1aac
Merge #21112: ci: use Focal for macOS cross builds
ac24af453d ci: use Ubuntu Focal for macOS cross build (fanquake)

Pull request description:

  I had assumed Cirrus was spinning up Docker containers to run the CI,
  however we are actaully running on the Cirrus machines themselves. See
  `DANGER_RUN_CI_ON_HOST` and in the logs:
  ```bash
  Running on host system without docker wrapper
  ```

  So with this change we will actually be using Focal for the macOS cross build.

  Follow up to #21036.

  This originally contained Windows changes, and an attempt to get Cirrus running without `DANGER_RUN_CI_ON_HOST`, however that seems non-trival, so Windows changes have been dropped from here for now.

ACKs for top commit:
  MarcoFalke:
    cr ACK ac24af453d

Tree-SHA512: 587ba5acf741bcefecf1bc262fa1177f565ebfa9de56125eca19ed3c7db7b9aabfb96866e9c140681b88cb7015a3ded2bc6b4b1b235543d6f6e9dfc6984d569f
2021-02-09 08:00:33 +01:00
MarcoFalke
19b1ceddc7
Merge #21075: doc: Fix markdown formatting
e1604b3d50 doc: Replace tabs for spaces (Gunar C. Gessner)
98db48d349 doc: Fix markdown formatting (Gunar Gessner)

Pull request description:

  Lines were being joined making it hard to read.

ACKs for top commit:
  RandyMcMillan:
    ACK e1604b3d50

Tree-SHA512: fd5a7c5e9a1cbbf0fbb13b5c30b87853c84751da7f0fad08151bda07f1933872ab51cad29a0c0a70ced48e60df6d83bff3f84c2f77d00d22723fae9a8c3534fc
2021-02-09 07:56:44 +01:00
MarcoFalke
c4214d0e0d
Merge #21117: test: remove assert_blockchain_height
fa0a4d6c60 test: remove assert_blockchain_height (MarcoFalke)

Pull request description:

  This simplifies the code and solves intermittent timeouts caused by commit 0d39b5848a.

  E.g. https://cirrus-ci.com/task/5196092369272832?command=ci#L3126

  ```
   test  2021-02-08T12:27:56.275000Z TestFramework (ERROR): Assertion failed
                                     Traceback (most recent call last):
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 127, in main
                                         self.run_test()
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_assumevalid.py", line 180, in run_test
                                         self.assert_blockchain_height(self.nodes[0], 101)
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_assumevalid.py", line 92, in assert_blockchain_height
                                         assert False, "blockchain too short after timeout: %d" % current_height
                                     AssertionError: blockchain too short after timeout: 101

ACKs for top commit:
  glozow:
    ACK fa0a4d6c60

Tree-SHA512: 3859b0c1581c21f03c775f119204cc3a219e5d86346883634886f6da46feaf254b9c6c49c1ec4581ffe409cdf05f6e91ec38c3976c3daf4a9e67f96ddc1e0dce
2021-02-09 07:43:47 +01:00
fanquake
a0077a80b0
Merge #21116: build: Disable --disable-fuzz-binary for gitian/guix builds
cb151b797a build: Disable --disable-fuzz-binary for guix builds (Hennadii Stepanov)
fd7caae35f build: Disable --disable-fuzz-binary for gitian builds (Hennadii Stepanov)

Pull request description:

  Fuzz binary is not shipped to users.
  This PR saves hundreds MB of the disk space for containers.

ACKs for top commit:
  MarcoFalke:
    review ACK cb151b797a
  fanquake:
    ACK cb151b797a

Tree-SHA512: 858e3816576c307b47915bb05de79a28029beaef8835c01f1bd6a764a0cf7f7f63ef8c2dc2c5944cb36cc9f4788d9b0590b8a5dda96940167252ba371cdbd078
2021-02-09 14:22:11 +08:00
fanquake
ac24af453d
ci: use Ubuntu Focal for macOS cross build 2021-02-09 13:58:59 +08:00
fanquake
d864696649
Merge #21115: test: Fix Windows cross build
723eb4326b test: Fix Windows cross build (Hennadii Stepanov)

Pull request description:

  On master (e51f6c4dee, after #20936 merge), Windows cross compiling fails:
  ```
  $ make > /dev/null
  In file included from ./policy/fees.h:12,
                   from policy/fees.cpp:6:
  policy/fees.cpp: In member function ‘unsigned int CBlockPolicyEstimator::HighestTargetTracked(FeeEstimateHorizon) const’:
  ./sync.h:232:104: warning: control reaches end of non-void function [-Wreturn-type]
    232 | #define LOCK(cs) DebugLock<decltype(cs)> PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__)
        |                                                                                                        ^
  policy/fees.cpp:680:5: note: in expansion of macro ‘LOCK’
    680 |     LOCK(m_cs_fee_estimator);
        |     ^~~~
  test/fuzz/netaddress.cpp:12:10: fatal error: netinet/in.h: No such file or directory
     12 | #include <netinet/in.h>
        |          ^~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [Makefile:13039: test/fuzz/fuzz-netaddress.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  libtool: warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries; building static only
  test/fuzz/string.cpp: In function ‘void string_fuzz_target(FuzzBufferType)’:
  test/fuzz/string.cpp:81:11: error: ‘ShellEscape’ was not declared in this scope
     81 |     (void)ShellEscape(random_string_1);
        |           ^~~~~~~~~~~
  make[2]: *** [Makefile:13543: test/fuzz/fuzz-string.o] Error 1
  make[1]: *** [Makefile:15078: all-recursive] Error 1
  make: *** [Makefile:812: all-recursive] Error 1
  ```

  This PR fixes both of errors.

ACKs for top commit:
  MarcoFalke:
    cr ACK 723eb4326b

Tree-SHA512: 5d2fba5ca806e64bf92011786d1f868c6624f786bfa753a10316feab7a802a28ec27a4bd25fc26dc289a399895a521c3878ffa1efeff0e540c7245cdb8e4942c
2021-02-09 13:48:26 +08:00
MarcoFalke
b09ad737ee
Merge #20944: rpc: Return total fee in getmempoolinfo
fa362064e3 rpc: Return total fee in mempool (MarcoFalke)

Pull request description:

  This avoids having to loop over the whole mempool to query each entry's fee

ACKs for top commit:
  achow101:
    ACK fa362064e3
  glozow:
    ACK fa362064e3 🧸
  jnewbery:
    ACK fa362064e3

Tree-SHA512: e2fa1664df39c9e187f9229fc35764ccf436f6f75889c5a206d34fff473fc21efbf2bb143f4ca7895c27659218c22884d0ec4195e7a536a5a96973fc9dd82d08
2021-02-08 20:36:46 +01:00
MarcoFalke
fa0a4d6c60
test: remove assert_blockchain_height 2021-02-08 16:56:46 +01:00
Hennadii Stepanov
cb151b797a
build: Disable --disable-fuzz-binary for guix builds 2021-02-08 16:41:05 +02:00
Hennadii Stepanov
fd7caae35f
build: Disable --disable-fuzz-binary for gitian builds 2021-02-08 15:38:26 +02:00
Hennadii Stepanov
723eb4326b
test: Fix Windows cross build 2021-02-08 15:17:48 +02:00
MarcoFalke
b401b09355
Merge #21107: test: remove type: comments in favour of actual annotations
9913419cc9 test: remove type: comments in favour of actual annotations (fanquake)

Pull request description:

  Now that we require Python 3.6+, we should be using variable type
  annotations directly rather than `# type:` comments.

  Also takes care of the discarded value issue in p2p_message_capture.py.
  See: https://github.com/bitcoin/bitcoin/pull/19509/files#r571674446.

ACKs for top commit:
  MarcoFalke:
    review ACK 9913419cc9
  jnewbery:
    Code review ACK 9913419cc9

Tree-SHA512: 63aba5eef6c1320578f66cf8a6d85ac9dbab9d30b0d21e6e966be8216e63606de12321320c2958c67933bf68d10f2e76e9c43928e5989614cea34dde4187aad8
2021-02-08 10:56:54 +01:00
MarcoFalke
ca85449f22
Merge #21036: gitian: Bump descriptors to Focal for 22.0
2ecaf21433 gitian: remove execstack workaround for ricv64 & powerpc64le (fanquake)
5baff2b318 build: use focal in gitian descriptors (fanquake)

Pull request description:

  This PR changes the gitian descriptors to use Ubuntu Focal (20.04), over Bionic (18.04), moving from GCC 7.5 to GCC 8.4 for native Linux builds, mingw-w64 GCC 7.3 to mingw-w64 GCC 9.3 for Windows builds, while continuing to use GCC 8.4 for all cross builds and Clang 8.0.0 for macOS builds.

  It also drops the `-Wl,-z,noexecstack` workaround we've been using for the riscv64 and powerpc64le hosts, as it's no-longer needed. One new package is installed in the osx build, `libtinfo5`, as libtinfo5.so is required by our downloaded Clang 8.

  A bump to Focal will at least be required if we want to update to a newer Qt (5.15, #19716) for 22.0, as we need a newer version of [`g++-mingw-w64`](https://packages.ubuntu.com/focal/g++-mingw-w64-x86-64) and the [`mingw-w64`](https://mingw-w64.org/doku.php) headers. This can still be done while continuing to use GCC 8.4 for Linux builds (see below), however the newer `g++-mingw-w64` will be based off of GCC 9.3.

  **Some considerations**

  GCC 9 is affected by #20005 "memcmp with constants that contain zero bytes are broken in GCC", and the newer `g++-mingw-w64` will be based off of GCC 9.3.

  The `--no-*` variants of the Windows linker flags (i.e `--no-dynamicbase`) we use to [test our `security-check.py` script](16b784d953/contrib/devtools/test-security-check.py (L53)) are not patched into the mingw binutils in Focal (they have been re-added in Groovy (20.10)). This isn't currently an issue, however, we might add a call to `test-security-check` for Guix (#20980), and if we wanted to do the same for gitian, it would not work. Note how it's quite "easy" for us to apply the `--no-*` variant patch to our Guix build; it would be quite a bit harder to do in Gitian.

  Gitian Builds @ 2ecaf21433

  #### Linux
  ```bash
  8882ea78486fbae4fac574b9089eb1107c6372d0dd7dfcda4f0f930576f9d6c1  bitcoin-2ecaf214331b-aarch64-linux-gnu-debug.tar.gz
  50a9e30943b4eee5163edff3331241e745ff32a2c4463c21a6fdc5986e2d0383  bitcoin-2ecaf214331b-aarch64-linux-gnu.tar.gz
  ec4e55a447fddf033fee33cd5f22bfeda3c3612f059194bcf6238859f7989d7a  bitcoin-2ecaf214331b-arm-linux-gnueabihf-debug.tar.gz
  444fe1b3b933c00bcbd4a9d86888cff3b61c1215b1debccd2843e842d1224777  bitcoin-2ecaf214331b-arm-linux-gnueabihf.tar.gz
  88e486ff465980dc1a4aab9687d142ec6f727ed2c52cf539f69db2877dee83b2  bitcoin-2ecaf214331b-powerpc64-linux-gnu-debug.tar.gz
  66144ac264c65cada9d86446e6026c85b04fb88198b8f41b42840f6031db3e6c  bitcoin-2ecaf214331b-powerpc64-linux-gnu.tar.gz
  34bcc13d78d929d575e34e77a6672f23ca7ea23230b28ec2eed563889352ba86  bitcoin-2ecaf214331b-powerpc64le-linux-gnu-debug.tar.gz
  b4c5f959664f3063df4330edfe343c17120eb6b556ee1c15c4aeb2c1c54ffd49  bitcoin-2ecaf214331b-powerpc64le-linux-gnu.tar.gz
  918fa72ab6f6ebce4e9663c93f72fe26651c260477cbb54749f7eb61438b5cc1  bitcoin-2ecaf214331b-riscv64-linux-gnu-debug.tar.gz
  f704f9f8c053ffe37d854e2e81e0f4c0614c435dad7f5d82518c681b73a76ae6  bitcoin-2ecaf214331b-riscv64-linux-gnu.tar.gz
  b59e3a62f1df9d79f30e916b3c9655f654036fe3a420040c53acc8dd9f4162c5  bitcoin-2ecaf214331b-x86_64-linux-gnu-debug.tar.gz
  a4dc9ca877cc97544e65db11be38406d16f15d74fcdcd2318bb92474729bc60d  bitcoin-2ecaf214331b-x86_64-linux-gnu.tar.gz
  b40ba2d5da498330ade92a4ccebcceb1452b94c8ffeacb336f87e93b5c88d8af  src/bitcoin-2ecaf214331b.tar.gz
  af6ebc91147778e4e6705eade62608dde4d6e60522d79087fa9129bdb7c01199  bitcoin-core-linux-22-res.yml
  ```

  #### Windows
  ```bash
  121a3970a6911cb8c453b2ce37d03f6cbb43333e29db8fa516c68563fb367f43  bitcoin-2ecaf214331b-win-unsigned.tar.gz
  6294e9efebe935092f9ba119dc60ad4094f18b51c4181324e54d3057524d6101  bitcoin-2ecaf214331b-win64-debug.zip
  5b5a236b63e67f5f6c07ad9aa716aa7b72fb63722c96798b332c6d164738f9cf  bitcoin-2ecaf214331b-win64-setup-unsigned.exe
  c1fa5894c5e02a201637567c80b9bde9024f44673dcd06fd4d489c1709179279  bitcoin-2ecaf214331b-win64.zip
  b40ba2d5da498330ade92a4ccebcceb1452b94c8ffeacb336f87e93b5c88d8af  src/bitcoin-2ecaf214331b.tar.gz
  665fd7eb61aed368150db58a254f15fb5efb51a4efa5abcc52571cb7a1a5de22  bitcoin-core-win-22-res.yml
  ```

  #### macOS
  ```bash
  6a1deae7662aa782baa82a42590f862c6bcdc4f4e38daa9b8c2a9eed1fbb5397  bitcoin-2ecaf214331b-osx-unsigned.dmg
  1ee843266e84928a4323fa255c833528c2617a2c9fd2f98fb26ba19bbfc1227b  bitcoin-2ecaf214331b-osx-unsigned.tar.gz
  097b64dadc167d8e5b733421bf1541a40760ad952990f7cf3f35adc6ae2616d0  bitcoin-2ecaf214331b-osx64.tar.gz
  b40ba2d5da498330ade92a4ccebcceb1452b94c8ffeacb336f87e93b5c88d8af  src/bitcoin-2ecaf214331b.tar.gz
  6e378fb543928e40c7119b96be6ff773d38506a9a888f8b02c7f1b8a0801a80e  bitcoin-core-osx-22-res.yml
  ```

ACKs for top commit:
  laanwj:
    Build script changes review ACK 2ecaf21433

Tree-SHA512: 975d5830b787d2e08988f43cbc6e839294171c1d94c8219636308b05f9b77041421612ae67be24a631674670cfc9c2d96d8177f2b3158a78fc3deea19631febf
2021-02-08 10:44:37 +01:00
MarcoFalke
c969ab43c3
Merge #21084: test: fix timeout decrease in feature_assumevalid
0d39b5848a test: fix timeout decrease in feature_assumevalid (Bruno Garcia)

Pull request description:

  This PR fixes the timeout decrease in assert_blockchain_height function.

ACKs for top commit:
  practicalswift:
    cr ACK 0d39b5848a: patch looks correct
  theStack:
    ACK 0d39b5848a ⏲️

Tree-SHA512: ae3c83420b4de4ad41f1b20b6e77c3a26a8c5ac4fb136b2645fde119545a413c61312f76a16473141774bc955d30ac4fc86e5ca6cf729f8978a17d0dab520feb
2021-02-08 10:38:52 +01:00
MarcoFalke
fac726b1b8
doc: Fixup docs in fuzz/script_assets_test_minimizer.cpp 2021-02-08 10:12:22 +01:00
MarcoFalke
fafca47adc
fuzz: Hide script_assets_test_minimizer
Can be reviewed with --ignore-all-space
2021-02-08 10:11:59 +01:00
MarcoFalke
e51f6c4dee
Merge #20936: build: build fuzz tests by default
32cbb06676 build: build fuzz tests by default. (Dan Benjamin)

Pull request description:

  This fixes issue #19388. The changes are as follows:
    - Add a new flag to configure, --enable-fuzz-binary, which allows building test/fuzz/fuzz regardless of whether we are building to do actual fuzzing
    - Set -DPROVIDE_MAIN_FUNCTION whenever --enable-fuzz is no
    - Add the following libraries to FUZZ_SUITE_LD_COMMON:
      - LIBBITCOIN_WALLET
      - SQLLITE_LIBS
      - BDB_LIBS
      - if necessary, some or all of:
        - NATPMP_LIBS
        - MINIUPNPC_LIBS
        - LIBBITCOIN_ZMQ / ZMQ_LIBS

  Fixes  #19388

ACKs for top commit:
  MarcoFalke:
    review ACK 32cbb06676 📭

Tree-SHA512: c91d713ffe54a3d055daaec02c4317d7e13eed6688821ddc10d894224950b18e276fbdd4acc758c7103b50f34a132b1882b68bc8b60409f97438e0759ced77e1
2021-02-08 10:07:15 +01:00
fanquake
8636288db1
Merge #20720: build: more robustly check for fcf-protection support
e9189a750b build: more robustly check for fcf-protection support (fanquake)

Pull request description:

  When using Clang 7, we may end up trying to use the flag when it won't
  work properly, which can lead to confusing errors. i.e:
  ```bash
  /usr/bin/ld: error: ... <corrupt x86 feature size: 0x8>
  ```

  Use `AX_CHECK_LINK_FLAG` & `--fatal-warnings` to ensure we wont use the flag in this case.

  We do this as even when the error is emitted, compilation succeeds, and the binaries produced will run. This means we can't just check if the compiler accepts the flag, or if compilation succeeds (without or without `-Werror`, and/or passing `-Wl,--fatal-warnings`, which may not be passed through to the linker).

  This was reported by someone configuring for fuzzing, on Debian 10, where Clang 7 is the default.

  See here for a minimal example of the problematic behaviour:
  https://gist.github.com/fanquake/9b33555fcfebef8eb8c0795a71732bc6

ACKs for top commit:
  pstratem:
    tested ACK e9189a750b
  MarcoFalke:
    not an ACK e9189a750b , I only tested configure on my system (gcc-10, clang-11):
  hebasto:
    ACK e9189a750b, tested with clang-7, clang-10 and gcc: the `-fcf-protection=full` is not applied for clang-7, but applied for others compilers.

Tree-SHA512: ec24b0cc5523b90139c96cbb33bb98d1e6a24d858c466aa7dfb3c474caf8c50aca53e570fdbc0ff88378406b0ac5d687542452637b1b5fa062e829291b886fc1
2021-02-08 13:45:23 +08:00
fanquake
9913419cc9
test: remove type: comments in favour of actual annotations
Now that we require Python 3.6+, we should be using variable type
annotations directly rather than # type: comments.

Also takes care of the discarded value issue in p2p_message_capture.py.
See: https://github.com/bitcoin/bitcoin/pull/19509/files#r571674446.
2021-02-08 13:24:44 +08:00
fanquake
cf26ca3911
Merge #21081: test: fix the unreachable code at feature_taproot
5e0cd25e29 fix the unreachable code at feature_taproot (Bruno Garcia)

Pull request description:

  This PR removes the unnecessary return statement at the beginning of the function that makes the rest of the function unreachable.

ACKs for top commit:
  practicalswift:
    cr ACK 5e0cd25e29: patch looks correct!
  sipa:
    ACK 5e0cd25e29.
  theStack:
    Tested ACK 5e0cd25e29 🏔️
  sanket1729:
    tACK 5e0cd25e29. I noted this a while ago while fixing feature_taproot.py for elements. Verified that the extreme ranges of CScriptNum are correct and the overflow case for `CHECKSIGADD` works as intended. Adding 1 to 2^31 - 1 results in an overflow, but the interpreter puts a `vch` of corresponding to 2^31 on stack. Even though it cannot be converted to CscriptNum(restricted to 4 bytes), it's result can still be compared by OP_EQUAL.

Tree-SHA512: fff9be3be94f4b3f3ccf24bf588d96e84d14806f82692dccd31631b0e5c79a7575a96c308cb5a4f610ab02e2f854b899f374437c33ecf6d52055d333f2de9b27
2021-02-08 10:24:37 +08:00
fanquake
1815847103
Merge #21105: docs: correctly identify script type
4ed064dbd9 docs: correctly identify script type (lisa neigut)

Pull request description:

  Fix a typo.

ACKs for top commit:
  sipa:
    ACK 4ed064dbd9
  darosior:
    ACK 4ed064dbd9
  theStack:
    ACK 4ed064dbd9

Tree-SHA512: 94572fde89865a085020767f9de58f41c6b1c8f714c0bc6c256a4fc419a2693ce8a33d953d4c75542495ae72882d10846354db751770e85d3d694d88e0378843
2021-02-08 08:54:05 +08:00
lisa neigut
4ed064dbd9
docs: correctly identify script type
fixes a typo
2021-02-07 12:20:01 -06:00
Dan Benjamin
32cbb06676 build: build fuzz tests by default.
This fixes issue #19388. The changes are as follows:
  - Add a new flag to configure, --enable-fuzz-binary, which allows building test/fuzz/fuzz regardless of whether we are building to do actual fuzzing
  - Set -DPROVIDE_MAIN_FUNCTION whenever --enable-fuzz is no
  - Add the following libraries to FUZZ_SUITE_LD_COMMON:
    - LIBBITCOIN_WALLET
    - SQLLITE_LIBS
    - BDB_LIBS
    - if necessary, some or all of:
      - NATPMP_LIBS
      - MINIUPNPC_LIBS
      - LIBBITCOIN_ZMQ / ZMQ_LIBS
2021-02-05 19:52:45 -05:00
Jonas Schnelli
6c6140846f
Merge bitcoin-core/gui#203: Display plain "Inbound" in peer details
506e6585a5 gui: display plain "Inbound" in peer details (Jon Atack)

Pull request description:

  Alternative version to #201.

ACKs for top commit:
  MarcoFalke:
    ACK 506e6585a5
  jonasschnelli:
    utACK 506e6585a5

Tree-SHA512: 88d141b14684c1dcdff47f7ba241e5a7c42c14da3d9aaa89f1649235a64fd26bc5a6055707dc07992cd9d8c05d143754f6dd51ccee69fd4309336dd07c52e61c
2021-02-05 18:48:39 +01:00
Wladimir J. van der Laan
173cf31299
Merge #20839: fuzz: Avoid extraneous copy of input data, using Span<>
faf7d7418c fuzz: Avoid extraneous copy of input data, using Span<> (MarcoFalke)

Pull request description:

  Seeing speedup here in the fuzz framework part (non-fuzz-target part). Speedup is only visible for input data larger than 100kB.

ACKs for top commit:
  practicalswift:
    cr ACK faf7d7418c: patch looks correct :)
  laanwj:
    Code review ACK faf7d7418c

Tree-SHA512: 41af7118846e0dfee237a6d5269a6c7cfbc775d7bd1cc2a85814cb60f6c2b37fe7fd35f1a788d4f08e6e0202c48b71054b67d2931160c445c79fc59e5347dadf
2021-02-05 14:57:08 +01:00
Wladimir J. van der Laan
b829894f84
Merge #20764: cli -netinfo peer connections dashboard updates 🎄
747cb5b994 netinfo: display only outbound block relay counts (Jon Atack)
76d198a5c1 netinfo: add i2p network (Jon Atack)
9d6aeca2c5 netinfo: add bip152 high-bandwidth to/from fields (Jon Atack)
5de7a6cf63 netinfo: display manual peers count (Jon Atack)
d3cca3be63 netinfo: update to use peer connection types (Jon Atack)
62bf5b7850 netinfo: add ConnectionTypeForNetinfo member helper function (Jon Atack)

Pull request description:

  Merry Bitcoin Christmas! Ho ho ho 🎄 

  This PR updates `-netinfo` to:
  - use the getpeerinfo `connection_type` field (and no longer use getpeerinfo `relaytxes` for block-relay detection)
  - display manual peers count, if any, in the outbound row
  - display the block relay counts in the outbound row only
  - display high-bandwidth BIP152 compact block relay peers (`hb` column, to `.` and from `*`)
  - add support for displaying I2P network peers, if any are present

  Testing and review welcome! How to test:

  - to run the full live dashboard (on Linux): `$ watch --interval 1 --no-title ./src/bitcoin-cli -netinfo 4`
  - to run the full dashboard: ``$ ./src/bitcoin-cli -netinfo 4``
  - to see the help: `$ ./src/bitcoin-cli -netinfo help`
  - to see the help summary: `$ ./src/bitcoin-cli -help | grep -A4 netinfo`

ACKs for top commit:
  laanwj:
    re-ACK 747cb5b994
  michaelfolkson:
    ACK 747cb5b994
  jonasschnelli:
    Tested ACK 747cb5b994 - works nicely. Great that this PR only changes bitcoin-cli.

Tree-SHA512: 48fe23dddf3005a039190fcbc84167cd25b0a63489617fe14ea5db9a641a829b46b6e8dc7924aab6577d82a13909d157e82f715bd2ed3a8a15071957c35c19f3
2021-02-05 14:43:10 +01:00
Wladimir J. van der Laan
a6b1bf6439
Merge #20267: Disable and fix tests for when BDB is not compiled
49797c3ccf tests: Disable bdb dump test when no bdb (Andrew Chow)
1194cf9269 Fix wallet_send.py wallet setup to work with descriptors (Andrew Chow)
fbaea7bfe4 Require legacy wallet for wallet_upgradewallet.py (Andrew Chow)
b1b679e0ab Explicitly mark legacy wallet tests as such (Andrew Chow)
09514e1bef Setup wallets for interface_zmq.py (Andrew Chow)
4d03ef9a73 Use MiniWallet in rpc_net.py (Andrew Chow)
4de23824b0 Setup wallets for interface_bitcoin_cli.py (Andrew Chow)
7c71c627d2 Setup wallets with descriptors for feature_notifications (Andrew Chow)
1f1bef8dba Have feature_filelock.py test both bdb and sqlite, depending on compiled (Andrew Chow)
c77975abc0 Disable upgrades tests that require BDB if BDB is not compiled (Andrew Chow)
1f20cac9d4 Disable wallet_descriptor.py bdb format check if BDB is not compiled (Andrew Chow)
3641597d7e tests: Don't make any wallets unless wallet is required (Andrew Chow)
b9b88f57a9 Skip legacy wallet reliant tests if BDB is not compiled (Andrew Chow)
6f36242389 tests: Set descriptors default based on compilation (Andrew Chow)

Pull request description:

  This PR fixes tests for when BDB is not compiled. Tests which rely on or test legacy wallet behavior are disabled and skipped when BDB is not compiled. For the components of some tests that are for legacy wallet things, those parts of the tests are skipped.

  For the majority of tests, changes are made so that they can be run with either legacy wallets or descriptor wallets without materially effecting the test. Most tests only need the wallet for balance and transactions, so the type of wallet is not an important part of those tests. Additionally, some tests are wallet agnostic and modified to instead use the test framework's MiniWallet.

ACKs for top commit:
  laanwj:
    ACK 49797c3ccf
  ryanofsky:
    Code review ACK 49797c3ccf. Only change since last review is dropping last commit. Previous review w/ suggestions for future followup is https://github.com/bitcoin/bitcoin/pull/20267#pullrequestreview-581508843

Tree-SHA512: 69659f8a81fb437ecbca962f4082c12835282dbf1fba7d9952f727a49e01981d749af9b09feda1c8ca737516c7d7a08ef17e782795df3fa69892d5021b41c1ed
2021-02-05 14:26:10 +01:00
Wladimir J. van der Laan
3931732191
Merge #20646: doc: refer to BIPs 339/155 in feature negotiation
e1e6714832 doc: refer to BIPs 339/155 in feature negotiation (Jon Atack)

Pull request description:

  of `wtxidrelay` and `addrv2`/`sendaddrv2`, and add `fSuccessfullyConnected` doxygen documentation to clarify that it is set to true on VERACK.

ACKs for top commit:
  laanwj:
    re-ACK e1e6714832

Tree-SHA512: 3e6af5b246e4ee1ec68ee34db525746717871bc986ad4840f5a8edce55740768389f6fd0ec69046eda2fb4c69939440a96571f79d36e6cbff4fd3b7f2ebc74c0
2021-02-05 11:15:37 +01:00
MarcoFalke
53730a78bc
Merge #21077: doc: clarify -timeout and -peertimeout config options
eecb7ab105 [doc] clarify -peertimeout and -timeout descriptions (gzhao408)

Pull request description:

  The debug-only option `-peertimeout` is used to delay `InactivityCheck()`, whereas the `-timeout` option specifies socket timeouts (`nConnectTimeout`). The current descriptions are a bit misleading and hard to tell apart. I think it would save dev/review time to update them 🤷

ACKs for top commit:
  MarcoFalke:
    ACK eecb7ab105 nice doc fixup
  jnewbery:
    ACK eecb7ab105

Tree-SHA512: 71d2e6c31664b9f7f0b053ecf3be21c6c55472553fa7478d8526ba3be8d54979bceafca63d87b8b2488c11f409c332ac795da613ff8101546b18d9cd8bcceb50
2021-02-05 10:21:01 +01:00
MarcoFalke
01d2cf2674
Merge #21080: fuzz: Configure check for main function (take 2)
fac4be3048 fuzz: Configure check for main function (take 2) (MarcoFalke)

Pull request description:

  Actually fix https://github.com/google/honggfuzz/issues/336#issuecomment-702972138

  Follow-up to #20065

  Steps to test: `honggfuzz` section in doc/fuzzing.md

ACKs for top commit:
  practicalswift:
    cr ACK fac4be3048: patch looks correct!

Tree-SHA512: 893768c80439fe5d90b883ade89dc02f5bb80e27637916cf5575b6a9ed0b1c04942ff851342f5bbabb8666e6696715427feeb98f5301ad23c7b87b09e5872f97
2021-02-05 10:04:56 +01:00
MarcoFalke
4013e44c74
Merge #21082: refactor: Treat ArgsManager::Flags as uint32_t explicitly
faf3b4b533 refactor: Treat ArgsManager::Flags as uint32_t explicitly (MarcoFalke)

Pull request description:

  The underlying type might be implementation defined, which is probably why the sanitizer kills the fuzz tests.

  Fix that by pinning the underlying type.

  This refactor does not change behaviour and only affects the sanitizer in tests.

ACKs for top commit:
  practicalswift:
    cr ACK faf3b4b533

Tree-SHA512: d446824836e1037b4200ba3630c8628090678cfad45559866275d8e06349f7c8cdb7e816619f5afb35f9f65299cc00e046d2f81b73cd8eb843e2e15676b647d5
2021-02-05 09:54:43 +01:00
Bruno Garcia
0d39b5848a test: fix timeout decrease in feature_assumevalid 2021-02-04 21:43:43 -02:00
gzhao408
eecb7ab105 [doc] clarify -peertimeout and -timeout descriptions 2021-02-04 13:10:48 -08:00
MarcoFalke
faf3b4b533
refactor: Treat ArgsManager::Flags as uint32_t explicitly 2021-02-04 19:34:15 +01:00
Bruno Garcia
5e0cd25e29 fix the unreachable code at feature_taproot 2021-02-04 10:57:37 -02:00
MarcoFalke
fac4be3048
fuzz: Configure check for main function (take 2) 2021-02-04 13:11:57 +01:00
Gunar C. Gessner
e1604b3d50 doc: Replace tabs for spaces 2021-02-04 12:06:13 +00:00
Kiminuo
1bca2aa694 Introduce GetUniquePath(base) helper method to replace boost::filesystem::unique_path() which is not available in std::filesystem. 2021-02-04 11:38:09 +01:00
MarcoFalke
ea5a50f92a
Merge #21042: doc, test: Improve setup_clean_chain documentation
590bda79e8 scripted-diff: Remove setup_clean_chain if default is not changed (Fabian Jahr)
98892f39e3 doc: Improve setup_clean_chain documentation (Fabian Jahr)

Pull request description:

  The first commit improves documentation on setup_clean_chain which is misunderstood quite frequently. Most importantly it fixes the TestShell docs which are simply incorrect.

  The second commit removes the instances of `setup_clean_clain` in functional tests where it is not changing the default.

  This used to be part of #19168 which also sought to rename`setup_clean_chain`.

ACKs for top commit:
  jonatack:
    ACK 590bda79e8

Tree-SHA512: a7881186e65d31160b8f84107fb185973b37c6e50f190a85c6e2906a13a7472bb4efa9440bd37fe0a9ac5cd2d1e8559870a7e4380632d9a249eca8980b945f3e
2021-02-04 10:30:06 +01:00
MarcoFalke
f1239b70d1
Merge #21025: validation: Guard chainman chainstates with cs_main
20677ffa22 validation: Guard all chainstates with cs_main (Carl Dong)

Pull request description:

  ```
  This avoids a potential race-condition where a thread is reading the
  ChainstateManager::m_active_chainstate pointer while another one is
  writing to it. There is no portable guarantee that reading/writing the
  pointer is thread-safe.

  This is also done in way that mimics ::ChainstateActive(), so the
  transition from that function to this method is easy.

  More discussion:
  1. https://github.com/bitcoin/bitcoin/pull/20749#discussion_r559544027
  2. https://github.com/bitcoin/bitcoin/pull/19806#discussion_r561023961
  3. https://github.com/bitcoin/bitcoin/pull/19806#issuecomment-768946522
  4. https://github.com/bitcoin/bitcoin/pull/19806#issuecomment-768955695
  ```

  Basically this PR removes the loaded-but-unfired footgun, which:
  - Is multiplied (but still unshot) in the chainman deglobalization PRs (#20158)
  - Is shot in the test framework in the au.activate PR (#19806)

ACKs for top commit:
  jnewbery:
    code review ACK 20677ffa22. I've verified by eye that neither of these members are accessed without cs_main.
  ryanofsky:
    Code review ACK 20677ffa22. It is safer to have these new `GUARDED_BY` annotations and locks than not to have them, but in the longer run I think every `LOCK(cs_main)` added here and added earlier in f92dc6557a from #20749 should be removed and replaced with `EXCLUSIVE_LOCKS_REQUIRED(cs_main)` on the accessor methods instead. `cs_main` is a high level lock that should be explicitly acquired at a high level to prevent the chain state from changing. It shouldn't be acquired recursively in low-level methods just to read pointer values atomically.

Tree-SHA512: 68a3a46d79a407b774eab77e1d682a97e95f1672db0a5fcb877572e188bec09f3a7b47c5d0cc1f2769ea276896dcbe97cb35c861acf7d8e3e513e955dc773f89
2021-02-04 10:22:44 +01:00
Gunar Gessner
98db48d349 doc: Fix markdown formatting
Lines were being joined making it hard to read.
2021-02-04 09:17:53 +00:00
MarcoFalke
4e946ebcf1
Merge #20715: util: Add ArgsManager::GetCommand() and use it in bitcoin-wallet
fa61b9d1a6 util: Add ArgsManager::GetCommand() and use it in bitcoin-wallet (MarcoFalke)
7777105a24 refactor: Move all command dependend checks to ExecuteWalletToolFunc (MarcoFalke)
fa06bce4ac test: Add tests (MarcoFalke)
fac05ccdad wallet: [refactor] Pass ArgsManager to WalletAppInit (MarcoFalke)

Pull request description:

  This not only moves the parsing responsibility out from the wallet tool, but it also makes it easier to implement bitcoin-util #19937

  Fixes: #20902

ACKs for top commit:
  ajtowns:
    ACK fa61b9d1a6
  fjahr:
    Code review ACK fa61b9d1a6

Tree-SHA512: 79622b806e8bf9dcd0dc24a8a6687345710df57720992e83a41cd8d6762a6dc112044ebc58fcf6e8fbf45de29a79b04873c5b8c2494a1eaaf902a2884703e47b
2021-02-04 09:12:05 +01:00
MarcoFalke
5a429d3d0f
Merge #21049: Add release notes for listdescriptors RPC
51f3752fbe Add release notes for listdescriptors RPC (Ivan Metlushko)

Pull request description:

  Original PR is #20226

ACKs for top commit:
  jonatack:
    ACK 51f3752
  jonasschnelli:
    ACK 51f3752fbe

Tree-SHA512: e8091d01b99a3effcd6c1738e7363a44858ba9bcf6bd99bf60f2025a25db83fc8d61354ab2002365b56071b9f3693c7d534153a259b5ebc91cbcf8d13f6555f1
2021-02-04 08:51:37 +01:00
fanquake
5f18080c29
Merge #21065: build: make macOS HOST in download-osx generic
f22a3ec140 build: make macOS HOST in download-osx generic (fanquake)

Pull request description:

  This was missed in #20419, and the update before that, so just make this non-versioned so that we don't have to worry about it. This is fine, because it's just for downloading sources.

ACKs for top commit:
  RandyMcMillan:
    ACK f22a3ec140
  dongcarl:
    utACK f22a3ec140

Tree-SHA512: 3a6993a69594a793a5185e4ba48858443a1002a37b96ff881d39ca7719c79432b35d709bd9a9379f8046bdbeb716c5e1598f273a7e7e3f3bf528b6a807abe5ec
2021-02-04 10:11:06 +08:00
MarcoFalke
faf7d7418c
fuzz: Avoid extraneous copy of input data, using Span<> 2021-02-03 19:30:14 +01:00
fanquake
2ecaf21433
gitian: remove execstack workaround for ricv64 & powerpc64le
When building with g++-10 (or 8) on Focal, binaries are being produced
with noexecstack by default, so we can remove the workaround of
explicitly passing "-Wl,-z,noexecstack" for risvc46 and powerpc64le.

When building for powerpc64 this is still required.
2021-02-03 21:47:16 +08:00