Commit Graph

22090 Commits

Author SHA1 Message Date
MarcoFalke
fa2ec9f451
fuzz: Bump timeout in test_runner to accomodate for slow arm64 CPUs 2019-11-14 13:50:20 -05:00
MarcoFalke
fa6e01b2f3
ci: Use clang-8 for fuzzing to run on aarch64 ci systems 2019-11-13 17:53:04 -05:00
MarcoFalke
8237889e8d
Merge #17435: test: check custom ancestor limit in mempool_packages.py
49997813a4 test: check custom ancestor limit in mempool_packages.py (Sebastian Falbesoner)

Pull request description:

  The functional test `mempool_packages.py` starts one node with default ancestor/descendant limit settings and one with a custom, reduced ancestor limit (currently `-limitancestorcount=5`). The effect of the latter had not been tested yet though. This is approached in this PR by checking on the expected mempool contents of node1 after the node0 ancestor tests are done, via the following three conditions:
  - the # of txs in the node1 mempool is equal to the the limit
  - all txs in node1 mempool are a subset of txs in node0 mempool
  - the node1 mempool txs match the start of the constructed tx-chain

  Note that this still doesn't *fully* check the expected mempool of node1 (e.g. that it isn't influenced by `prioritisetransaction` RPC on node0), hence I add another TODO. In the future it would make sense to also set a custom descendant limit when the second TODO about checking node1's mempool is approached: 89e93135ae/test/functional/mempool_packages.py (L228)

ACKs for top commit:
  MarcoFalke:
    ACK 49997813a4 👲

Tree-SHA512: d3a1d19fb49731238ad08ee7c02e2fa81a227e3b4ef3340d68598de42ddb62be9161134f6b8e08fa76b8c9faa02fecfa01111159642e20e9f358292a757b7608
2019-11-12 14:53:34 -05:00
MarcoFalke
1028882eea
Merge #17437: rpc: Expose block height of wallet transactions
a5e77959c8 rpc: Expose block height of wallet transactions (João Barbosa)

Pull request description:

  Closes #17296.

ACKs for top commit:
  practicalswift:
    ACK a5e77959c8 -- diff looks correct now (good catch @theStack!)
  theStack:
    ACK a5e77959c8
  ryanofsky:
    Code review ACK a5e77959c8. Changes since last review getblockhash python test fixes, and removing the last hardcoded height

Tree-SHA512: 57dcd0e4e7083f34016bf9cf8ef578fbfde49e882b6cd8623dd1c64716e096e62f6177a4c2ed94f5de304e751fe23fb9d11cf107a86fbf0a3c5f539cd2844916
2019-11-12 14:44:13 -05:00
MarcoFalke
6d4b97cb1c
Merge #17450: util: Add missing headers to util/fees.cpp
b131524137 util: Add missing headers to util/fees.cpp (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  laanwj:
    code review ACK b131524137
  MarcoFalke:
    ACK b131524
  jnewbery:
    ACK b131524137

Tree-SHA512: a1ad36bff12219912c6aaacd7d9dcbeccf0fa3373280fa6e804d7a4d267b485433d6e1c01134cfa6732d2fb30ec1ab4629dff6e4bea2fe4c1976180064a3c6ca
2019-11-12 09:53:04 -05:00
Hennadii Stepanov
b131524137
util: Add missing headers to util/fees.cpp 2019-11-12 09:30:52 +02:00
João Barbosa
a5e77959c8 rpc: Expose block height of wallet transactions 2019-11-11 22:32:44 +00:00
Sebastian Falbesoner
49997813a4 test: check custom ancestor limit in mempool_packages.py
To test the custom ancestor limit on node1 (passed by the argument
-limitancestorcount), we check for three conditions:
    -> the # of txs in the node1 mempool is equal to the the limit
    -> all txs in node1 mempool are a subset of txs in node0 mempool
    -> the node1 mempool txs match the start of the constructed tx-chain
2019-11-11 22:37:00 +01:00
MarcoFalke
80fdb6fad1
Merge #17442: fix Typo: "merkelRoot" -> "merkleRoot"
eb880f092b fix Typo: "merkelRoot" -> "merkleRoot" (ianliu)

Pull request description:

  <!--
  *** Please remove the following help text before submitting: ***

  Pull requests without a rationale and clear improvement may be closed
  immediately.
  -->

  <!--
  Please provide clear motivation for your patch and explain how it improves
  Bitcoin Core user experience or Bitcoin Core developer experience
  significantly:

  * Any test improvements or new tests that improve coverage are always welcome.
  * All other changes should have accompanying unit tests (see `src/test/`) or
    functional tests (see `test/`). Contributors should note which tests cover
    modified code. If no tests exist for a region of modified code, new tests
    should accompany the change.
  * Bug fixes are most welcome when they come with steps to reproduce or an
    explanation of the potential issue as well as reasoning for the way the bug
    was fixed.
  * Features are welcome, but might be rejected due to design or scope issues.
    If a feature is based on a lot of dependencies, contributors should first
    consider building the system outside of Bitcoin Core, if possible.
  * Refactoring changes are only accepted if they are required for a feature or
    bug fix or otherwise improve developer experience significantly. For example,
    most "code style" refactoring changes require a thorough explanation why they
    are useful, what downsides they have and why they *significantly* improve
    developer experience or avoid serious programming bugs. Note that code style
    is often a subjective matter. Unless they are explicitly mentioned to be
    preferred in the [developer notes](/doc/developer-notes.md), stylistic code
    changes are usually rejected.
  -->

  <!--
  Bitcoin Core has a thorough review process and even the most trivial change
  needs to pass a lot of eyes and requires non-zero or even substantial time
  effort to review. There is a huge lack of active reviewers on the project, so
  patches often sit for a long time.
  -->

ACKs for top commit:
  practicalswift:
    ACK eb880f092b but please change from `merkleRootofHashes` to `merkleRootOfHashes`

Tree-SHA512: ada9edceee19da5678bf35e1258163e7102fe176dc5cf40acaa1468fa8b2801494f8bf65d5359dcd0054fbc22f07fdc98d6208cfdb54dd9171fd45c89d71e098
2019-11-11 13:20:27 -05:00
ianliu
eb880f092b fix Typo: "merkelRoot" -> "merkleRoot" 2019-11-12 00:56:05 +08:00
MarcoFalke
a6f6333ba2
Merge #17416: Appveyor improvement - text file for vcpkg package list
29eb039252 Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)

