Commit graph

22485 commits

Author SHA1 Message Date
MarcoFalke
faba4672b6
ci: Fix QEMU_USER_CMD parse issues
* Fix bash syntax by adding missing -

* Disable QEMU_USER_CMD fallback when it is set

  Apparently bash can't distinguish an unset variable from a variable
  that is set to the empty string

* Export the environment variable to the docker env, otherwise it
  couldn't be used there
2020-01-03 07:04:45 -05:00
MarcoFalke
fa5d709fb2
ci: Move wrap-qemu into separate script 2020-01-03 07:03:46 -05:00
MarcoFalke
890eac8f82
Merge #17725: ci: Add valgrind run
facb416ad5 ci: Add valgrind run (MarcoFalke)

Pull request description:

  Fixes #17460

ACKs for top commit:
  practicalswift:
    ACK facb416ad5

Tree-SHA512: 55396e548a76f976d7b7170b68bc5f93cfd44656162267172f66db7eb549699a2a22d3b1bb0d5f180fe0697931939e652c8cdb86b435e81e7ce572485798009d
2019-12-17 11:46:22 -05:00
MarcoFalke
a54c16cdb6
Merge #17661: ci: use depends for s390x
e190000869 ci-s390x: Add qemu and depends support in the ci script (Elichai Turkel)

Pull request description:

  Related: #17599

  This adds qemu support just like we have in arm and compile the depends.

  other than that I also fixed some missing includes to make the depends compile.

