Commit Graph

19527 Commits

Author SHA1 Message Date
MarcoFalke
698ca44c98 Merge #14266: refactor: Lift prevector default vals to the member declaration
d2eee87928 Lift prevector default vals to the member declaration (Ben Woosley)

Pull request description:

  I overlooked this possibility in #14028

ACKs for commit d2eee8:
  promag:
    utACK d2eee87, change looks good because members are always initialized.
  251Labs:
    utACK d2eee87 nice one.
  ken2812221:
    utACK d2eee87928781ab3082d4279aa6f19641a45e801
  practicalswift:
    utACK d2eee87928781ab3082d4279aa6f19641a45e801
  scravy:
    utACK d2eee87928781ab3082d4279aa6f19641a45e801

Tree-SHA512: f2726bae1cf892fd680cf8571027bcdc2e42ba567eaa901fb5fb5423b4d11b29e745e0163d82cb513d8c81399cc85933a16ed66d4a30829382d4721ffc41dc97
2021-07-10 12:10:51 -05:00
MarcoFalke
0199129fdc Merge #15650: Handle the result of posix_fallocate system call
5d35ae3326 Handle the result of posix_fallocate system call (Luca Venturini)

Pull request description:

  The system call `posix_fallocate` is not supported on some filesystems.

  - catches the result of posix_allocate and fall back to the default behaviour if the return value is different from 0 (success)

  Fixes #15624

ACKs for commit 5d35ae:
  MarcoFalke:
    utACK 5d35ae3326624da3fe5dcb4047c9a7cec6665cab
  sipa:
    utACK 5d35ae3326624da3fe5dcb4047c9a7cec6665cab, though the Yoda condition is an uncommon style in this project.
  hebasto:
    utACK 5d35ae3326624da3fe5dcb4047c9a7cec6665cab
  practicalswift:
    utACK 5d35ae3326624da3fe5dcb4047c9a7cec6665cab

Tree-SHA512: 7ab3b35fb633926f28a58b2b07ffde8e31bb997c80a716b1b45ee716fe9ff4ddcef0a05810bd4423530e220cfc62f8925517d27a8b92b05a524272063e43f746
2021-07-10 12:10:51 -05:00
MarcoFalke
3ba32a1116 Merge #15887: docs: Align code example style with clang-format
201393f932 Align code example with clang-format (Hennadii Stepanov)

Pull request description:

  With this PR running [clang-format-diff.py](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/clang-format-diff.py) on the code example will not fire a format adjustment.

ACKs for commit 201393:
  MarcoFalke:
    trivial ACK 201393f93268f6775d1b5d54119a7210628b333d

Tree-SHA512: 825c5e8cfba1bc140c2dfc38b82c5eec268b82b528af4301f25dfacc1f4f0788e268e72e8512f7ce001be665a8b07964a0af832fd9a1c6bd1c27d252f93619bc
2021-07-10 12:10:51 -05:00
MarcoFalke
6c424bf4da Merge #15772: test: Properly log named args in authproxy
fa078984c9 test: Properly log named args in authproxy (MarcoFalke)

Pull request description:

ACKs for commit fa0789:
  promag:
    ACK fa07898, for instance:
  practicalswift:
    utACK fa078984c9cc706dc7b510a8ada26c3026713647

Tree-SHA512: 3a2564c9b8392c2ef13657138fa0ba4a521015e2d53331156d2a07ccc9497fb268f21e8d93b065c5734d25e4aea8f5cf67f07e6ab93b0ec2987d66a136f94bb8
2021-07-10 12:10:51 -05:00
MarcoFalke
c9d1944b6f Merge #15446: Improve depends debuggability
6d44c5ebf9 depends: Add commands for each package for each stage (Carl Dong)
80f0e05b70 depends: Preprocessing doesn't care about deps (Carl Dong)

Pull request description:

  Adds make targets for each package for each stage, e.g.

  ```sh
  make zeromq_configured
  ```