Pull request description:

  #17364 attempted to save a couple of minutes by skipping the `vcpkg` steps if the vcpkg install directory was already cached.

  The discussion in #15382 highlights the approach used in #17364 does not accommodate adding a new package.

  ~~This PR improves the approach to individually check whether  each vcpg package is installed rather than checking for the existence of the vcpkg install directory.~~

  This PR moves the list of required vcpkg packages into a separate file and uses changes to that file to invalidate the appveyor cache. Whenever the cache is invalidated the vcpkg sources will be updated, the vcpkg binary built and the required packages installed from the latest port files.

ACKs for top commit:
  MarcoFalke:
    ACK 29eb039252

Tree-SHA512: 0c2a170f4e4b47ca0f9cef14f1e3892001b441a6d84f50bf5fd8a26bc4cdbd9358dfce7ef180d37150262e849650e9857d6b2bcd686964b963c3de6cd708a2f3
2019-11-10 21:42:10 -05:00
Aaron Clauson
29eb039252
Moves vcpkg list to a text file and updates the appveyor job and readme to use it. 2019-11-10 13:49:28 +00:00
Wladimir J. van der Laan
89e93135ae
Merge #17427: qt: Fix missing qRegisterMetaType for size_t
1828c6f05f refactor: Styling w/ clang-format, comment update (Hennadii Stepanov)
88a94f7bb8 qt: Fix missing qRegisterMetaType for size_t (Hennadii Stepanov)