ACKs for top commit:
  MarcoFalke:
    ACK e190000 (first commit only, didn't look at second commit)

Tree-SHA512: 2b8a39772b86408569f52cdc33832dbce7e5e9cdd710524295f3d259628cdfc017e740f6f94941307d7f8e413236814a95ba851153c617eb5fb75b4bd9a7e52f
2019-12-17 10:46:38 -05:00
Wladimir J. van der Laan
7df6a7ea98
Merge #17758: Fix CNetAddr::IsRFC2544 comment + tests
529d332fbf test: add IsRFC2544 tests (Mark Tyneway)
419ef3b7cc CNetAddr: fix IsRFC2544 comment (Mark Tyneway)

Pull request description:

  The comment describing the functionality of `CNetAddr::IsRFC2544` is incorrect.

  46d6930f8c/src/netaddress.h (L57)

  It should actually read `198.18.0.0/15` based on [RFC 3330](https://tools.ietf.org/html/rfc3330):

  ```
     198.18.0.0/15 - This block has been allocated for use in benchmark
     tests of network interconnect devices.  Its use is documented in
     [RFC2544].
  ```

  See [RFC 2544](https://tools.ietf.org/html/rfc2544) here.

  See the implementation here:

  47d981e827/src/netaddress.cpp (L142-L145)

  This PR also adds tests for the minimum and maximum values that are valid RFC 2544 addresses.

ACKs for top commit:
  practicalswift:
    ACK 529d332fbf
  laanwj:
    ACK 529d332fbf
  promag:
    ACK 529d332fbf, nit could squash.
  jonatack:
    ACK 529d332fbf

Tree-SHA512: 954a9582856d77564e0ea5fd2e3d287d0cfc4ecfe0588115692d01005e8ca7ad8ab20ff390ded867dc91af2bfb758d4e73a336e6c0b7798846c30a6d69b8ae3d
2019-12-17 16:19:29 +01:00
Mark Tyneway
529d332fbf
test: add IsRFC2544 tests 2019-12-16 19:43:15 -08:00
Mark Tyneway
419ef3b7cc
CNetAddr: fix IsRFC2544 comment 2019-12-16 19:42:18 -08:00
MarcoFalke
03dfa36641
Merge #17229: tests: Add fuzzing harnesses for various Base{32,58,64} and hex related functions
c18405732e tests: Add fuzzing harness for various hex related functions (practicalswift)
526dd78bed tests: Add fuzzing harness for various Base{32,58,64} related functions (practicalswift)
32e27129ff util: Move TrimString(...). Introduce default pattern (trims whitespace). Add NODISCARD. (practicalswift)
22d9bae36f tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift)

Pull request description:

  Add fuzzing harnesses for various Base{32,58,64} and hex related functions.

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz \
        --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/base_encode_decode
  …
  $ src/test/fuzz/hex
  …
  ```

ACKs for top commit:
  MarcoFalke:
    ACK c18405732e 🔁

Tree-SHA512: 4fcbe4f641fc553e43fd5c3c40a6beec0d2ce90c5ffc718213b37fc18aba4c055e51e26f93d01ea1248fd89473d07c9dce77db7f014b47d3abd045f61b5f1905
2019-12-16 19:10:58 -05:00
practicalswift
c18405732e tests: Add fuzzing harness for various hex related functions 2019-12-16 22:50:49 +00:00
practicalswift
526dd78bed tests: Add fuzzing harness for various Base{32,58,64} related functions 2019-12-16 22:50:49 +00:00
practicalswift
32e27129ff util: Move TrimString(...). Introduce default pattern (trims whitespace). Add NODISCARD. 2019-12-16 22:50:49 +00:00
practicalswift
22d9bae36f tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus 2019-12-16 22:50:49 +00:00
MarcoFalke
94c6f2bba4
Merge #17593: test: move more utility functions into test utility library
78e283e656 [test] move wallet helper functions into test library (Martin Zumsande)
f613e5dfda [test] move mining helper functions into test library (Martin Zumsande)
2cb4e8bdc7 [test] move string helper functions into test library (Martin Zumsande)

Pull request description:

  This disbands `test/util.h` and `test/util.cpp` and moves the content into the test utility library recently created in #17542, so that all test utility functions are in one place.

  The content of the original files are split into three modules:
  1) string helper functions go to `test/util/str`
  2) mining helper functions go to the newly created `test/util/mining`
  3) wallet helper functions go to the newly created `test/util/wallet`

ACKs for top commit:
  MarcoFalke:
    ACK 78e283e656 🔧

Tree-SHA512: f182a61e86e76c32bcb84e37f44904d3a4a9c5a321f7a8efdda5368a6623cb8b5a5384ec4f96e67f0357b0c22099f6e3ecd0ac4cb467e3fa3f3128f8d36edfb8
2019-12-16 16:08:56 -05:00
MarcoFalke
f9fd3a27fd
Merge #17750: util: change GetWarnings parameter to bool
7aab8d1024 [style] Code style fixups in GetWarnings() (John Newbery)
492c6dc1e7 util: change GetWarnings parameter to bool (John Newbery)
869b6314fd [qt] remove unused parameter from getWarnings() (John Newbery)

Pull request description:

  `GetWarnings()` changes the format of the output warning string based on a passed-in string argument that can be set to "gui" or "statusbar".

  Change the argument to a bool:

  - there are only two types of behaviour, so a bool is a more natural argument type
  - changing the name to `verbose` does not set any expectations for the how the calling code will use the returned string (currently, `statusbar` is used for RPC warnings, not a status bar)
  - removes some error-handling code for when the passed-in string is not one of the two strings expected.

ACKs for top commit:
  laanwj:
    code review ACK 7aab8d1024
  practicalswift:
    ACK 7aab8d1024 -- diff looks correct :)
  MarcoFalke:
    ACK 7aab8d1024 otherwise.
  promag:
    Code review ACK 7aab8d1024.

Tree-SHA512: 75882c6e3e44aa9586411b803149b36ba487f4eb9cac3f5c8f07cd9f586870bba4488a51e674cf8147f05718534f482836e6a4e3f66e0d4ef6821900c7dfd04e
2019-12-16 16:07:20 -05:00
MarcoFalke
48d64d73c0
Merge #17564: rpc: Use mempool from node context instead of global
fa8e650b52 rest: Use mempool from node context instead of global (MarcoFalke)
fa660d65d7 node: Use mempool from node context instead of global (MarcoFalke)
facbaf092f rpc: Use mempool from node context instead of global (MarcoFalke)

Pull request description:

  Currently they are identical, but in the future we might want to turn
  the mempool into a unique_ptr. Replacing the global with the mempool
  pointer from the node context simplifies this step.

ACKs for top commit:
  jnewbery:
    Code review ACK fa8e650b5
  ryanofsky:
    Code review ACK fa8e650b52, Only the discussed REST server changes since the last review.

Tree-SHA512: 0836f3f39cf90306455962918446e5f8612e88c32072b92afc30929aea1f17430bbda0e2b3668d36c9d6b97d63a93cf4903185194571108642b7bf5a39b89125
2019-12-16 16:05:06 -05:00
fanquake
988eaf2fcb
Merge #17752: doc: fix directory path for secp256k1 subtree in developer-notes
a5089f62bd fix directory path for secp256k1 subtree in developer-notes (hackerrdave)

Pull request description:

  Documentation update to fix the directory path of the `secp256k1` subtree in the developer notes

ACKs for top commit:
  laanwj:
    ACK a5089f62bd

Tree-SHA512: d0986721d7091af26edaee769db78c9aabac25bbaddb2a1bfa96c7208187226e280e9c38897b5227ee6c9e40d5a1af86bb7c58e72c6a30a94a478c4bf54c086e
2019-12-16 11:00:03 -05:00
MarcoFalke
fa8e650b52
rest: Use mempool from node context instead of global 2019-12-16 10:45:22 -05:00
MarcoFalke
806a2c602c
Merge #17071: tests: Add fuzzing harness for CheckBlock(...) and other CBlock related functions
893aa207e8 tests: Add fuzzing harness for CheckBlock(...) and other CBlock related functions (practicalswift)
ec8dcb0199 tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift)

Pull request description:

  Add fuzzing harness for `CheckBlock(...)` and other `CBlock` related functions.

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/block
  …
  # And to to quickly verify that the relevant code regions are triggered, that the
  # fuzzing throughput seems reasonable, etc.
  $ contrib/devtools/test_fuzzing_harnesses.sh '^block$'
  ```

  `test_fuzzing_harnesses.sh` can be found in PR #17000.

Top commit has no ACKs.

Tree-SHA512: 275abd46d8ac970b28d8176f59124988b1e07c070173e001acd55995b830333417f301c309199fc589da08a6ac4c03aa74650d5e1638f6e3023dfbd3c9f6921d
2019-12-16 10:23:22 -05:00
MarcoFalke
6b51cce65a
Merge #17753: util: Don't allow Base32/64-decoding or ParseMoney(…) on strings with embedded NUL characters. Add tests.
137c80d579 tests: Add tests for decoding/parsing of base32, base64 and money strings containing NUL characters (practicalswift)
a6fc26da55 util: Don't allow DecodeBase32(...) of strings with embedded NUL characters (practicalswift)
93cc18b0f6 util: Don't allow DecodeBase64(...) of strings with embedded NUL characters (practicalswift)
ccc53e43c5 util: Don't allow ParseMoney(...) of strings with embedded NUL characters (practicalswift)

Pull request description:

  Don't allow Base32/64-decoding or `ParseMoney(…)` on strings with embedded `NUL` characters. Add tests.

  Added tests before:

  ```
  $ src/test/test_bitcoin
  Running 385 test cases...
  test/base32_tests.cpp(31): error: in "base32_tests/base32_testvectors":
      check failure == true has failed [false != true]
  test/base64_tests.cpp(31): error: in "base64_tests/base64_testvectors":
      check failure == true has failed [false != true]
  test/util_tests.cpp(1074): error: in "util_tests/util_ParseMoney":
      check !ParseMoney(std::string("\0-1", 3), ret) has failed
  test/util_tests.cpp(1076): error: in "util_tests/util_ParseMoney":
      check !ParseMoney(std::string("1\0", 2), ret) has failed

  *** 4 failures are detected in the test module "Bitcoin Core Test Suite"
  ```

  Added tests after:

  ```
  $ src/test/test_bitcoin
  Running 385 test cases...

  *** No errors detected
  ```

ACKs for top commit:
  laanwj:
    Code review ACK 137c80d579

Tree-SHA512: 9486a0d32b4cf686bf5a47a0778338ac571fa39c66ad6d6d6cede58ec798e87bb50a2f9b7fd79ecd1fef1ba284e4073c1b430110967073ff87bdbbde7cada447
2019-12-16 10:17:17 -05:00
Wladimir J. van der Laan
5e4912f990
Merge #17730: depends: remove Qt networking features
244501fc85 depends: disable unused qt networking features (fanquake)
29d56c62b7 depends: -optimized-qmake is now -optimized-tools (fanquake)
ccdda96804 depends: skip building qt proxies (fanquake)

Pull request description:

  Somewhat of a followup to removing BIP70 support in #17165. This removes networking features from our Qt build. This also removes the need to link against the `CFNetwork` and `SystemConfiguration` libraries on macOS.

  ```diff
  src/qt/bitcoin-qt:
   /usr/lib/libSystem.B.dylib
   /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
   /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
   /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
   /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
   /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
   /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  -/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
   /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
   /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
   /usr/lib/libc++.1.dylib
  -/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
   /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
   /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
   /usr/lib/libobjc.A.dylib
  ```

  > Introduced the -optimized-tools option; supersedes -optimized-qmake.

  `optimized-qmake` became `optimized-tools` in Qt 5.6.0. While the former still works, we can use the newer flag.

  A diff of the removed symbols is available [here](https://gist.github.com/fanquake/9c8d5961c91f90a2966191367adfb391).

  We still need to actually build the network module, because we are using `QLocalServer` & `QLocalSocket` in the payment server.

ACKs for top commit:
  Sjors:
    Code review ACK 244501fc85: just a rebase (_updated since I accidentally repeated the previous hash_)
  practicalswift:
    ACK 244501fc85 -- diff looks correct
  promag:
    Code review ACK 244501fc85.

Tree-SHA512: 79734e3c96c40e7e484c86ac4cd4f738c05fcebe4771aeac443883f618a6c766e667909d5f8f14f9bd82f43206387c952458c5fa765cd0830f8beda6e6ac80ae
2019-12-16 13:28:57 +01:00
Wladimir J. van der Laan
c3628e4483
Merge #17743: doc: Add release note for RPC Whitelist
7965e0b41a doc: Add release note for RPC Whitelist (Emil Engler)

Pull request description:

  A release note for #12763

ACKs for top commit:
  laanwj:
    ACK 7965e0b41a

Tree-SHA512: 4ac3e62029a403e64e4cd3183433dc7aa071d42688b689d7cffb8f08dc4b26d2a586d32fa791d2b5679d6b95cd6e34c56e40a5592b9af446ad9429307f7267fe
2019-12-16 11:02:09 +01:00
practicalswift
137c80d579 tests: Add tests for decoding/parsing of base32, base64 and money strings containing NUL characters 2019-12-16 09:23:19 +00:00
practicalswift
a6fc26da55 util: Don't allow DecodeBase32(...) of strings with embedded NUL characters 2019-12-16 09:04:36 +00:00
practicalswift
93cc18b0f6 util: Don't allow DecodeBase64(...) of strings with embedded NUL characters 2019-12-16 09:04:36 +00:00
practicalswift
ccc53e43c5 util: Don't allow ParseMoney(...) of strings with embedded NUL characters 2019-12-16 09:04:35 +00:00
hackerrdave
a5089f62bd fix directory path for secp256k1 subtree in developer-notes 2019-12-15 19:58:51 -05:00
practicalswift
893aa207e8 tests: Add fuzzing harness for CheckBlock(...) and other CBlock related functions 2019-12-15 21:38:34 +00:00
practicalswift
ec8dcb0199 tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus 2019-12-15 21:27:38 +00:00
John Newbery
7aab8d1024 [style] Code style fixups in GetWarnings() 2019-12-15 17:05:52 -03:00
Emil Engler
7965e0b41a
doc: Add release note for RPC Whitelist 2019-12-15 20:49:49 +01:00
John Newbery
492c6dc1e7 util: change GetWarnings parameter to bool
GetWarnings() changes the format of the output warning string based on a
passed-in string argument that can be set to "gui" or "statusbar".
Change the argument to a bool:

- there are only two types of behaviour, so a bool is a more natural
argument type
- changing the name to 'verbose' does not set any expectations for the
how the calling code will use the returned string (currently,
'statusbar' is used for RPC warnings, not a status bar)
- removes some error-handling code for when the passed-in string is not
one of the two strings expected.
2019-12-15 13:24:48 -03:00
John Newbery
869b6314fd [qt] remove unused parameter from getWarnings() 2019-12-15 13:23:30 -03:00
Wladimir J. van der Laan
a595011f5a
Merge #17728: rpc: require second argument only for scantxoutset start action
7d263571be rpc: require second argument only for scantxoutset start action (Andrew Chow)

Pull request description:

  It was reported on [IRC](http://www.erisian.com.au/bitcoin-core-dev/log-2019-12-11.html#l-377) that `scantxoutset`'s API was broken in 0.19.0:

  ```
  <belcher> i think scantxoutset may have been broken in bitcoin core 0.19 ? regardless of what parameters i run it with (e.g. "scantxoutset abort", "scantxoutset status") it just returns the help doc, according to the release notes the only change was https://github.com/bitcoin/bitcoin/pull/16285/files but i dont see anything that wouldve broken it, it works fine in 0.18
  <belcher> im on regtest, in case its important
  <harding> I can confirm `scantxoutset abort` returns the help doc on latest master.  Waiting for 0.18.1 to start now to attempt to reproduce there.
  <harding> It looks like it's expecting a second parameter (even though that doesn't make sense with "abort").
  <jonatack> Same for me as well
  <harding> Can also confirm that `scantxoutset abort` returns the expected result on 0.18.1.
  ```

  As noted in the conversation, previously, the second argument of `scanobjects` is only required for the `start` action. `Stop` and `abort` actions did not and could work without them.

  It appears that this was broken by #16240 which enforced the size of the arguments to match the listed required arguments.

  To fix this issue, this PR makes the `scanobjects` argument an optional argument. Then only in the `start` action do we check whether the `scanobjects` argument is there and throw an informative error about that. Also a test is added for this case.

ACKs for top commit:
  laanwj:
    ACK 7d263571be
  promag:
    ACK 7d263571be.

Tree-SHA512: 828bdfe47f4fffa5d00a2cf88db6cea4a2714d9c49276841ca5cbdd1603b87bb6862147b86edcf36d7b40314ddb80b1a07fd399faf288572c55cc788c5cf9526
2019-12-15 13:07:07 +01:00
Elichai Turkel
e190000869
ci-s390x: Add qemu and depends support in the ci script 2019-12-14 18:27:13 +02:00
Wladimir J. van der Laan
ddecb671f0
Merge #17654: Unbreak build with Boost 1.72.0
a64e97dd47 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Regressed by https://github.com/boostorg/filesystem/commit/9a14c37d6f95. See [error log](http://package22.nyi.freebsd.org/data/113amd64-default-PR241449/2019-11-27_11h48m22s/logs/bitcoin-0.19.0.1.log).
  35eda631ed/src/fs.h (L14)

ACKs for top commit:
  MarcoFalke:
    ACK a64e97dd47

Tree-SHA512: 0aad2b8ec211bb81021a2f8cd2059364f949be716ebaf154dd97d5c2f7119f42553892e90e6c375018ff2155b996690c7520374762259778de88014cb531ad3b
2019-12-13 15:39:32 +01:00
fanquake
244501fc85
depends: disable unused qt networking features 2019-12-13 08:30:26 -05:00
fanquake
29d56c62b7
depends: -optimized-qmake is now -optimized-tools 2019-12-13 08:30:26 -05:00
fanquake
ccdda96804
depends: skip building qt proxies 2019-12-13 08:30:26 -05:00
Wladimir J. van der Laan
988fe5b1ad
Merge #12763: Add RPC Whitelist Feature from #12248
2081442c42 test: Add test for rpc_whitelist (Emil Engler)
7414d3820c Add RPC Whitelist Feature from #12248 (Jeremy Rubin)

Pull request description:

  Summary
  ====

  This patch adds the RPC whitelisting feature requested in #12248. RPC Whitelists help enforce application policies for services being built on top of Bitcoin Core (e.g., your Lightning Node maybe shouldn't be adding new peers). The aim of this PR is not to make it advisable to connect your Bitcoin node to arbitrary services, but to reduce risk and prevent unintended access.

  Using RPC Whitelists
  ====
  The way it works is you specify (in your bitcoin.conf) configurations such as

  ```
  rpcauth=user1:4cc74397d6e9972e5ee7671fd241$11849357f26a5be7809c68a032bc2b16ab5dcf6348ef3ed1cf30dae47b8bcc71
  rpcauth=user2:181b4a25317bff60f3749adee7d6bca0$d9c331474f1322975fa170a2ffbcb176ba11644211746b27c1d317f265dd4ada
  rpcauth=user3:a6c8a511b53b1edcf69c36984985e$13cfba0e626db19061c9d61fa58e712d0319c11db97ad845fa84517f454f6675
  rpcwhitelist=user1:getnetworkinfo
  rpcwhitelist=user2:getnetworkinfo,getwalletinfo, getbestblockhash
  rpcwhitelistdefault=0
  ```

  Now user1 can only call getnetworkinfo, user2 can only call getnetworkinfo or getwalletinfo, while user3 can still call all RPCs.

  If any rpcwhitelist is set, act as if all users are subject to whitelists unless rpcwhitelistdefault is set to 0. If rpcwhitelistdefault is set to 1 and no rpcwhitelist is set, act as if all users are subject to whitelists.

  Review Request
  =====
  In addition to normal review, would love specific review from someone working on LN (e.g., @ roasbeef) and someone working on an infrastructure team at an exchange (e.g., @ jimpo) to check that this works well with their system.

  Notes
  =====

  The rpc list is spelling sensitive -- whitespace is stripped though. Spelling errors fail towards the RPC call being blocked, which is safer.

  It was unclear to me if HTTPReq_JSONRPC is the best function to patch this functionality into, or if it would be better to place it in exec or somewhere else.

  It was also unclear to me if it would be preferred to cache the whitelists on startup or parse them on every RPC as is done with multiUserAuthorized. I opted for the cached approach as I thought it was a bit cleaner.

  Future Work
  =====

  In a future PR, I would like to add an inheritance scheme. This seemed more controversial so I didn't want to include that here. Inheritance semantics are tricky, but it would also make these whitelists easier to read.

  It also might be good to add a `getrpcwhitelist` command to facilitate permission discovery.

  Tests
  =====
  Thanks to @ emilengler for adding tests for this feature. The tests cover all cases except for where `rpcwhitelistdefault=1` is used, given difficulties around testing with the current test framework.

ACKs for top commit:
  laanwj:
    ACK 2081442c42

Tree-SHA512: 0dc1ac6a6f2f4b0be9c9054d495dd17752fe7b3589aeab2c6ac4e1f91cf4e7e355deedcb5d76d707cbb5a949c2f989c871b74d6bf129351f429569a701adbcbf
2019-12-13 11:27:36 +01:00
Wladimir J. van der Laan
995b6c83e1
Merge #17721: util: Don't allow Base58 decoding of non-Base58 strings. Add Base58 tests.
d945c6f5e6 util: Don't allow base58-decoding of std::string:s containing non-base58 characters (practicalswift)
ff7a999226 tests: Add tests for base58-decoding of std::string:s containing non-base58 characters (practicalswift)

Pull request description:

  Don't allow Base58 decoding of non-Base58 strings. Add Base58 tests.

  Fixes #17718.

  Added tests before the Base58 decoding patch:

  ```
  $ make check
  …
  test/base58_tests.cpp(62): error: in "base58_tests/base58_DecodeBase58":
      check !DecodeBase58(std::string("\0invalid", 8), result) has failed
  test/base58_tests.cpp(67): error: in "base58_tests/base58_DecodeBase58":
      check !DecodeBase58(std::string("good\0bad0IOl", 12), result) has failed
  test/base58_tests.cpp(76): error: in "base58_tests/base58_DecodeBase58":
      check !DecodeBase58Check(std::string("3vQB7B6MrGQZaxCuFg4oh\00IOl", 26), result) has failed
  *** 3 failures are detected in the test module "Bitcoin Core Test Suite"
  …
  $ echo $?
  1
  ```

  Added tests before the Base58 decoding patch:

  ```
  $ make check
  …
  OK
  …
  $ echo $?
  0
  ```

ACKs for top commit:
  MarcoFalke:
    ACK d945c6f5e6 🚓
  laanwj:
    ACK d945c6f5e6

Tree-SHA512: 78fee3a18718c9cfbf2e4b26daaf8f24b4deca00475b7b254fec7f8be740f8898c696d9cd0eaa7c50bca55909b9dff3b516b6fe4db92dc132dcc0a1c5e3d61af
2019-12-13 11:15:28 +01:00
Wladimir J. van der Laan
d4b335c60a
Merge #17617: doc: unify unix epoch time descriptions
d94d34f05f doc: update developer notes wrt unix epoch time (Jon Atack)
e2f32cb5c5 qa: unify unix epoch time descriptions (Jon Atack)

Pull request description:

  Closes #17613.

  Updated call sites: mocktime, getblockheader, getblock, pruneblockchain,
  getchaintxstats, getblocktemplate, setmocktime, getpeerinfo, setban,
  getnodeaddresses, getrawtransaction, importmulti, listtransactions,
  listsinceblock, gettransaction, getwalletinfo, getaddressinfo

  Commands for testing manually:
  ```
  bitcoind -help-debug | grep -A1 mocktime
  bitcoin-cli help getblockheader
  bitcoin-cli help getblock
  bitcoin-cli help pruneblockchain
  bitcoin-cli help getchaintxstats
  bitcoin-cli help getblocktemplate
  bitcoin-cli help setmocktime
  bitcoin-cli help getpeerinfo
  bitcoin-cli help setban
  bitcoin-cli help getnodeaddresses
  bitcoin-cli help getrawtransaction
  bitcoin-cli help importmulti
  bitcoin-cli help listtransactions
  bitcoin-cli help listsinceblock
  bitcoin-cli help gettransaction
  bitcoin-cli help getwalletinfo
  bitcoin-cli help getaddressinfo
  ```

ACKs for top commit:
  laanwj:
    re-ACK d94d34f05f

Tree-SHA512: 060713ea4e20ab72c580f06c5c7e3ef344ad9c2c9cb034987d980a54e3ed2ac0268eb3929806daa5caa7797c45f5305254fd499767db7f22862212cf77acf236
2019-12-13 10:53:47 +01:00
Jon Atack
d94d34f05f
doc: update developer notes wrt unix epoch time 2019-12-13 02:05:05 +01:00
Jon Atack
e2f32cb5c5
qa: unify unix epoch time descriptions
to "UNIX epoch time".

Call sites updated:
```
mocktime
getblockheader
getblock
pruneblockchain
getchaintxstats
getblocktemplate
setmocktime
getpeerinfo
setban
getnodeaddresses
getrawtransaction
importmulti
listtransactions
listsinceblock
gettransaction
getwalletinfo
getaddressinfo
```
2019-12-13 02:02:29 +01:00
MarcoFalke
c5e318aea6
Merge #17736: Update msvc build for Visual Studio 2019 v16.4
75d9317bc1 Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)

Pull request description:

  msvc warning C4834 for the Bitcoin Core build was introduced by Visual Studio 16.4.0. This PR adds an ignore rule for the warning (it's related to the nodiscard attribute and is not considered relevant).

  An additional side effect of the msvc compiler update is the prebuilt Qt5.9.8 libraries cannot be linked due to being built with an earlier version of the compiler. To fix this a new Qt5.9.8 version has been compiled and the appveyor job updated to use them.

  The GitHub Actions job needs to continue to use the original Qt5.9.8 libraries until the latest GitHub Windows image also updates to >= Visual Studio 2019 v16.4.

Top commit has no ACKs.

Tree-SHA512: c28d64d78a968eb0bd614932b2d42d762d68853120c345970072b473e2c43fb34e99865062ae1517b10e76f269de6b8f4eed119cf05d59aa883a3553d6a76812
2019-12-12 15:55:33 -05:00
Emil Engler
2081442c42 test: Add test for rpc_whitelist 2019-12-12 11:52:26 -08:00
Aaron Clauson
75d9317bc1
Update msvc build for Visual Studio 2019 v16.4
msvc warning C4834 for the Bitcoin Core build was introduced by Visual Studio 16.4.0. This PR adds an ignore rule for the warning (it's related to the nodiscard attribute and is not considered relevant).
An additional side effect of the msvc compiler update is the prebuilt Qt5.9.8 libraries cannot be linked due to being built with an earlier version of the compiler. To fix this a new Qt5.9.8 version has been compiled and the appveyor job updated to use them. The GitHub Actions job needs to continue to use the original Qt5.9.8 libraries until the latest GitHub Windows image also updates to >= Visual Studio 2019 v16.4.
2019-12-12 18:51:30 +00:00
MarcoFalke
54e11a39e1
Merge #17735: ci: fix typo
5096baf26b build: fix typo (Harris)

Pull request description:

  This PR fixes a typo in .github/workflows/ci.yml.

  test_bticoin => test_bitcoin.

ACKs for top commit:
  practicalswift:
    ACK 5096baf26b

Tree-SHA512: 478fb906adad493ae75872157d269e5060002878784968cfa44b23973b6fccb30cd643728d081a9ed20cff652a8784a33bc281ca5804935ed3c918200190cc9e
2019-12-12 10:54:53 -05:00
Harris
5096baf26b
build: fix typo 2019-12-12 16:11:05 +01:00
fanquake
cf2f439876
Merge #17687: cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
034561f9cd cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)

Pull request description:

  This PR fixes #17679 by replacing BlockFilterType-vector with a set of the same type to make sure that only unique filter types get inserted.

ACKs for top commit:
  MarcoFalke:
    ACK 034561f9cd 📖
  laanwj:
    ACK 034561f9cd
  fanquake:
    ACK 034561f9cd - Tested with `src/bitcoind --blockfilterindex=basic --blockfilterindex=basic`

Tree-SHA512: 64ccec4d23528abfbb564f2b41fb846137875260ce06ea461da12175819985964a1a7442788d5ff7282b5de0c5fd46524d9a793788ee3b876626cbdf05b28c16
2019-12-12 08:04:31 -05:00
fanquake
8a01450b64
Merge #17598: doc: Update release process with latest changes
fab2f351f2 doc: Update release process with latest changes (MarcoFalke)

Pull request description:

  Mainly adding the reminder to bump the flatpak

ACKs for top commit:
  laanwj:
    ACK fab2f351f2
  fanquake:
    ACK fab2f351f2

Tree-SHA512: fe279a6cdee881e8dd608cb7d09d992c4b668b01b9d0d2dbfaf92f12f3032b8fcb2c256b20fcee861397451add1338f162b6e5fa7b3c21e76c247cc419315284
2019-12-12 07:06:21 -05:00