Commit graph

21792 commits

Author SHA1 Message Date
Jorge Timón
1abcecc40c
Tests: Use self.chain instead of 'regtest' in almost all current tests 2019-10-26 13:24:39 +02:00
Wladimir J. van der Laan
be50469217
Merge #17257: gui: disable font antialiasing for QR image address
e156b9d8b9 gui: disable font antialiasing for QR image address (fanquake)

Pull request description:

  The address text inside the QR code is currently fairly blurry / unreadable. Explicitly disabling font antialiasing improves that somewhat.

  master (693e40090a):
  ![macOS_master](https://user-images.githubusercontent.com/863730/67591414-644e0580-f72b-11e9-8399-2cd0584e7d62.png)

  PR (e156b9d8b9):
  ![macOS_pr](https://user-images.githubusercontent.com/863730/67591424-6dd76d80-f72b-11e9-86b6-b3911f8e07e6.png)

ACKs for top commit:
  laanwj:
    ACK e156b9d8b9

Tree-SHA512: 32aeb2ffe8164a1006f80e76c6e413fcb88e32ced42d2b2af69cca908bd32673f3e379184be917f1870864b940db943e7f46a7ecb0779343d5d129b381660c38
2019-10-26 13:06:18 +02:00
Wladimir J. van der Laan
9bd109b78d
Merge #17120: gui: Fix start timer from non QThread
a8f5026d6d gui: Fix start timer from non QThread (João Barbosa)

Pull request description:

  Fixes #16296.

ACKs for top commit:
  laanwj:
    code review ACK a8f5026d6d

Tree-SHA512: d7b05ac88e188de16cbbe80cb2f773b7976ee07ee876ac94a93f9351856c4f3a9d66a531d3f3748d2dccff8c8d77d9d8227433069ed5909c32be2efeaa32f655
2019-10-26 13:00:16 +02:00
Wladimir J. van der Laan
3f875744cb
Merge #17249: rpc: Add missing deque include to fix build
a592913022 http: add missing header bootlegged by boost < 1.72 (Jan Beich)

Pull request description:

  Regressed by boostorg/filesystem@9a14c37d6f. See [error log](https://github.com/bitcoin/bitcoin/files/3772177/bitcoin-0.18.1.log).

  ```c++
  httpserver.cpp:74:10: error: no template named 'deque' in namespace 'std'
      std::deque<std::unique_ptr<WorkItem>> queue;
      ~~~~~^
  ```

ACKs for top commit:
  laanwj:
    ACK a592913022

Tree-SHA512: fb0aee6a698c7aaa6a73baad7adc4f891be573af0d3cf6f4f59bc825afe5c0bc439c668077ff1990a6135522a0533a1a867430eebad28f0ade93fd79a95e179b
2019-10-26 12:05:04 +02:00
Wladimir J. van der Laan
e9f73b839a
Merge #17135: gui: Make polling in ClientModel asynchronous
6b6be41c36 gui: Make polling in ClientModel asynchronous (João Barbosa)

Pull request description:

  After #14193 `ClientModel::updateTimer` can take some time, as such the GUI hangs, like #17112.

  Fixes this by polling in a background thread and updating the GUI asynchronously.

ACKs for top commit:
  laanwj:
    ACK 6b6be41c36
  Sjors:
    Code review re-ACK 6b6be41; only replaced the scary cast with `{ timer->start(); }`

Tree-SHA512: fd98b0c6535441aee3ee03c48b58b4b1f9bdd172ec6b8150da883022f719df34cabfd4c133412bf410e7f709f7bf1e9ef16dca05ef1f3689d526ceaeee51de38
2019-10-26 11:49:51 +02:00
Wladimir J. van der Laan
d91af4768c
Merge #17165: Remove BIP70 support
8c6081a884 compat: remove bswap_* check on macOS (fanquake)
2cba35ab38 build: skip building OpenSSL lib_ssl (fanquake)
45a2d3c552 build: remove OpenSSL from Qt build (fanquake)
befbc40eb5 build: remove EVP_MD_CTX_new detection (fanquake)
fcee10c2d0 build: remove SSL lib detection (fanquake)
c7f30dbca8 gui: Update BIP70 support message (fanquake)
a3e810326d build: remove BIP70 entries from macOS Info.plist (fanquake)
72fe13a58d gui: remove payment request file handling from OpenURI dialog (fanquake)
3548e4aac7 Remove BIP70 Support (fanquake)
1cb9a4e28c docs: remove protobuf from docs (fanquake)
67328bb7ca build: remove protobuf from depends (fanquake)

Pull request description:

  This removes [BIP70](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) support. It also removes OpenSSL linking from Qt and building OpenSSLs `lib_ssl` in depends, as well as SSL lib detection from the build system. It's something that I'd optimistically like to do for `0.20.0`.

ACKs for top commit:
  laanwj:
    Code review ACK 8c6081a884
  MarcoFalke:
    ACK 8c6081a884
  fjahr:
    ACK 8c6081a

Tree-SHA512: 9dd9153afa4eca1a795f983e5b31f5fee9fa9a064c2a95d2f98810689add3ad0bf221c4608282299e66e4d1ec31cd556d4b16eea55de7912c3b9931f64735883
2019-10-26 11:35:45 +02:00
fanquake
25d7e2e781
Merge #17251: net: SocketHandler logs peer id for close and disconnect
04dbdd613f [net] SocketHandler: log peer id for close and disconnect (Sjors Provoost)

Pull request description:

  When combined with `-logips` this makes it easier to diagnose disconnects.

  To test on macOS, find a connection you want to disrupt:

  ```
  lsof -nP -iTCP:8333 -sTCP:ESTABLISHED
  ```

  To shut it down gracefully you can use tcpkill or this Python script: https://github.com/google/tcp_killer

  The log should say:

  ```
  2019-10-25T13:26:55Z socket closed for peer=1
  2019-10-25T13:26:55Z disconnecting peer=1
  2019-10-25T13:26:55Z Cleared nodestate for peer=1
  ```

  To shut it down ungracefully I made a patch to the above script, adding a `-force` argument. _Careful, this may result in data corruption_. Then the log should say:

  ```
  2019-10-25T13:39:57Z socket select error Bad file descriptor (9)
  2019-10-25T13:39:57Z socket recv error for peer=0: Bad file descriptor (9)
  2019-10-25T13:39:57Z disconnecting peer=0
  2019-10-25T13:39:57Z Socket close failed: 35. Error: Bad file descriptor (9)
  2019-10-25T13:39:57Z Cleared nodestate for peer=0
  ```

ACKs for top commit:
  MarcoFalke:
    unsigned ACK 04dbdd613f
  TheBlueMatt:
    unsigned ACK 04dbdd613f LGTM!
  theuni:
    unsigned ACK 04dbdd613f.

Tree-SHA512: 415313908484f97ffe11a48b4ed6afab3ab0be660c788adb9ad975f88b69aa1cfd5ccbe5859350cdf19ef8fde191fd530fb22cef34e70638defdc9f3d761c71d
2019-10-25 15:07:58 -04:00
Sjors Provoost
04dbdd613f
[net] SocketHandler: log peer id for close and disconnect 2019-10-25 20:05:30 +02:00
fanquake
e156b9d8b9
gui: disable font antialiasing for QR image address
More info available here: https://doc.qt.io/qt-5/qfont.html#StyleStrategy-enum
2019-10-25 13:20:32 -04:00
MarcoFalke
693e40090a
Merge #17083: tests: Add fuzzing harness for various CScript related functions
dc2fdb9907 tests: Add fuzzing harness for various CScript related functions (practicalswift)

Pull request description:

  Add fuzzing harness for various `CScript` related functions.

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/script
  …
  # 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 '^script$'
  ```

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

Top commit has no ACKs.

Tree-SHA512: a0c5dca3b64ae177020b2ca299a29015d70755231b6bf01edbfc67c8aac90c44b1b4d57350c3aebef6e031108e6ae8e5fa0987c67707831c314f5d3090e0cee8
2019-10-25 11:05:56 -04:00
João Barbosa
6b6be41c36 gui: Make polling in ClientModel asynchronous
With this change polling runs in a different thread to prevent
disturbing the event loop.
2019-10-25 14:53:37 +01:00
Jan Beich
a592913022 http: add missing header bootlegged by boost < 1.72
httpserver.cpp:74:10: error: no template named 'deque' in namespace 'std'
    std::deque<std::unique_ptr<WorkItem>> queue;
    ~~~~~^
2019-10-25 13:11:09 +00:00
fanquake
48cb468ce3
Merge #17242: refactor: Remove unused cacheSigStore from CheckInputsFromMempooAndCache
0a433fc876 [validation] Remove unused cacheSigStore from CheckInputsFromMempoolAndCache (John Newbery)

Pull request description:

  CheckInputsFromMempoolAndCache() is only called in one place, and
  cacheSigStore is set to true in that call site. Remove the argument
  entirely.

  Also improve commenting.

ACKs for top commit:
  MarcoFalke:
    unsigned ACK 0a433fc876 Comment looks good
  jamesob:
    ACK 0a433fc876
  laanwj:
    ACK 0a433fc876
  fanquake:
    ACK 0a433fc876. Checked that `CheckInputsFromMempoolAndCache` is only called once, in `MemPoolAccept::ConsensusScriptChecks`, and that `cacheSigStore` is true.

Tree-SHA512: e4b4d2550e35df55c8f8fa4c539174cc2d3728112ddb937cb2ff759d8630a01566b5ec42a70a82e33994e6586f5a457a75a59f64b15d27c65331c723cbb097af
2019-10-25 08:14:11 -04:00
Wladimir J. van der Laan
37855ec9df
Merge #17220: tests: Add unit testing for the CompressScript function
b05ec410f2 Add unit testing for the CompressScript functions (marcaiaf)

Pull request description:

  Salvaging #15104 which adds unit tests for CompressScript function in `compressor.cpp`

  Tested following cases for the CScript:
    - CKeyID
    - CScriptID
    - Uncompressed CPubKey (of size: 65)
    - Compressed CPubKey (of size: 32)

ACKs for top commit:
  theStack:
    ACK b05ec410f2

Tree-SHA512: 7e23ace39383122802dfe5f7d38190d772f5db4045a67b7a9bd4c06797a17e0cdc41d6fac92d448057eb7df50172155dc824587c16c68c79fd1a4de37b772001
2019-10-25 13:55:58 +02:00
Wladimir J. van der Laan
90ed98ae9a
Merge #17080: consensus: Explain why fCheckDuplicateInputs can not be skipped and remove it
fa92813407 consensus: Explain why fCheckDuplicateInputs can not be skipped and remove it (MarcoFalke)

Pull request description:

  As a follow up to CVE-2018-17144, this removes the unused `fCheckDuplicateInputs` parameter and explains why the test can not be disabled. Apart from protecting against a dumb accident in the future, this should document the logic in the code. There is a technical write-up that explains how the underlying coins database behaves if this test is skipped: https://bitcoincore.org/en/2018/09/20/notice/#technical-details. However, it does not explicitly mention why the test can not be skipped. I hope my code comment does that.

ACKs for top commit:
  jnewbery:
    ACK fa92813407
  amitiuttarwar:
    utACK fa92813407
  Empact:
    Code review ACK fa92813407
  promag:
    ACK fa92813407.

Tree-SHA512: fc1ef670f1a467c543b84f704b9bd8cc7a59a9f707be048bd9b4e85fe70830702aa560a880efa2c840bb43818ab44dfdc611104df04db2ddc14ff92f46bfb28e
2019-10-25 13:47:28 +02:00
Wladimir J. van der Laan
366753e46e
Merge #17231: depends: fix boost mac cross build with clang 9+
50037e97d1 depends: fix boost mac cross build with clang 9+ (Cory Fields)

Pull request description:

  The ancient "darwin-4.9.1" profile has long been used to match against clang, which prior to version 9, reported 4.9.1 as its version when invoking "clang++ -dumpversion". Presumably this was a historical compatibility quirk related to Apple's switch from gcc to clang.

  This was "fixed" in clang 9.0, so that -dumpversion reports the real version. Unfortunately that had the side-effect of breaking the (brittle) boost compiler detection.

  Move to the seemingly more-correct "clang-darwin" profile, which passes the checks and builds correctly.

  Also switch to using ar rather than libtool for archiving, as it's what the clang-darwin profile expects to be using.

  Note that because this is using a different profile, some of the final command-line arguments end up changing. Those changes look sane at a glance.

ACKs for top commit:
  fanquake:
    ACK 50037e97d1 - tested on on macOS, will wait for the gitian build.

Tree-SHA512: eac1f353513a445add6fbece7fc78dd3dbdde5e2219bfb7739b82f40bb14de449667a94d2e303d43c67d9b38e7ceb0ba5f0d8fe20b40be2017b1ca0875467c2c
2019-10-25 12:03:01 +02:00
practicalswift
dc2fdb9907 tests: Add fuzzing harness for various CScript related functions 2019-10-25 08:28:13 +00:00
MarcoFalke
fce7c75422
Merge #16851: Continue relaying transactions after they expire from mapRelay
168b781fe7 Continue relaying transactions after they expire from mapRelay (Anthony Towns)

Pull request description:

  This change allows peers to request transactions even after they've expired from mapRelay and even if they're not doing mempool requests. This is intended to allow for CPFP of old transactions -- if parent tx P wasn't relayed due to low fees, then a higher fee rate child C is relayed, peers will currently request the parent P, but we prior to this patch, we will not relay it due to it not being in mapRelay.

ACKs for top commit:
  MarcoFalke:
    re-ACK 168b781fe7 (only change is comment fixup)
  sdaftuar:
    re-ACK 168b781fe7
  sipa:
    ACK 168b781fe7

Tree-SHA512: b206666dd1450cd0a161ae55fd1a7eda2c3d226842ba27d91fe463b551fd924b65b92551b14d6786692e15cf9a9a989666550dfc980b48ab0f8d4ca305bc7762
2019-10-24 17:50:42 -04:00
MarcoFalke
773026044f
Merge #17212: refactor: Remove unused CExt{Pub,}Key (de)serialization methods
5b44a75493 refactor: Remove unused CExt{Pub,}Key (de)serialization methods (Sebastian Falbesoner)

Pull request description:

  As pointed out in issue #17130, the serialization/deserialization methods for the classes `CExtKey` and
  `CExtPubKey` are only used in the BIP32 unit tests and hence can be removed (see comments https://github.com/bitcoin/bitcoin/issues/17130#issuecomment-543750290, https://github.com/bitcoin/bitcoin/issues/17130#issuecomment-543794408 and https://github.com/bitcoin/bitcoin/issues/17130#issuecomment-543814727).

ACKs for top commit:
  practicalswift:
    ACK 5b44a75493 -- -60 LOC diff looks correct :)
  promag:
    ACK 5b44a75493.
  MarcoFalke:
    unsigned ACK 5b44a75493
  fjahr:
    ACK 5b44a75
  jonatack:
    Light ACK 5b44a75493. Built, ran tests and bitcoind. `git blame` shows most of the last changes are from commit 90604f16af in 2015 to add bip32 pubkey serialization.

Tree-SHA512: 6887573b76b9e54e117a076557407b6f7908719b2202fb9eea498522baf9f30198b3f78b87a62efcd17ad1ab0886196f099239992ce7cbbaee79979ffe9e5f2c
2019-10-24 17:25:08 -04:00
fanquake
8c6081a884
compat: remove bswap_* check on macOS
This was originally added in #9366 to fix the gui build, as
Protobuf would also define these macros. Now that we're no-longer
using Protobuf, remove the additional check.
2019-10-24 16:01:44 -04:00
fanquake
2cba35ab38
build: skip building OpenSSL lib_ssl 2019-10-24 16:01:44 -04:00
fanquake
45a2d3c552
build: remove OpenSSL from Qt build
More info available from:
https://doc.qt.io/qt-5/ssl.html#enabling-and-disabling-ssl-support
2019-10-24 16:01:44 -04:00
fanquake
befbc40eb5
build: remove EVP_MD_CTX_new detection
This was added in #9475 to fix LibreSSL compatibility for
BIP70, so is no longer required.
2019-10-24 16:01:43 -04:00
fanquake
fcee10c2d0
build: remove SSL lib detection 2019-10-24 16:01:43 -04:00
fanquake
c7f30dbca8
gui: Update BIP70 support message 2019-10-24 16:01:43 -04:00
fanquake
a3e810326d
build: remove BIP70 entries from macOS Info.plist 2019-10-24 16:01:43 -04:00
fanquake
72fe13a58d
gui: remove payment request file handling from OpenURI dialog 2019-10-24 16:01:43 -04:00
fanquake
3548e4aac7
Remove BIP70 Support 2019-10-24 16:01:43 -04:00
fanquake
1cb9a4e28c
docs: remove protobuf from docs 2019-10-24 16:01:42 -04:00
fanquake
67328bb7ca
build: remove protobuf from depends 2019-10-24 16:01:42 -04:00
MarcoFalke
fa92813407
consensus: Explain why fCheckDuplicateInputs can not be skipped and remove it 2019-10-24 14:58:34 -04:00
Wladimir J. van der Laan
4af0447169
Merge #17240: ci: Disable functional tests on mac host
fa710066b9 ci: Disable functional tests on mac host (MarcoFalke)

Pull request description:

  Judging from the lack of responses to https://github.com/bitcoin/bitcoin/issues/15400#issuecomment-543745053, no one can reproduce the failures locally. Thus, disable the tests on the ci mac host. Otherwise they cause ci failures to be ignored or overwritten by a blind re-run.

ACKs for top commit:
  laanwj:
    ok, ACK fa710066b9 in that case
  ryanofsky:
    Code review ACK fa710066b9. I've been blindly restarting these but can confirm it seemed like random test failures.

Tree-SHA512: 805f552124409f6e79b16b419826d334307202b8e3636edc8a91dadffe9949554d924c00cb16bb09473ec1aaaf2d8eaf7a97c7c2b8c11bf6372135d39bba802b
2019-10-24 20:27:08 +02:00
John Newbery
0a433fc876 [validation] Remove unused cacheSigStore from CheckInputsFromMempoolAndCache
CheckInputsFromMempoolAndCache() is only called in one place, and
cacheSigStore is set to true in that call site. Remove the argument
entirely.

Also improve commenting.
2019-10-24 13:14:03 -04:00
MarcoFalke
fa710066b9
ci: Disable functional tests on mac host 2019-10-24 12:43:55 -04:00
fanquake
d7134ead84
Merge #17239: doc: Changed miniupnp links to https
6f6852335f doc: Changed miniupnp links to https (Marius Kjærstad)

Pull request description:

  doc: Changed miniupnp links to https

ACKs for top commit:
  fjahr:
    ACK 6f68523
  fanquake:
    ACK 6f6852335f - as mentioned in this [comment](https://github.com/bitcoin/bitcoin/pull/17166#issuecomment-545906845), in future, there's no need to open a new PR instead than squashing. One of the requirements of contributing to Bitcoin Core is some basic `git` usage, and we have some documentation on that in our [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits) (which also mentions not to open multiple PRs).

Tree-SHA512: 1e806326552b94dc1c2f105bed822a1dd56127d42bbb0c15a16623ff084b2047331f2f1ad5303c99b0d68c70ad2caf8e8028eb354ba4379973b9e1198676ce72
2019-10-24 11:36:25 -04:00
Marius Kjærstad
6f6852335f
doc: Changed miniupnp links to https
doc: Changed miniupnp links to https
2019-10-24 14:57:36 +02:00
MarcoFalke
d53828cb79
Merge #17235: tests: Skip unnecessary fuzzer initialisation. Hold ECCVerifyHandle only when needed.
c2f964a674 tests: Remove Cygwin WinMain workaround (practicalswift)
db4bd32cc3 tests: Skip unnecessary fuzzer initialisation. Hold ECCVerifyHandle only when needed. (practicalswift)

Pull request description:

  Skip unnecessary fuzzer initialisation. Hold `ECCVerifyHandle` only when needed.

  As suggested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/17018#discussion_r336645391.

Top commit has no ACKs.

Tree-SHA512: 598da44859d736e3fdc143b93e07f444d8ad19dfdab0cfe7c6ccff8644e862664d869337dfe6b49416ed09a0024e4a5f2220ca6246de568f9e9227d721baa28e
2019-10-24 08:32:07 -04:00
Wladimir J. van der Laan
205cffaf38
Merge #17226: gui: Fix payAmount tooltip in SendCoinsEntry
0fc81a1e87 gui: Fix payAmount tooltip in SendCoinsEntry (João Barbosa)

Pull request description:

  Before the tooltip shows in wrong places:

  ![Screenshot 2019-10-23 at 11 33 49](https://user-images.githubusercontent.com/3534524/67384904-f6b6a380-f589-11e9-832c-ec1643014b96.png)
  ![Screenshot 2019-10-23 at 11 33 23](https://user-images.githubusercontent.com/3534524/67384905-f74f3a00-f589-11e9-9944-a52fee097e02.png)

  Now only shows in the amount field:

  ![Screenshot 2019-10-23 at 11 35 30](https://user-images.githubusercontent.com/3534524/67384919-ff0ede80-f589-11e9-8ce4-c122e11fe885.png)

ACKs for top commit:
  laanwj:
    ACK 0fc81a1e87

Tree-SHA512: 0857e568c21d380a68c81e9be3212b1745d7d3199a1d5fdef9afc8feed0272f215726fa98bbf8a3fb332389c5454f2316bc1581f1a2ccd76cef46a0e3ac6f99f
2019-10-24 13:41:25 +02:00
Wladimir J. van der Laan
b688b859db
Merge #17004: validation: Remove REJECT code from CValidationState
9075d13153 [docs] Add release notes for removal of REJECT reasons (John Newbery)
04a2f326ec [validation] Fix REJECT message comments (John Newbery)
e9d5a59e34 [validation] Remove REJECT code from CValidationState (John Newbery)
0053e16714 [logging] Don't log REJECT code when transaction is rejected (John Newbery)
a1a07cfe99 [validation] Fix peer punishment for bad blocks (John Newbery)

Pull request description:

  We no longer send BIP 61 REJECT messages, so there's no need to set
  a REJECT code in the CValidationState object.

  Note that there is a minor bug fix in p2p behaviour here. Because the
  call to `MaybePunishNode()` in `PeerLogicValidation::BlockChecked()` only
  previously happened if the REJECT code was > 0 and < `REJECT_INTERNAL`,
  then there are cases were `MaybePunishNode()` can get called where it
  wasn't previously:

  - when `AcceptBlockHeader()` fails with `CACHED_INVALID`.
  - when `AcceptBlockHeader()` fails with `BLOCK_MISSING_PREV`.

  Note that `BlockChecked()` cannot fail with an 'internal' reject code. The
  only internal reject code was `REJECT_HIGHFEE`, which was only set in
  ATMP.

  This reverts a minor bug introduced in 5d08c9c579.

ACKs for top commit:
  ariard:
    ACK 9075d13, changes since last reviewed are splitting them in separate commits to ease understanding and fix nits
  fjahr:
    ACK 9075d13153, confirmed diff to last review was fixing nits in docs/comments.
  ryanofsky:
    Code review ACK 9075d13153. Only changes since last review are splitting the main commit and updating comments

Tree-SHA512: 58e8a1a4d4e6f156da5d29fb6ad6a62fc9c594bbfc6432b3252e962d0e9e10149bf3035185dc5320c46c09f3e49662bc2973ec759679c0f3412232087cb8a3a7
2019-10-24 10:49:45 +02:00
Wladimir J. van der Laan
8a191148db
Merge #17154: wallet: Remove return value from CommitTransaction
9e95931865 [wallet] Remove `state` argument from CWallet::CommitTransaction (John Newbery)
d1734f9a3b [wallet] Remove return value from CommitTransaction() (John Newbery)
b6f486a02b [wallet] Add doxygen comment to CWallet::CommitTransaction() (John Newbery)
8bba91b22d [wallet] Fix whitespace in CWallet::CommitTransaction() (John Newbery)

Pull request description:

  `CommitTransaction()` returns a bool to indicate success, but since commit
  b3a7410 (#9302) it only returns true, even if the transaction was not
  successfully broadcast. This commit changes CommitTransaction() to return
  void.

  All dead code in `if (!CommitTransaction())` branches has been removed.

  Two additional commits fix up the idiosyncratic whitespace in `CommitTransaction` and add a doxygen comment for the function.

ACKs for top commit:
  laanwj:
    ACK 9e95931865

Tree-SHA512: a55a2c20369a45222fc0e02d0891495655a926e71c4f52cb72624768dd7b9c1dca716ea67d38420afb90f40c6e0fd448caa60c18fd693bb10ecb110b641820e6
2019-10-24 10:16:12 +02:00
practicalswift
c2f964a674 tests: Remove Cygwin WinMain workaround 2019-10-24 08:07:59 +00:00
practicalswift
db4bd32cc3 tests: Skip unnecessary fuzzer initialisation. Hold ECCVerifyHandle only when needed. 2019-10-24 08:06:38 +00:00
MarcoFalke
c5ac7af779
Merge #17206: test: Add testcase to simulate bitcoin schema in leveldb
4896bacc00 Add testcase to simulate bitcoin schema in leveldb (MapleLaker)

Pull request description:

  Resurrecting #14125 with updates based on comments of closed PR

ACKs for top commit:
  laanwj:
    ACK 4896bacc00
  dongcarl:
    ACK 4896bacc00

Tree-SHA512: 3290ea7e1e998901d5ee8921d1d76cec399cae30ac1911a45b86826afed47cee1acf92bd6438f1fa11ed785a3b17abdcb1c169bc0419945eda9fe4c089d0b6eb
2019-10-23 15:49:43 -04:00
Cory Fields
50037e97d1 depends: fix boost mac cross build with clang 9+
The ancient "darwin-4.9.1" profile has long been used to match against
clang, which prior to version 9, reported 4.9.1 as its version when
invoking "clang++ -dumpversion". Presumably this was a historical
compatibility quirk related to Apple's switch from gcc to clang.

This was "fixed" in clang 9.0, so that -dumpversion reports the real
version. Unfortunately that had the side-effect of breaking the
(brittle) boost compiler detection.

Move to the seemingly more-correct "clang-darwin" profile, which passes
the checks and builds correctly.

Also switch to using ar rather than libtool for archiving, as it's what
the clang-darwin profile expects to be using.

Note that because this is using a different profile, some of the final
command-line arguments end up changing. The changes look sane at a
glance.
2019-10-23 14:02:39 -04:00
marcaiaf
b05ec410f2 Add unit testing for the CompressScript functions 2019-10-23 13:50:18 -04:00
MarcoFalke
deb2327b43
Merge #17018: tests: Add descriptor Parse(...) fuzzing harness
b5ffa9f3db tests: Add Parse(...) (descriptor) fuzzing harness (practicalswift)
fdef8bbf2f tests: Allow for using non-default fuzzing initialization (practicalswift)

Pull request description:

  Add `Parse(...)` (descriptor) fuzzing harness.

  To test this PR:

  We can run `test_fuzzing_harnesses.sh` (#17000) during ten seconds to quickly verify that the newly added  fuzz harness seem to hit relevant code regions, that the fuzzing throughput seems reasonable, etc.

  `test_fuzzing_harnesses.sh descriptor 10` runs all fuzzers matching the regexp `descriptor` giving them ten seconds of runtime each.

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined
  $ make
  $ contrib/devtools/test_fuzzing_harnesses.sh descriptor 10
  Testing fuzzer descriptor_parse during 10 second(s)
  A subset of reached functions:
          NEW_FUNC[0/17]: 0x55ec8a240c90 in tinyformat::detail::formatImpl(std::ostream&, char const*, tinyformat::detail::FormatArg const*, int) src/./tinyformat.h:791
          NEW_FUNC[4/17]: 0x55ec8a2435f0 in tinyformat::detail::printFormatStringLiteral(std::ostream&, char const*) src/./tinyformat.h:564
          NEW_FUNC[5/17]: 0x55ec8a2439d0 in tinyformat::detail::streamStateFromFormat(std::ostream&, bool&, int&, char const*, tinyformat::detail::FormatArg const*, int&, int) src/./tinyformat.h:601
          NEW_FUNC[6/17]: 0x55ec8a24a3d0 in tinyformat::detail::FormatArg::format(std::ostream&, char const*, char const*, int) const src/./tinyformat.h:513
          NEW_FUNC[12/17]: 0x55ec8a29cd70 in void tinyformat::detail::FormatArg::formatImpl<long>(std::ostream&, char const*, char const*, int, void const*) src/./tinyformat.h:530
          NEW_FUNC[13/17]: 0x55ec8a29cf50 in void tinyformat::formatValue<long>(std::ostream&, char const*, char const*, int, long const&) src/./tinyformat.h:317
          NEW_FUNC[14/17]: 0x55ec8a2ea450 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<long>(char const*, long const&) src/./tinyformat.h:976
          NEW_FUNC[15/17]: 0x55ec8a346ac0 in void tinyformat::format<long>(std::ostream&, char const*, long const&) src/./tinyformat.h:968
          NEW_FUNC[16/17]: 0x55ec8a346d80 in tinyformat::detail::FormatListN<1>::FormatListN<long>(long const&) src/./tinyformat.h:885
          NEW_FUNC[0/16]: 0x55ec8a210c90 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:976
          NEW_FUNC[2/16]: 0x55ec8a25c3e0 in void tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::ostream&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:968
          NEW_FUNC[3/16]: 0x55ec8a25c6a0 in tinyformat::detail::FormatListN<1>::FormatListN<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:885
          NEW_FUNC[4/16]: 0x55ec8a25c980 in void tinyformat::detail::FormatArg::formatImpl<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::ostream&, char const*, char const*, int, void const*) src/./tinyformat.h:530
          NEW_FUNC[6/16]: 0x55ec8b29cc60 in (anonymous namespace)::ParseScript(Span<char const>&, (anonymous namespace)::ParseScriptContext, FlatSigningProvider&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) src/script/descriptor.cpp:810
          NEW_FUNC[8/16]: 0x55ec8b2a4710 in (anonymous namespace)::Expr(Span<char const>&) src/script/descriptor.cpp:657
          NEW_FUNC[9/16]: 0x55ec8b2a4d40 in (anonymous namespace)::Func(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Span<char const>&) src/script/descriptor.cpp:647
          NEW_FUNC[15/16]: 0x55ec8b2d7dd0 in Span<char const>::subspan(long) const src/./span.h:33
          NEW_FUNC[0/1]: 0x55ec8b2d7830 in Span<char const>::operator[](long) const src/./span.h:31
          NEW_FUNC[0/10]: 0x55ec8a2ea090 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<char const*>(char const*, char const* const&) src/./tinyformat.h:976
          NEW_FUNC[1/10]: 0x55ec8a345d40 in void tinyformat::format<char const*>(std::ostream&, char const*, char const* const&) src/./tinyformat.h:968
          NEW_FUNC[2/10]: 0x55ec8a346000 in tinyformat::detail::FormatListN<1>::FormatListN<char const*>(char const* const&) src/./tinyformat.h:885
          NEW_FUNC[3/10]: 0x55ec8a3462e0 in void tinyformat::detail::FormatArg::formatImpl<char const*>(std::ostream&, char const*, char const*, int, void const*) src/./tinyformat.h:530
          NEW_FUNC[4/10]: 0x55ec8a3464b0 in void tinyformat::formatValue<char const*>(std::ostream&, char const*, char const*, int, char const* const&) src/./tinyformat.h:317
          NEW_FUNC[8/10]: 0x55ec8b438ef0 in ParsePrechecks(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/util/strencodings.cpp:267
          NEW_FUNC[9/10]: 0x55ec8b4398b0 in ParseUInt32(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int*) src/util/strencodings.cpp:309
          NEW_FUNC[0/3]: 0x55ec8a2e9430 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:976
          NEW_FUNC[1/3]: 0x55ec8a33a6f0 in void tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::ostream&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:968
          NEW_FUNC[2/3]: 0x55ec8a33aa40 in tinyformat::detail::FormatListN<2>::FormatListN<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:885
          NEW_FUNC[1/2]: 0x55ec8b4331b0 in IsHex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/util/strencodings.cpp:61
          NEW_FUNC[13/24]: 0x55ec8b126eb0 in Params() src/chainparams.cpp:384
          NEW_FUNC[14/24]: 0x55ec8b19a500 in DecodeDestination(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/key_io.cpp:217
          NEW_FUNC[15/24]: 0x55ec8b19a610 in (anonymous namespace)::DecodeDestination(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CChainParams const&) src/key_io.cpp:74
          NEW_FUNC[18/24]: 0x55ec8b357160 in IsValidDestination(boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown> const&) src/script/standard.cpp:325
          NEW_FUNC[19/24]: 0x55ec8b36fe40 in DecodeBase58(char const*, std::vector<unsigned char, std::allocator<unsigned char> >&) src/base58.cpp:36
  stat::number_of_executed_units: 54900
  stat::average_exec_per_sec:     4990
  stat::new_units_added:          421
  stat::slowest_unit_time_sec:    0
  stat::peak_rss_mb:              412
  Number of unique code paths taken during fuzzing round: 93

  Tested fuzz harnesses seem to work as expected.
  ```

Top commit has no ACKs.

Tree-SHA512: f18d0a6798c55d2c85ef9e604af2c1d626da2b81c01ea3f77c5cecd4ce35b197030778b3cfebab4869dab84a022325dba94fd83290026bfbc59814938e1daa02
2019-10-23 12:42:48 -04:00
MarcoFalke
8f14d2002b
Merge #17183: refactor: test/bench: dedup Build{Crediting,Spending}Transaction()
a0fc076476 refactor: test/bench: dedup Build{Crediting,Spending}Transaction() (Sebastian Falbesoner)

Pull request description:

  prototypes used in `src/test/script_tests.cpp`:
  - `CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);`
  - `CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);`

  prototypes used in `bench/verify_script.cpp`:
  - `CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey);`
  - `CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit);`

  The more generic versions from the script tests are moved into `setup_common.cpp` and the calls are adapted accordingly in the verify_script benchmark (passing the nValue of 1 explicitely for `BuildCreditingTransaction()`, passing empty scriptWitness explicitely and converting txCredit parameter to CTransaction in `BuildSpendingTransaction()`).

Top commit has no ACKs.

Tree-SHA512: 8444f8a18f15070eeec1e5dfd255b55a851dfc2e6647c12b1995a6f7abd7196e830db2181d0e860bcd4cf4c815967584a3756dd450346bca70649dd1d4493e04
2019-10-23 09:24:07 -04:00
practicalswift
b5ffa9f3db tests: Add Parse(...) (descriptor) fuzzing harness 2019-10-23 11:10:10 +00:00
practicalswift
fdef8bbf2f tests: Allow for using non-default fuzzing initialization 2019-10-23 11:10:10 +00:00
João Barbosa
0fc81a1e87 gui: Fix payAmount tooltip in SendCoinsEntry 2019-10-23 11:38:30 +01:00