Pull request description:

  On master (a7aec7ad97) this connection a7aec7ad97/src/qt/rpcconsole.cpp (L587) fails due to `ClientModel::mempoolSizeChanged()` signal has unregistered parameter type `size_t`: a7aec7ad97/src/qt/clientmodel.h (L102)

  More:
  ```
  $ QT_FATAL_WARNINGS=1 lldb src/qt/bitcoin-qt -- -debug=qt
  ...
  (lldb) bt
  * thread #17, name = 'QThread', stop reason = signal SIGABRT
    * frame #0: 0x00007ffff35fce97 libc.so.6`__GI_raise(sig=2) at raise.c:51
      frame #1: 0x00007ffff35fe801 libc.so.6`__GI_abort at abort.c:79
      frame #2: 0x00007ffff5901352 libQt5Core.so.5`QMessageLogger::warning(char const*, ...) const + 354
      frame #3: 0x00007ffff5b216fe libQt5Core.so.5`___lldb_unnamed_symbol2329$$libQt5Core.so.5 + 334
      frame #4: 0x00007ffff5b2456d libQt5Core.so.5`QMetaObject::activate(QObject*, int, int, void**) + 1933
      frame #5: 0x000055555566872e bitcoin-qt`ClientModel::mempoolSizeChanged(this=<unavailable>, _t1=<unavailable>, _t2=<unavailable>) at moc_clientmodel.cpp:260
  ...

  ```

  `debug.log`:
  ```
  [] GUI: QObject::connect: Cannot queue arguments of type 'size_t'
  (Make sure 'size_t' is registered using qRegisterMetaType().)
  ```

  This PR fixes it.

  Refs:
  - [Qt docs: qRegisterMetaType](https://doc.qt.io/qt-5/qmetatype.html#qRegisterMetaType)
  - #16348

  ---

  Side NOTE: Also I believe this line a7aec7ad97/src/qt/bitcoin.cpp (L63) is redundant since long `CAmount` is a `typedef`.

ACKs for top commit:
  laanwj:
    Tested ACK 1828c6f05f

Tree-SHA512: 2c7f9fe6a5ae70f2e1dd86b07f95d4b00c85c5706a9d722f063f80beb71880d012ec46556963fb1544c2af53d006936c2f7612eae60d9193f67db62ba3d86129
2019-11-10 11:38:53 +01:00
Wladimir J. van der Laan
ecc1a4ecd0
Merge #17431: Remove unnecessary forward declaration
3d133482b2 Remove unnecessary forward declaration (Mark Erhardt)

Pull request description:

  This removes an unnecessary forward declaration.

ACKs for top commit:
  jnewbery:
    Tested ACK 3d133482b2
  laanwj:
    ACK 3d133482b2

Tree-SHA512: 9e5b14e861c2b9fa2d7707ed67c4667540e9812a762e00f5039691eeca82390eb7462d20ad781d4e8c9111517e989da7aef60b112ab33abb774e32d9845b5459
2019-11-10 11:18:10 +01:00
Hennadii Stepanov
1828c6f05f
refactor: Styling w/ clang-format, comment update 2019-11-10 12:11:07 +02:00
Hennadii Stepanov
88a94f7bb8
qt: Fix missing qRegisterMetaType for size_t
It is required in order to use size_t in QueuedConnections.
2019-11-10 12:03:53 +02:00
Wladimir J. van der Laan
cef7df37ce
Merge #17410: Rename db log category to walletdb (like coindb)
e2c03c1156 doc: Add relase note for db→walletdb rename (Wladimir J. van der Laan)
4c1d263d93 scripted-diff: Change `BCLog::DB` to `BCLog::WALLETDB` (Wladimir J. van der Laan)
6b42b3ba90 Rename `db` log category to `walletdb` (like `coindb`) (Wladimir J. van der Laan)

Pull request description:

  Rename the `db` log category to `walletdb` (in the style of, and to distinguish from `coindb`). Deprecate (but still accept) '-debug=db'.

  Second commit is a scripted commit that changes the enum item name.

ACKs for top commit:
  hebasto:
    ACK e2c03c1156, tested on Linux Mint 19.2:

Tree-SHA512: a044de6f9a70e735cbb1caa4ed6bf75bc2269b2d5bc3241a25b6a6d69c1fc1d83456e252b431388ae61f4821e4fc06ecc1b634816ceadbe9a3c0e494bee6c11e
2019-11-10 10:50:58 +01:00
Mark Erhardt
3d133482b2
Remove unnecessary forward declaration 2019-11-09 22:08:29 -08:00
Wladimir J. van der Laan
a7aec7ad97
Merge #15934: Merge settings one place instead of five places
083c954b02 Add settings_tests (Russell Yanofsky)
7f40528cd5 Deduplicate settings merge code (Russell Yanofsky)
9dcb952fe5 Add util::Settings struct and helper functions. (Russell Yanofsky)
e2e37cfe8a Remove includeconf nested scope (Russell Yanofsky)
5a84aa880f Rename includeconf variables for clarity (Russell Yanofsky)
dc8e1e7548 Clarify emptyIncludeConf logic (Russell Yanofsky)

Pull request description:

  This is a refactoring-only change that makes it easier to add a new settings source.

  This PR doesn't change behavior. The [`util_ArgsMerge`](deb2327b43/src/test/util_tests.cpp (L626-L822)) and [`util_ChainMerge`](deb2327b43/src/test/util_tests.cpp (L843-L924)) tests added in #15869 and #15988 were written specifically to confirm that ArgsManager settings are parsed, merged, and returned the same way before and after this change.

  This change:

  - Makes it easier to add new settings sources that can get merged with existing sources (see 70675c3e4975203ad6222ba2b00c83b4e4213793 from #15935).
  - Separates parsing of settings from merging of settings, and deduplicates merging code so it doesn't happen five different places ([GetArg](c459c5f701/src/util/system.cpp (L221-L244)), [GetNetBoolArg](c459c5f701/src/util/system.cpp (L255-L261)), [GetArgs](c459c5f701/src/util/system.cpp (L460-L467)), [IsArgNegated](c459c5f701/src/util/system.cpp (L482-L491)), [GetUnsuitableSectionOnlyArgs](c459c5f701/src/util/system.cpp (L343-L352))) in inconsistent ways.
  - Documents and tests current strange merging behaviors, so they be cleaned up in the future if resulting code simplifications and UX improvements warrant loss of backwards compatibility. The newly documented behaviors are: command line [ignored arguments](69d44f3cc7/src/util/system.cpp (L323-L326)) and [more ignored arguments](69d44f3cc7/src/util/settings.cpp (L67-L72)), and config file [reverse precedence](69d44f3cc7/src/util/settings.cpp (L61-L65)), [inconsistently applied top-level settings](69d44f3cc7/src/util/settings.cpp (L55-L59)), and [zombie values](69d44f3cc7/src/util/settings.cpp (L101-L108)).

  The original motivation for this change was to make it easy to add a new persistent setting source without introducing more bugs and inconsistencies. Two commits building on top of this to add a persistent `-wallet` setting are pretty straightforward and show how the new code can be extended:

  * 70675c3e4975203ad6222ba2b00c83b4e4213793 from #15935 – _Add \<datadir>/settings.json persistent settings storage_
  * 04c80c40df9fc6f4734ba238ea7f65607cf88089 from #15937 – _Add loadwallet and createwallet RPC load_on_startup options_

ACKs for top commit:
  ariard:
    ACK 083c954
  jnewbery:
    ACK 083c954b02
  jamesob:
    ACK 083c954b02

Tree-SHA512: 5d106746a44d64d3963c4ef3f4a2fa668a4bedcc9018d3ea12c86beae2fda48a0b036241665837f68685712366f70f2e1faba84d193fa1f456013503097b7659
2019-11-08 23:23:08 +01:00
Wladimir J. van der Laan
adceca2ba5
Merge #17422: doc: add historical 0.19.0 release notes
fec230edcc doc: add historical 0.19.0 release notes (fanquake)

Pull request description:

ACKs for top commit:
  laanwj:
    ACK fec230edcc

Tree-SHA512: c0c83cd357e58acb7969b02a607fb6b40536f1c1072c25f58b0c6b6b9f50372f33403db51e846456b0f3f1cb3782a0b5c60604cb81e11a2cb99af664249c9069
2019-11-08 23:20:56 +01:00
Wladimir J. van der Laan
e2c03c1156 doc: Add relase note for db→walletdb rename 2019-11-08 23:05:47 +01:00
fanquake
fec230edcc
doc: add historical 0.19.0 release notes 2019-11-08 16:20:37 -05:00
Wladimir J. van der Laan
9e0aabe50c
Merge #17367: ci: Run non-cross-compile builds natively
faf757a125 ci: Guess the native host when not cross compiling (MarcoFalke)
fa8a60bce9 ci: Run non-cross-compile builds natively (MarcoFalke)
fa56bcbb01 ci: Run CI_WAIT only on travis (MarcoFalke)

Pull request description:

  non-cross-compile ci builds should not hardcode an architecture, so they can be run on any ci system

ACKs for top commit:
  laanwj:
    re-ACK faf757a125

Tree-SHA512: 97f86ad411e98c6317a62f829bee26c16dbe3fa54d8ac013018f7669b653d7d6d750740b2ecfb7175195d5fffc701ce503b0d11802b97af30904b51bb23f2073
2019-11-08 22:09:31 +01:00
Wladimir J. van der Laan
4c1d263d93 scripted-diff: Change BCLog::DB to BCLog::WALLETDB
-BEGIN VERIFY SCRIPT-
git grep -l "BCLog::DB" src | xargs sed -i "s/BCLog::DB/BCLog::WALLETDB/g"
sed -i "s/DB          =/WALLETDB    =/g" src/logging.h
-END VERIFY SCRIPT-
2019-11-08 18:45:38 +01:00
Wladimir J. van der Laan
6b42b3ba90 Rename db log category to walletdb (like coindb)
Deprecate (but still accept) '-debug=db'.
2019-11-08 18:28:26 +01:00
fanquake
8021392b82
Merge #17405: wallet: Remove unused boost::this_thread::interruption_point
fad1de66a2 wallet: Remove unused boost::this_thread::interruption_point (MarcoFalke)

Pull request description:

  `BerkeleyEnvironment::Open` is only called from the main thread (init) or an http rpc thread, neither of which can be interrupted, so remove the useless interruption point.

  `BerkeleyEnvironment{}` is only used in tests, which run in a single process/thread, so remove the useless interruption point.

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

Tree-SHA512: dacd8398e966e4a6ce5cf7d3ed821c9c267eff40b14c0635085441647cdb72d1642807f89355419f1710f814c7963e35a10d102d0b985c7198261dfc736256f8
2019-11-08 09:01:09 -05:00
fanquake
4a3b6f47cd
Merge #17354: wallet: Tidy CWallet::SetUsedDestinationState
0b75a7f068 wallet: Reuse existing batch in CWallet::SetUsedDestinationState (João Barbosa)
01f45dd00e wallet: Avoid recursive lock in CWallet::SetUsedDestinationState (João Barbosa)

Pull request description:

  This PR makes 2 distinct changes around `CWallet::SetUsedDestinationState`:
   - 1st the recursive lock is removed and now it requires the lock to be held;
   - 2nd change is to support, in the best case, just a wallet database flush when transaction is added to the wallet.

ACKs for top commit:
  achow101:
    ACK 0b75a7f068
  MarcoFalke:
    ACK 0b75a7f068
  ryanofsky:
    Code review ACK 0b75a7f068. Code changes looks fine but PR description should be updated to say what benefits of the change are. I might have missed something, but I didn't see a place where multiple batches were used previously and a single batch was used now. So the main benefit of this change appears to be removing a recursive lock? And maybe moving toward a consistent convention for passing batch instances?

Tree-SHA512: abcf23a5850d29990668db20d6f624cca3e89629cc9ed003e0d05cde1b58ab2ff365034f156684ad13e55764b54c6c0c2bc7d5f96b8af7dc5e45a3be955d6b15
2019-11-08 08:44:49 -05:00
Samuel Dobson
99ab3a72c5
Merge #15931: Remove GetDepthInMainChain dependency on locked chain interface
36b68de5b2 Remove getBlockDepth method from Chain::interface (Antoine Riard)
b66c429c56 Remove locked_chain from GetDepthInMainChain and its callers (Antoine Riard)
0ff03871ad Use CWallet::m_last_block_processed_height in GetDepthInMainChain (Antoine Riard)
f77b1de16f Only return early from BlockUntilSyncedToCurrentChain if current tip is exact match (Antoine Riard)
769ff05e48 Refactor some importprunedfunds checks with guard clause (Antoine Riard)
5971d3848e Add block_height field in struct Confirmation (Antoine Riard)
9700fcb47f Replace CWalletTx::SetConf by Confirmation initialization list (Antoine Riard)
5aacc3eff1 Add m_last_block_processed_height field in CWallet (Antoine Riard)
10b4729e33 Pass block height in Chain::BlockConnected/Chain::BlockDisconnected (Antoine Riard)

Pull request description:

  Work starter to remove Chain::Lock interface by adding m_last_block_processed_height in CWallet and m_block_height in CMerkleTx to avoid GetDepthInMainChain having to keep a lock . Once this one done, it should ease work to wipe out more cs_main locks from wallet code.

  I think it's ready for a first round of review before to get further.

  - `BlockUntilSyncedToCurrent` : restrain isPotentialTip to isTip because we want to be sure that wallet see BlockDisconnected callbacks if its height differs from the Chain one. It means during a reorg, an RPC could return before the BlockDisconnected callback had been triggered. This could cause a tx that had been included in the disconnected block to be displayed as confirmed, for example.

  ~~- `AbandonTransaction` : in case of conflicted tx (nIndex = -1), we set its m_block_height to the one of conflicting blocks, but if this height is superior to CWallet::m_last_block_processed_height, that means tx isn't conflicted anymore so we return 0 as tx is again unconfirmed~~ After #16624, we instead rely on Confirmation.

  ~~- `AddToWalletIfInvolvingMe`: in case of block disconnected, transactions are added to mempool again, so we need to replace old txn in `mapWallet` with a height set to zero so we remove check on block_hash.IsNull~~ Already done in #16624

ACKs for top commit:
  jnewbery:
    @jkczyz you've ACKed an intermediate commit (github annoyingly orders commits in date order, not commit order). Did you mean to ACK the final commit in this branch (36b68de5b2).
  jkczyz:
    > @jkczyz you've ACKed an intermediate commit (github annoyingly orders commits in date order, not commit order). Did you mean to ACK the final commit in this branch ([36b68de](36b68de5b2)).
  meshcollider:
    utACK 36b68de5b2
  ryanofsky:
    Code review ACK 36b68de5b2. Changes since last review: new jkczyz refactor importprunedfunds commit, changed BlockUntilSyncedToCurrentChainChanges commit title and description, changed Confirmation struct field order and line-wrapped comment
  jnewbery:
    utACK 36b68de5b2
  promag:
    Code review ACK 36b68de5b2.

Tree-SHA512: 08b89a0bcc39f67c82a6cb6aee195e6a11697770c788ba737b90986b4893f44e90d1ab9ef87239ea3766508b7e24ea882b7199df41173ab27a3d000328c14644
2019-11-08 23:23:14 +13:00
Russell Yanofsky
083c954b02 Add settings_tests
Co-authored-by: James O'Beirne <james.obeirne@gmail.com>
2019-11-07 23:08:22 -04:00
Russell Yanofsky
7f40528cd5 Deduplicate settings merge code
Get rid of settings merging code in util/system.cpp repeated 5 places,
inconsistently:

- ArgsManagerHelper::GetArg
- ArgsManagerHelper::GetNetBoolArg
- ArgsManager::GetArgs
- ArgsManager::IsArgNegated
- ArgsManager::GetUnsuitableSectionOnlyArgs

Having settings merging code separated from parsing simplifies parsing somewhat
(for example negated values can simply be represented as false values instead
of partially cleared or emply placeholder lists).

Having settings merge happen one place instead of 5 makes it easier to add new
settings sources and harder to introduce new inconsistencies in the way
settings are merged.

This commit does not change behavior in any way.
2019-11-07 23:08:22 -04:00
Russell Yanofsky
9dcb952fe5 Add util::Settings struct and helper functions.
Implement merging of settings from different sources (command line and config
file) separately from parsing code in system.cpp, so it is easier to add new
sources.

Document current inconsistent merging behavior without changing it.

This commit only adds new settings code without using it. The next commit calls
the new code to replace existing code in system.cpp.

Co-authored-by: John Newbery <john@johnnewbery.com>
2019-11-07 22:08:22 -05:00
Russell Yanofsky
e2e37cfe8a Remove includeconf nested scope
Easier to review ignoring whitespace

Suggestion from John Newbery <john@johnnewbery.com> in
https://github.com/bitcoin/bitcoin/pull/15934#discussion_r343806860
2019-11-07 22:08:22 -05:00
Russell Yanofsky
5a84aa880f Rename includeconf variables for clarity
includeconf -> conf_file_names
to_include -> conf_file_name
include_config -> conf_file_stream

Suggestion from John Newbery <john@johnnewbery.com> in
https://github.com/bitcoin/bitcoin/pull/15934#discussion_r343905138
2019-11-07 22:04:42 -05:00
Russell Yanofsky
dc8e1e7548 Clarify emptyIncludeConf logic
Suggestion from John Newbery <john@johnnewbery.com> in
https://github.com/bitcoin/bitcoin/pull/15934#discussion_r343795528
2019-11-07 22:01:22 -05:00
MarcoFalke
fad1de66a2
wallet: Remove unused boost::this_thread::interruption_point 2019-11-07 16:01:34 -05:00
fanquake
2fb6140d58
Merge #17404: Remove redundant class file include from test_bitcoin msvc project
b80f7db832 Remove redundant class file includes from test_bitcoin project. (Aaron Clauson)

Pull request description:

  #17364 & #17384 overlapped and both added the same line of `..\..\src\test\util\*.cpp` to `test_bitcoin.vcxproj`. This didn't break the build but does result in duplicate symbol warnings. This PR cleans it up and removes the additional redundant line of `..\..\src\test\util\setup_common.cpp` which will also be covered by the wildcard include.

ACKs for top commit:
  MarcoFalke:
    ACK b80f7db832 🔅
  fanquake:
    ACK b80f7db832 - tested a build on a Windows machine. No longer see the warnings shown below:

Tree-SHA512: 55960821480483c517b475f2a6871cd7d4033d086db3fd679aa0de362e4f7e2c3ac7967ca278cc3728cc765ba23d4441ec769d83d7a47e7a3fa2f09de2bbc145
2019-11-07 15:42:25 -05:00
Aaron Clauson
b80f7db832
Remove redundant class file includes from test_bitcoin project. 2019-11-07 20:03:23 +00:00
MarcoFalke
faf757a125
ci: Guess the native host when not cross compiling 2019-11-07 13:42:57 -05:00
fanquake
270616228b
Merge #17362: test: speed up wallet_avoidreuse, add logging
0e7c90eb37 test: speed up wallet_avoidreuse.py (Jon Atack)
6d50b2606e test: add logging to wallet_avoidreuse.py (Jon Atack)

Pull request description:

  Inspired by PRs #17340 and #15881.

  - add logging
  - pass -whitelist in `set_test_params` to speed up transaction relay

  `wallet_avoidreuse.py` is not intended to test P2P transaction relay/timing, so it should be fine to do this here. This reduces test run time variability and speeds up the test by 2-3 times on average.

  Test run times in seconds:

  - before: 20, 24, 22, 17, 27, 40, 30

  - after: 10, 10, 8, 9, 10, 7, 8

ACKs for top commit:
  MarcoFalke:
    ACK 0e7c90eb37 🐊
  fanquake:
    ACK 0e7c90eb37

Tree-SHA512: 6d954a0aaf402c9594201626b59d29263479059e68fa5155bb44ed973cd0c3347729dd78b78b4d5a2275e45da365dc1afb4cc7e3293dea33fcc2e3e83a39faf5
2019-11-07 11:59:51 -05:00
MarcoFalke
772673dfbe
Merge #16978: test: Seed test RNG context for each test case, print seed
fae43a97ca test: Seed test RNG context for each test case, print seed (MarcoFalke)

Pull request description:

  Debugging failing unit tests is hard if the failure is non-deterministic and the seed is not known.

  Fix that by printing the seed and making it possible to set the seed from outside.

ACKs for top commit:
  davereikher:
    Tested ACK fae43a97ca

Tree-SHA512: 33d848dd1f4180d3664ecf60e9810c2a93590c05276b2c46b1e4fe6e376b45916a46b90c803bb602750ab666da3a05ce499e550024685a90b8cc38fab6667cb8
2019-11-07 10:18:40 -05:00
MarcoFalke
7d14e35f3f
Merge #17342: refactor: Clean up nScriptCheckThreads
5506ecfe7a [refactor] Replace global int nScriptCheckThreads with bool (John Newbery)
d9957623b4 [tests] Don't use TestingSetup in the checkqueue_tests (John Newbery)

Pull request description:

  The meaning of this value is confusing. Refactor it and add comments.

ACKs for top commit:
  sipa:
    ACK 5506ecfe7a
  promag:
    ACK 5506ecfe7a, only change was addressing my nits.
  laanwj:
    Code review ACK 5506ecfe7a
  MarcoFalke:
    ACK 5506ecfe7a 🥐

Tree-SHA512: 78536727c98d2c23f3c0f3f169131474fef9a4486ae65029011caf06eab30f6f70ff73a65b2fb04a5d969fc1150858d1c6ea4767f04d48c1eea6b829316d0e63
2019-11-07 10:07:11 -05:00
MarcoFalke
46e0e27639
Merge #17364: Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
3c84deebaa Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per #17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)

Pull request description:

  Updates to appveyor config:
   - Update build image from Visual Studio 2017 to Visual Studio 2019.
   - Updated Qt static library from Qt5.9.7 to Qt5.9.8.
   - Added commands to update vcpkg port files (this does not update already installed packages).
   - Updated vcpkg package list as per #17309.
   - Removed commands setting common project file options. Now done via common.init.vcxproj include.
   - Changed msbuild verbosity from normal to quiet. Normal writes a LOT of logs and impacts appveyor job duration.

  Updates to msvc project configs:
   - Updated platform toolset from v141 to v142.
   - Updated Qt static library from Qt5.9.7 to Qt5.9.8.
   - Added ignore for linker warning building bitcoin-qt program.
   - Added missing util/str.cpp class file to test_bitcoin project file.

  In order for an existing appveyor job based on the new config to work the cache must be purged. The steps to do this are shown below. The specific appveyor project path will need to be adjusted.

  ````
  export APPVEYOR_TOKEN="<your-api-token>"
  curl -H "Authorization: Bearer $APPVEYOR_TOKEN" -X DELETE https://ci.appveyor.com/api/projects/bitcoin/bitcoin-9ql6k/buildcache
  ````

ACKs for top commit:
  ryanofsky:
    Non-expert code review ACK 3c84deebaa.

Tree-SHA512: 77063d4588c3499de78b0bcc4d8b638f36c70284485ae94ce5c718a3dacb6d28cc34f9443c54c4e98c07b446d26b59589259671c2f6bcc952344042b4a3baf8f
2019-11-07 09:45:47 -05:00
MarcoFalke
46fc4d1a24
Merge #17384: test: Create new test library
fa4c6fa9b1 doc: Add documentation for new test/lib (MarcoFalke)
faec28252c scripted-diff: test: Move setup_common to test library (MarcoFalke)

Pull request description:

  Sorry for clickbait, this is only a move-only scripted-diff commit and one documentation commit.

  Longer term, someone who knows something about build systems can make this an actual library. Motivation for this is that each module gets compiled for each target that includes it. For example, setup_common is compiled 27 times (for the fuzz suite) and another 3 times for the other tests (bench, unit test, gui)

ACKs for top commit:
  practicalswift:
    ACK fa4c6fa9b1 -- diff looks correct and Travis is happy
  jonatack:
    ACK fa4c6fa9b1 with the reserve that the commit messages (and PR description) contain the motivation for this change. Built, ran tests, light code review.
  ryanofsky:
    Code review ACK fa4c6fa9b1. I didn't realize `lib` was actually name of existing directory, not a new name. But in any case this looks good and nice to have one scripted diff instead of two.

Tree-SHA512: 2e176df90c60578276e4a6dc83ff57ff59d8e666ecf30c5ceacb8c326725da91baa4cac3dfa7a2e1605f58122a3e3e27e4938ff33e3a0ce7ea53afffebbf57a4
2019-11-07 08:02:25 -05:00
Jon Atack
0e7c90eb37
test: speed up wallet_avoidreuse.py
Use -whitelist to speed up transaction relay.

The wallet_avoidreuse.py test is not intended to test transaction relay/timing,
so it should be fine to do this here.

This greatly reduces test run time variability and speeds up the test by 2-3
times on average, e.g. on my system from 20-30 seconds down to 8-10 seconds.
2019-11-07 10:03:28 +01:00
Jon Atack
6d50b2606e
test: add logging to wallet_avoidreuse.py 2019-11-07 10:03:26 +01:00
Aaron Clauson
3c84deebaa
Updated appveyor config:
- Update build image from Visual Studio 2017 to Visual Studio 2019.
 - Updated Qt static library from Qt5.9.7 to Qt5.9.8.
 - Added commands to update vcpkg port files (this does not update already installed packages).
 - Updated vcpkg package list as per #17309.
 - Removed commands setting common project file options. Now done via common.init.vcxproj include.
 - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration.
Updated msvc project configs:
 - Updated platform toolset from v141 to v142.
 - Updated Qt static library from Qt5.9.7 to Qt5.9.8.
 - Added ignore for linker warning building bitcoin-qt program.
 - Added missing util/str.cpp class file to test_bitcoin project file.
2019-11-06 22:02:16 +00:00
MarcoFalke
e65b4160e9
Merge #17340: Tests: speed up fundrawtransaction test
af7bae7340 [tests] Don't stop-start unnecessarily in rpc_fundrawtransaction.py (John Newbery)
9a8505299b [tests] Use -whitelist in rpc_fundrawtransaction.py (John Newbery)
646b593bbd [tests] Speed up rpc_fundrawtransaction.py (John Newbery)

Pull request description:

  Speed up rpc_fundrawtransaction.py

  Most of the time in rpc_fundrawtransaction.py is spent waiting for
  unconfirmed transactions to propagate. Net processing adds a poisson
  random delay to the time it will INV transactions with a mean interval
  of 5 seconds. Calls like the following:

  ```
  self.nodes[2].sendrawtransaction(signedTx['hex'])
  self.sync_all()
  self.nodes[1].generate(1)
  ````

  will therefore introduce a delay waiting for the mempools to sync.
  Instead just generate the block on the node that sent the transaction:

  ```
  self.nodes[2].sendrawtransaction(signedTx['hex'])
  self.nodes[2].generate(1)
  ```

  rpc_fundrawtransaction.py is not intended to be a test for transaction
  relay, so it's ok to do this.

ACKs for top commit:
  MarcoFalke:
    ACK af7bae7340 🛴

Tree-SHA512: db3407d871bfdc99a02e7304b07239dd3585ac47f27f020f1a70608b7f6386b134343c01f3e4d1c246ce734676755897671999695068d6388602fb042d178780
2019-11-06 15:18:41 -05:00
John Newbery
5506ecfe7a [refactor] Replace global int nScriptCheckThreads with bool
The global nScriptCheckThreads int is confusing and is only needed for
its int-ness in AppInitMain. Move all `-par` parsing logic there and
replace the int nScriptCheckThreads with a bool
g_parallel_script_checks.

Also tidy up logic and improve comments.
2019-11-06 15:04:50 -05:00
John Newbery
d9957623b4 [tests] Don't use TestingSetup in the checkqueue_tests
It's only needed for a hardcoded int, which we can define locally.
2019-11-06 15:03:59 -05:00
John Newbery
af7bae7340 [tests] Don't stop-start unnecessarily in rpc_fundrawtransaction.py
This was only added in c1dde3a949 to match
behaviour when `encryptwallet` would restart the node. It's not required
for the test (and slows things down).
2019-11-06 14:56:35 -05:00