ACKs for commit 6d44c5:
  MarcoFalke:
    ACK 6d44c5ebf97af4b357079fe4bc2130f98e1d0fd2 (Haven't looked at the code changes, but adding this feature makes sense)
  ryanofsky:
    ACK 6d44c5ebf97af4b357079fe4bc2130f98e1d0fd2

Tree-SHA512: f1ac0aecfd2372aed09ca63603e2634552cb3f6ff9d610f958e2a66952d7d9e870b4c32b7d996886879e6d3016532272e8b1a10c13ed7b31009c6c96f786db9f
2021-07-10 12:10:51 -05:00
MarcoFalke
dc25ff6294 Merge #15533: test: .style.yapf: Set column_limit=160
1111f0718a test: .style.yapf: Set column_limit=160 (MarcoFalke)

Pull request description:

  The current style is pep8, as suggested in https://github.com/bitcoin/bitcoin/blob/master/test/functional/README.md#style-guidelines.

  generated with

  ```
  $ yapf --version
  yapf 0.24.0
  $ yapf --style-help --style=pep8 > .style.yapf
  ```

  However, we don't use the column_limit of 79 right now. Practically it is somewhere between 120-240.

  Some stats:

  ```
  column_limit=120: 115 files changed, 2423 insertions(+), 1408 deletions(-)
  column_limit=160: 108 files changed, 1563 insertions(+), 1247 deletions(-)
  column_limit=200: 104 files changed, 1255 insertions(+), 1178 deletions(-)

ACKs for commit 1111f0:
  practicalswift:
    utACK 1111f0718acea42954600a4dbd553ac40aae797f agree with @ryanofsky
  ryanofsky:
    utACK 1111f0718acea42954600a4dbd553ac40aae797f

Tree-SHA512: 1ce0da83b917496f4ea7d1af31b624517a78998a10091b6ba611737f2c819fa3cda1786307f15d20131a00fd95232818e3d1108950dd12b60c4674eaa447839f
2021-07-10 12:10:51 -05:00
Jonas Schnelli
b902736621 Merge #15663: crypto: Remove unused AES-128 code
f6ee177f7 Remove unused AES-128 code (practicalswift)

Pull request description:

  Remove unused AES-128 code.

  As far as I can tell this AES-128 code has never been in use in the project (outside of testing/benchmarking).

  The AES-256 code is used in `CCrypter::Encrypt`/`CCrypter::Decrypt` (`src/wallet/crypter.cpp`).

  Trivia: 0.15% of the project's C++ LOC count (excluding dependencies) is trimmed off:

  ```
  $ LOC_BEFORE=$(git grep -I "" HEAD~1 -- "*.cpp" "*.h" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" | wc -l)
  $ LOC_AFTER=$(git grep -I "" -- "*.cpp" "*.h" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" | wc -l)
  $ bc <<< "scale=4; ${LOC_AFTER}/${LOC_BEFORE}"
  .9985
  ```

  :-)

Tree-SHA512: 9588a3cd795a89ef658b8ee7323865f57723cb4ed9560c21de793f82d35e2835059e7d6d0705e99e3d16bf6b2a444b4bf19568d50174ff3776caf8a3168f5c85
2021-07-10 12:10:51 -05:00
MarcoFalke
407b503918 Merge #15603: docs: Add more tips to productivity.md
5801dd628d docs: Add more tips to productivity.md (gwillen)

Pull request description:

  Add advice to productivity.md on:
  - Using ccache to optimal effect
  - The with-incompatible-bdb configure option
  - Building less than the entire set of targets

ACKs for commit 5801dd:
  promag:
    utACK 5801dd6.
  MarcoFalke:
    utACK 5801dd6

Tree-SHA512: 2138acd4bf5a27ecaa9a02fb2141903d01ee199ba85ccf6a5ad6a0a4dabf4447d043108cdd86998801b0282e899f70892f9337b0b6dc59c6d1f0fccf61adb4e4
2021-07-10 12:10:51 -05:00
Wladimir J. van der Laan
368f5f0c9f Merge #15626: Docs: Update ACK description in CONTRIBUTING.md
0d9d2b385b8c32ab422964128d10b99cfcad2612 Doc: update ACK description in CONTRIBUTING.md (Jon Atack)

Pull request description:

  as per https://github.com/bitcoin/bitcoin/pull/15617#issuecomment-474773043.

  Edit:

  as per https://github.com/bitcoin/bitcoin/pull/15617#issuecomment-474773043 and https://github.com/bitcoin/bitcoin/pull/15626#discussion_r267286564.

Tree-SHA512: 12df420d20338270bca310873c73d2f38b631c05cf8b3e5b2c1380f95936cb122687ba66b71de53348222efd5fed6d21e67f535a6ada689bf294dceec184a631
2021-07-10 12:10:51 -05:00
MarcoFalke
4a543ac7ea Merge #15581: depends: Make less assumptions about build env
f7696e6183 depends: qt: Don't hardcode pwd path (Carl Dong)
89bee1bdbf depends: tar: Always extract as yourself (Carl Dong)
340ef50772 depends: Defer to Python detected by autoconf (Carl Dong)

Pull request description:

  Removes some implicit assumptions that the depends system has about its environment and, as a side-effect, makes it possible to build the depends tree under severely privilege-limited environments such as containers built by Guix.

Tree-SHA512: e8618f9310a0deae864b44f9b60baa29e6225ba16817973ff7830b55798ebd4343aa06da6c1f92682a7afb709d26f80d6ee794a139d4d44c27caf4f0c8fe95fc
2021-07-10 12:10:51 -05:00
Wladimir J. van der Laan
9c3401a91d Merge #15522: Document sizeof(size_t) assumptions and compiler assumptions in assumptions.h
c7a7250302b60b78af39f39ee403d330c0cb7aa0 Document assumptions about C++ compiler (practicalswift)
c7ea8d3236e7c1b0c198345cc78a6754338d3724 Add sizeof(size_t) assumptions (practicalswift)

Pull request description:

  Document `sizeof(size_t)` assumptions and compiler assumptions by adding compile-time checks in `assumptions.h`.

Tree-SHA512: db46481eecad6a87718ae637a7761d39d32cfe6f95fc8ad2b3a52a3d966c2a05c8f540dd3f362721279816571b04b6cce2de9b3b1d17606d7b197126cd4a8d1f
2021-07-10 12:10:51 -05:00
MarcoFalke
f334f63d3d Merge #15580: depends: native_protobuf: avoid system zlib
19a0c4af0f depends: native_protobuf: avoid system zlib (Carl Dong)

Pull request description:

  I don't believe we use any zlib features in protobufs

Tree-SHA512: cd09229f3fac215f58e9ddd4871f190cf2a301e25939aaa1c6ee130d1ba5bbb00d9ebe9ca012a2894bac4c2db923259f34fe43e255ad55ccd2b11ec88afc2a8f
2021-07-10 12:10:51 -05:00
Jonas Schnelli
a4b2ac0c59 Merge #15577: Docs: Enable TLS in link to chris.beams.io
228e80608 Enable TLS in link to chris.beams.io (JeremyRand)

Pull request description:

  This PR enables TLS in a documentation link to chris.beams.io, which improves security.  This change was originally part of https://github.com/bitcoin/bitcoin/pull/13778 , which was closed for reasons unrelated to this change.

Tree-SHA512: 01f02031b39ebdaa7fc1859befde7e3bfff105892a8b9e1737ff94741599c6c5936eff53871e5e3560931512c9b7a4ea34f48d8555b583d232c90c2ca6d4d776
2021-07-10 12:10:51 -05:00
MarcoFalke
206c1ed9ba Merge #15444: [docs] Additional productivity tips
ff7f31e07d [doc] productivity: more advanced git range-diff (Sjors Provoost)
3a21905a4e [doc] devtools: mention clang-format dependency (Sjors Provoost)
bf12093191 [doc] productivity: fix broken link (Sjors Provoost)

Pull request description:

  Fixes a broken link to `devtools/README.md`, points out the `clang-format` dependency and adds a `git range-diff` incantation that works even with rebases and squashes.

Tree-SHA512: 36e46282f1e28d1bf3f48ada995fbac548f61b7747091eb032b60919cf76c7bdad0fa8aecb0c47adbdaa9ef986d3ec7752b0bb94c63191401856e2ddeec48f3e
2021-07-10 12:10:51 -05:00
Wladimir J. van der Laan
55880fbe08 Merge #15548: build: use full version string in setup.exe
fa55104cb8e73c709e90fc5f81c9cb6a8a0713a6 build: use full version string in setup.exe (MarcoFalke)

Pull request description:

  Fixes: #15546

Tree-SHA512: a8ccbfef6b9fdd10bd0facadb25019b9296579eee6c8f7b4e5298cc4df52bba61864135ab8f46b900f7a3888fbcc921e039412d5a8127e44d8f2dd2c8fc56f86
2021-07-10 12:10:51 -05:00
Wladimir J. van der Laan
a33756c72e Merge #15549: gitian: Improve error handling
32da92bdf6bb55d6d312b0f85797d439cc942db5 gitian: Improve error handling (Wladimir J. van der Laan)

Pull request description:

  Improve error handling in gitian builds:

  - Set fail-on-error and pipefail flag, this causes a command to fail when either of the pipe stages fails, not only when the last of the stages fails, so this improves error detection.
  - Also use `xargs` instead of `find -exec`, because `find` will not propagate errors in the executed command, but `xargs` will.

  This will avoid some issues like #15541 where non-determinism is silently introduced due to errors caused by environment conditions (such as lack of disk space in that case).

Tree-SHA512: d5d3f22ce2d04a75e5c25e935744327c3adc704c2d303133f2918113573a564dff3d3243d5569a2b93ee7eb0e97f8e1b1ba81767e966af9015ea711a14091035
2021-07-10 12:10:51 -05:00
MarcoFalke
f2d65948d3 Merge #15479: test: Add .style.yapf
fa45123f66 test: Add .style.yapf (MarcoFalke)

Pull request description:

  This can *optionally* be used to format any added code before submitting a pull. I use this heavily and wouldn't want to hold it back from others, now that yapf is referred to in https://github.com/bitcoin/bitcoin/blob/master/doc/productivity.md#format-python-diffs-with-yapf-diffpy

Tree-SHA512: 0f3d8bcbb76a710d9faa1226202073e8d967a82a05fc002cd10305ff58b382f5ff3df96a6faaec5bd01613d41f5fc2343e4999fb1217bf1f24f6da186d572ca1
2021-07-10 12:10:51 -05:00
MarcoFalke
1c374ebf5b Merge #15338: ci: Build and run tests once on freebsd
fa1d400003 cirrus ci: Inital config (MarcoFalke)

Pull request description:

  Could be activated through https://github.com/marketplace/cirrus-ci

Tree-SHA512: 3a25ad2a58249463e97a3b31122581d5d382fa1d9c830f36c72ca6211b0822950e56ea754a6bddc8f79af21d1fe3469caee9efe0e90411a9c6a59cb98c09f845
2021-07-10 12:10:51 -05:00
MarcoFalke
dd2f85c084 Merge #15296: tests: Add script checking for deterministic line coverage in unit tests
43206239a8 tests: Add script checking for deterministic line coverage (practicalswift)

Pull request description:

  Add script checking for deterministic line coverage in unit tests.

  Context: #14343 ("coverage reports non-deterministic")

  When the coverage is deterministic this script can be invoked from Travis to guard against regressions, but left inactive for now.

  Output in case of determinism:

  ```
  $ contrib/test_deterministic_coverage.sh 2
  [2019-01-30 20:08:46] Measuring coverage, run #1 of 2
  [2019-01-30 20:10:45] Measuring coverage, run #2 of 2

  Coverage test passed: Deterministic coverage across 2 runs.
  ```

  Output in case of non-determinism:

  ```
  $ contrib/test_deterministic_coverage.sh 2
  [2019-01-30 20:08:46] Measuring coverage, run #1 of 2
  [2019-01-30 20:10:45] Measuring coverage, run #2 of 2

  The line coverage is non-deterministic between runs.

  The test suite must be deterministic in the sense that the set of lines executed at least
  once must be identical between runs. This is a neccessary condition for meaningful coverage
  measuring.

  --- gcovr.run-1.txt   2019-01-30 23:14:07.419418694 +0100
  +++ gcovr.run-2.txt   2019-01-30 23:15:57.998811282 +0100
  @@ -471,7 +471,7 @@
   test/crypto_tests.cpp                        270     270   100%
   test/cuckoocache_tests.cpp                   142     142   100%
   test/dbwrapper_tests.cpp                     148     148   100%
  -test/denialofservice_tests.cpp               225     225   100%
  +test/denialofservice_tests.cpp               225     224    99%   363
   test/descriptor_tests.cpp                    116     116   100%
   test/fs_tests.cpp                             24       3    12%   14,16-17,19-20,23,25-26,29,31-32,35-36,39,41-42,45-46,49,51-52
   test/getarg_tests.cpp                        111     111   100%
  @@ -585,5 +585,5 @@
   zmq/zmqpublishnotifier.h                       5       0     0%   12,31,37,43,49
   zmq/zmqrpc.cpp                                21       0     0%   16,18,20,22,33-35,38-45,49,52,56,60,62-63
   ------------------------------------------------------------------------------
  -TOTAL                                      61561   27606    44%
  +TOTAL                                      61561   27605    44%
   ------------------------------------------------------------------------------

  ```

  In this case line 363 of `test/denialofservice_tests.cpp` was executed only in the second run. Non-determinism detected!

Tree-SHA512: 03f45590e70a87146f89aa7838beeff0925d7fd303697ff03e0e69f8a5861694be5f0dd10cb0020e3e3d40c9cf662f71dfcd838f6affb31bd5212314e0a4e3a9
2021-07-10 12:10:51 -05:00
PastaPastaPasta
6e4099ea67
Merge pull request #4188 from kittywhiskers/bench
partial merge #18011: Replace current benchmarking framework with nanobench
2021-07-06 10:36:14 -05:00
Kittywhiskers Van Gogh
baabcf4e35 bench: adapt bls_dkg tests to nanobench
* stop using global pointers, every run gets a unique pointer for itself
* keep tests relatively self contained, remove the need for CleanupBLSDkgTests()
* remove parallel tests, they seem to be somewhat unpredictable and seem to have no correlated increased CPU usage
* minor cleanup and refactoring, convert struct to class, rearrange variables
* correlate batch with quorum, minEpochIterations set to 1, unless tests are known unstable, then set to 10
2021-07-05 18:28:58 +05:30
Kittywhiskers Van Gogh
b5db3c3d65 merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
UdjinM6
bc09637998
Merge pull request #4225 from PastaPastaPasta/backport-triv-pr5
backport: 'trivial' pr5
2021-07-04 00:07:27 +03:00
pasta
4c03ed9e74 14011 dashification
Signed-off-by: pasta <pasta@dashboost.org>
2021-07-03 13:44:50 -05:00
pasta
26826d0efe fix 14450
Signed-off-by: pasta <pasta@dashboost.org>
2021-07-03 13:44:50 -05:00
MarcoFalke
d227d814a3 Merge #14619: tests: Fix value display name in test_runner help text
5a05aa2db2 Add metavar to match var name in help text + Change wording for better readability (Martin Erlandsson)

Pull request description:

  The help text given by `test/functional/test_runner.py -h` refers to the value `n`, which is defined as `COMBINEDLOGSLEN` in the list of commands.

  To make the help text consistent, this PR changes the display name `COMBINEDLOGSLEN` to `n` by setting the argparse [`metavar`](https://docs.python.org/3/library/argparse.html#metavar) attribute. (`metavar` only changes the _displayed_ name)

  Alternatively: Do the opposite and change the help text to use `COMBINEDLOGSLEN`.

  ---

  Before PR:
  ```
  ➜  bitcoin > test/functional/test_runner.py -h | grep -A 1 combinedlogslen
    --combinedlogslen COMBINEDLOGSLEN, -c COMBINEDLOGSLEN
                          print a combined log (of length n lines) from all test nodes and test framework to the console on failure.
  ```

  After PR:
  ```
  ➜  bitcoin > test/functional/test_runner.py -h | grep -A 1 combinedlogslen
    --combinedlogslen n, -c n
                          print a combined log (of length n lines) from all test nodes and test frameworks to the console on failure.
  ```
  ---
  Also, fixed pluralization typo.

Tree-SHA512: a1124a4976d29fae1e8ecd7fa2ac523b7f05d541c611166532f44692995691a96faf797fa71582d78634f328b500cbee49c6ef296c8f1a898a57c050cc4e721d
2021-07-03 13:44:50 -05:00
MarcoFalke
ca000ff281 Merge #14664: example_test.py: fixup coinbase height argument, derive number clearly
6c5355e43d example_test.py: fixup coinbase height argument, derive number clearly (Gregory Sanders)

Pull request description:

Tree-SHA512: 52b7eb73422feb1f730924c9f513c1c54e2b8b1bcf962b4df59fb6b0b86812ae8d0d336f8ef8edac9aab0e7722fd16ed21fd92fa58ab143d6f8efc5ac10e5b1f
2021-07-03 13:44:50 -05:00
MarcoFalke
befb4d400f Merge #14632: Tests: Fix a comment
086fc83571 Tests: Fix a comment (fridokus)

Pull request description:

  Fix a comment that was false

Tree-SHA512: 945aa38229545e026e18c3abf53a4fbe6ec36413ce690fff7a1dd89b6e102d2b574524092e0ddf06cace82f3c040c59221b9b942be1203525814d2fbd50aaa0b
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
87979a56bf Merge #14618: rpc: Make HTTP RPC debug logging more informative
ab8c6f24d28ea1d1e6258cf316b4b97a0baf2377 Add SAFE_CHARS[SAFE_CHARS_URI]: Chars allowed in URIs (RFC 3986) (practicalswift)
991248649b76a5a071e1360a700f3e2ecf3e1e1f rpc: Make HTTP RPC debug logging more informative (practicalswift)

Pull request description:

  * Make HTTP RPC debug logging more informative
  * Avoid excessively large log messages (which could theoretically fill up the disk) when running with debug option `-debug=http`

Tree-SHA512: 9068862fb7d34db1e12e6b9dde78b669b86c65b4fed3ea8c9eb6c35310d77fd12b16644728fd7e9fbf25059d25114bded9e061eb3de649d8847486ec42041ce9
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
a54a48b70d Merge #14625: Make clear function argument case in dev notes
9605bbd315eb14690427560fd9a274fe837f59f5 Make clear function argument case in dev notes (Carl Dong)

Pull request description:

  Rationale:

  For new developers, they might be confused if they see that function arguments are sometimes `camelCase`'d in the codebase. This makes it clear that they _should_ be `snake_case`'d (maybe because no one's gotten to fixing them yet).

Tree-SHA512: 9db16d1fedf9761121844a0865ae3fefea94b5dbdfb36cb18f99cbc73e117f7d798a019f28a1c8bca19772502de2f9ed063f03bd911ffc4d248ec7386cd87d97
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
8d4a65d196 Merge #14592: doc: Add external interface consistency guarantees
fa77aaa5ad21563dd18ce3e407d391d37ac8c201 doc: Add external interface consistency guarantees (MarcoFalke)

Pull request description:

  An attempt to clarify our consistency guarantees for developers and users

Tree-SHA512: 8bad6a2bcfd85f0aeeecf3b090332f64c778c69a838a519d11ea83f2cb51929b9f43a7e9b2469567f305a1277206cafe8e65041f1a002dadbe69259d6a0adc18
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
0ed7a8622a Merge #14600: docs: Clarify commit message guidelines
0e6de3aacb8ebbf2617e8c11b8dae61acdd79816 added details about commit messages (Martin Erlandsson)

Pull request description:

  In this small PR, the gist of [this helpful and informative comment from @fanquake](https://github.com/bitcoin/bitcoin/pull/14583#issuecomment-433668211) is added to the official contributing instructions, to help future first-time contributors get their commit messages right.

Tree-SHA512: ca6e9b639e007944314690ef771470f346d6f0ad8aa398abf86e45258bc617334fdbd2ca10ff930d62669a5eca5b507a3ebae11f75971f80f8a44b0bb17ab054
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
631020a6e8 Merge #14453: rpc: Fix wallet unload during walletpassphrase timeout
8907df9e02ec47ef249a7422faa766f06aa01e94 qa: Ensure wallet unload during walletpassphrase timeout (João Barbosa)
321decffa1fbf213462d97e5372bd0c4eeb99635 rpc: Fix wallet unload during walletpassphrase timeout (João Barbosa)

Pull request description:

  Replaces the raw wallet pointer in the `RPCRunLater` callback with a `std::weak_ptr` to check if the wallet is not expired.

  To test:
  ```
  bitcoind -regtest
  bitcoin-cli -regtest encryptwallet foobar
  bitcoin-cli -regtest walletpassphrase foobar 5 && bitcoin-cli -regtest unloadwallet ""
  ```

  Fixes #14452.

Tree-SHA512: 311e839234f5fb7955ab5412a2cfc1903ee7132ea56a8ab992ede3614586834886bd65192b76531ae0aa3a526b38e70ca2e1cdbabe52995906ff97b49d93c268
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
77b76ef0a5 Merge #12842: Prevent concurrent savemempool
585b47cfe133fae112782ad0a88fe25c71d465fa rpc: Prevent concurrent savemempool (João Barbosa)

Pull request description:

  Follow up of #12172, this change prevents calling `savemempool` RPC concurrently.

Tree-SHA512: 4759a7107658a9794f5c6ab7e3e3002276abadd64996010be67a2791914d284db6fe0377c071a8d6a42387bfb0178f219b73aeec077ce5c4fe5c634a30b3e081
2021-07-03 13:44:50 -05:00
Wladimir J. van der Laan
787113a778 Merge #14497: docs: Add doc/bitcoin-conf.md
1fb3c167c3cbd4a432a064b299439b3430157dda Add `doc/bitcoin-conf.md` (Hennadii Stepanov)

Pull request description:

  From the IRC:
  > 2018-10-16T05:35:03  \<wumpus\> if something can be solved by better documentation, please work on documentation!
  > 2018-10-16T05:35:12  \<wumpus\> don't change the code instead

  Refs:

  - #14370
  - #14427
  - #14494

  Based on the BITCOIN.CONF(5) manual page written by Micah Anderson \<micah@debian.org\> for the Debian system.

Tree-SHA512: 16393c9073c027fa1c46f8b59651e60b9a3159b3aeb9b3102040c292d2787f32b1ead5977957ac3ac0759a4bf626650a2325b68ad84320964ac089ffc2d3b4f4
2021-07-03 13:44:50 -05:00
Pieter Wuille
dbe9d6a018 Merge #14011: Disable wallet and address book Qt tests on macOS minimal platform
a3197c5294 Disable wallet and address book Qt tests on macOS minimal platform (Russell Yanofsky)

Pull request description:

  macOS minimal platform is frequently broken, and these are currently failing with Qt 5.11.1.

  The tests do pass when run on the full cocoa platform (with `test_bitcoin-qt -platform cocoa`).

  Stack trace from test crash: https://gist.github.com/ryanofsky/3401fb63c52d13d5585e7fc777361f1e

Tree-SHA512: a05644ef15d75ea7d7f85ea804c6a5fe78e4e7358b189cbab639d9f7dc46163a35f77f7a2b4ae2fd6be5b9fb22898386b4d88069d5ee8d5fdbd995157c6f0846
2021-07-03 13:44:50 -05:00
Pieter Wuille
2df5880bcb Merge #14474: bitcoin-tx: Use constant for n pubkeys check
1f01fe0257 bitcoin-tx: Use constant for n pubkeys check (Antoine Le Calvez)

Pull request description:

  Use the constant for the maximum number of public keys in a multisig script defined in script/script.h instead of hardcoding it.

Tree-SHA512: 83e6c46df907944d0d993159955e402784415536d61fdb5a5becba2b042e37ad2a291b27301c1b169416cb71c823a571d82257512cd4a64848a27a24c875fcc6
2021-07-03 13:44:50 -05:00
PastaPastaPasta
df65bd0238
Merge pull request #4224 from Munkybooty/backports-0.18-pr5
Backports 0.18 pr5
2021-07-03 12:33:17 -05:00
UdjinM6
22451a23e4
Merge pull request #4222 from Munkybooty/backports-0.18-pr3
Backports 0.18 pr3
2021-07-03 14:21:16 +03:00
UdjinM6
3d382fa5ce
Merge pull request #4228 from UdjinM6/backports-0.17-pr34
Backports 0.17 pr34
2021-07-03 01:44:58 +03:00
Wladimir J. van der Laan
2be36d4db5 Merge #13159: Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP)
75ea00f391b742e435c650aae3e827aad913d552 Remove unused fsbridge::freopen (practicalswift)
cceedbc4bf1056db17e0adf76d0db45b94777671 Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift)

Pull request description:

  Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`).

  Context: https://github.com/bitcoin/bitcoin/pull/13148#issuecomment-386288606

  Thanks @ajtowns!

Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1

# Conflicts:
#	src/logging.cpp
2021-07-02 11:39:23 -04:00
Wladimir J. van der Laan
025a33bb23 Merge #14101: qa: Use named args in validation acceptance tests
fa782a308dbe7bc579c122f63c1c65666fc85e91 qa: Use named args in some tests (MarcoFalke)
b4d33096734d787b0e1d754064039cbb64ce8d61 scripted-diff: Use named arguments in feature_block (MarcoFalke)
749ba35e7c9fbc21dbea27fd1be102b91313d132 scripted-diff: Pass node into p2p_segwit acceptance tests (MarcoFalke)

Pull request description:

  It is confusing to use a list of arguments such as `False, False, 16, ...` where it is unclear what each of them means.

  Run some scripted diffs to put meaning to them.

Tree-SHA512: d768df2375ea3c77145ebb1bf4c2d690581a379031449ded7ae160022d975eb13890aa8c6a44a5eebda8791cb2910a599326e431af76ed9e60afe1d182ada65c

# Conflicts:
#	test/functional/feature_block.py
#	test/functional/mining_basic.py
#	test/functional/p2p_segwit.py
2021-07-02 11:39:23 -04:00
Wladimir J. van der Laan
f5a46e294f Merge #13724: [contrib] Support ARM and RISC-V symbol check
c516c3a770e93dcd283dc4a9275cba88221d0e3a [contrib] Support ARM and RISC-V symbol check (Chun Kuan Lee)

Pull request description:

  Solve the TODO in the gitian-descripter

Tree-SHA512: 8115e2958af3dde43d9d9d05f0b1b1b93b1c2aa513e771a3e4e1342a5d78af2b0e40c0bbb7e9a0d15954897317e6f5a0d80996239af3b376d5ddd527f73428ae

# Conflicts:
#	contrib/devtools/symbol-check.py
#	contrib/gitian-descriptors/gitian-linux.yml
2021-07-02 11:39:23 -04:00
MarcoFalke
6268f42ce1 Merge #13126: util: Add Clang thread safety annotations for variables guarded by cs_args
1e29379d69 Fix potential deadlock (practicalswift)
d58dc9f943 Add lock annotations (cs_args) (practicalswift)
db5e9d3c88 Add missing locks (cs_args) (practicalswift)

Pull request description:

  * Add missing `cs_args` locks
  * Add Clang thread safety annotations for variables guarded by `cs_args`

Tree-SHA512: bc562dbddf24a287bcf9bf902bc930f942f260a94e5c8ec4d190f7f2ddac448ed3d52acadaf9fc1c81a5cbff2c171c52c18ba0804eeb03f699d70394e1c977c5

# Conflicts:
#	src/util/system.cpp
2021-07-02 11:39:23 -04:00
Wladimir J. van der Laan
1cc7c3219d Merge #14103: docs: Fix broken Doxygen comments
0e534d4dcae91ecf7ebd7a667227f7c26b4d5755 Fix incorrect Doxygen comments (practicalswift)

Pull request description:

  Fix broken Doxygen comments.

  This commit was taken from #13914 which now only covers `-Wdocumentation`.

Tree-SHA512: dddbca16bb792b8193e5f417151b5eace9acc942a321f1bc095b906e98889e3bd93509fe112ab6a24ee1f6a3a918db905bda7acefd53774fe3e6ebe669fb51ac

# Conflicts:
#	src/policy/fees.h
#	src/wallet/wallet.h
2021-07-02 11:39:23 -04:00
Wladimir J. van der Laan
506ddbfee2 Merge #14097: validation: Log FormatStateMessage on ConnectBlock error in ConnectTip
fa309dc30579acebff33380abdfe728c1cf59f92 validation: Log FormatStateMessage on ConnectBlock error in ConnectTip (MarcoFalke)

Pull request description:

  This change additionally logs the validation state on error, which is not logged at all on current master.

  Before:
  ```
  ERROR: ConnectTip(): ConnectBlock ffffff.... failed
  ```

  After:
  ```
  ERROR: ConnectTip: ConnectBlock ffffff.... failed, bad-cb-amount (code 16)
  ```

Tree-SHA512: e69ee0266772b3f77c0193c4a959c2444bf1a51259bd29d790cf665582b037997e520c8567f70b36362c071dcfe1a8ebd7c0f2286cf1b842df5731960e7e1ba0

# Conflicts:
#	src/validation.cpp
2021-07-02 11:39:23 -04:00
Wladimir J. van der Laan
19b9e74026 Merge #13631: Add CMerkleTx::IsImmatureCoinBase method
23f434378153cf764230066662f3ec3ad614ff30 Add CMerkleTx::IsImmatureCoinBase method (Ben Woosley)

Pull request description:

  All but one call to `GetBlocksToMaturity` is testing it relative to 0
  for the purposes of determining whether the coinbase tx is immature.
  In such case, the value greater than 0 implies that the tx is coinbase,
  so there is no need to separately test that status.

  This names the concept for easy singular use.

Tree-SHA512: 4470d07404a0707144f9827b9a94c5c4905f23ee6f9248edc5df599a59d28e21ea0201d8abe5d5d73b39cb05b60c861ea8e04767eef04433e2ee95dcfed653ee

# Conflicts:
#	src/wallet/wallet.h
2021-07-02 10:38:08 -04:00
Wladimir J. van der Laan
243ee3137a Merge #13967: [walletdb] don't report minversion wallet entry as unknown
321159e53e800c1df2d8dfd6ac03374f1829c327 don't report minversion wallet entry as unknown (Gregory Sanders)

Pull request description:

  It is known in WalletBatch::LoadWallet

Tree-SHA512: 82f7e12f48ae7d17317074ce5b5e27c70ba8334b04adbf7cc863f8169cc1aa460b9454571e2698aa00059c8c8f669fe19c0d40c4910dcded260ddca6ce78be9d

# Conflicts:
#	src/wallet/walletdb.cpp
2021-07-02 10:38:08 -04:00
MarcoFalke
805cda6f5f Merge #13985: [trivial] Fix slightly confusing mispelling in feature_blocksdir.py log message
241f8b5de4 Fix typo in feature_blocksdir.py log message (Alexander Leishman)

Pull request description:

  Typo I came across while writing some new tests.

Tree-SHA512: cc494553125a1e84f9238a14761e3fb76623e98d951811dd3bfb13595a03a1888d73859487a2cbb76c7ae85897bc64016a220a92c2636b35ea6356a5b5340d66

# Conflicts:
#	test/functional/feature_blocksdir.py
2021-07-02 10:38:08 -04:00
Wladimir J. van der Laan
6af03a3125 Merge #13891: [RPC] Remove getinfo deprecation warning
b2f23c41538eaadd71c373ada75dd3a982eeb8bf [RPC] Remove getinfo deprecation warning (John Newbery)

Pull request description:

  `getinfo` was removed in V0.16. A removal warning message was left in place to tell users that the method had been removed. We can remove that entirely in V0.18.

Tree-SHA512: bf93fbcf57a9be480438dcbdcab2dfd69ce277218b10628776975b093b3ffd2caa1751e0fb4cb0245443c81465693e2b8750e96d3e38632a78bae5ffa04f9212

# Conflicts:
#	src/rpc/misc.cpp
2021-07-02 10:38:08 -04:00