Commit Graph

1125 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
846473aed2 Merge #15219: lint: Enable python linters via an array
948d8f4f10c31220ba4b6779cc862e2b6a0af5f6 lint: Enable python linters via an array (Ben Woosley)

Pull request description:

  This assures consistent recording of the enabled linters.

  This applies the same fix as #15170 to lint-python.sh

Tree-SHA512: 6d03f919e86e7c2465475c88b25dd84391282bcc11728078024daf0432a7dccddf9e4a2cdae35d6ef374971cb4e12f0fa21b58f757e25f2fe7c12ceb4f4b2c57
2021-08-24 19:14:50 -04:00
UdjinM6
8f7bfe7ef0
Merge pull request #4345 from linuxsh2/qt5-syntax
backport v0.18 (13529) and Qt5 connect syntax for Dash specific code
2021-08-24 19:14:18 +03:00
Wladimir J. van der Laan
57e895a9c6 Merge #13529: Use new Qt5 connect syntax
3567b247f43decb6fc102d5b0989d1746fce0441 test: Add lint to prevent SIGNAL/SLOT connect style (João Barbosa)
f78558f1e39198779bdb17e2b0e256fb99ad4b28 qt: Use new Qt5 connect syntax (João Barbosa)

Pull request description:

  Pros&cons in https://wiki.qt.io/New_Signal_Slot_Syntax.

  Note that connecting to/from overloaded slot/signal is ugly before qt 5.7 (see https://stackoverflow.com/a/16795664).

Tree-SHA512: ab81f035099fecd34be546f7091bc29595349f2fd0fea26f6414242702955fca27faa4fe19ebfe105c01217908b51db762cb5a9f6ce25bc5e8e6f64c77428c22
2021-08-23 12:12:31 -04:00
MarcoFalke
5bda9afcf6
Partial merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block request
fa21568208 qa: Avoid race in p2p_invalid_block by waiting for the block request (MarcoFalke)
6c787d340c tests: Make feature_block pass on centos (MarcoFalke)

Pull request description:

  This hopefully fixes #14661, which I believe is caused by a race in `send_blocks_and_test`. By setting `request_block=False` we only effectively check `node.getbestblockhash() != blocks[-1].hash` before returning and checking the debug.log. By setting `request_block=True` (the default) we make sure that we send the block, then sync with a ping before asserting on the debug.log.

  Even if this patch doesn't fix the issue, it is good cleanup: There is no reason to not wait for the blocks to be requested, since in all these cases the header gives no indication that the block is consensus invalid. So this patch makes the test also a bit stricter and more useful.

  Unrelated to this, I also include a fix that makes the tests pass on latest CentOS.

Tree-SHA512: c7abee3b7dc790a8af6c289159a7751bd962f6fa16c1537e7e21a0a0ef05b9596d1f4eb75319614603c05cb803e021314fa3596508ba443edd03046b25527e0f
2021-08-22 21:35:12 -05:00
Wladimir J. van der Laan
701e16ba5b
Merge #14247: Fix crash bug with duplicate inputs within a transaction
9b4a36effcf642f3844c6696b757266686ece11a [qa] Test for duplicate inputs within a transaction (Suhas Daftuar)
b8f801964f59586508ea8da6cf3decd76bc0e571 Fix crash bug with duplicate inputs within a transaction (Suhas Daftuar)

Pull request description:

Tree-SHA512: 8c7ea34c7fa44188d86c04a690a7cbf8e9deda71ab1f7ca6d11de1f2abb3dd7222627071f86d0d39689a8b302ba9af142f0202466a67e30cd54aed3a08d4eb14
2021-08-22 21:35:11 -05:00
Wladimir J. van der Laan
42d1b0ba71
Merge #14494: Error if # is used in rpcpassword in conf
0385109444646561a718f34ae437b7e0e4d4d5bc Add test for rpcpassword hash error (MeshCollider)
13fe258e91e7a92326aedf151c571994166a06d4 Error if rpcpassword in conf contains a hash character (MeshCollider)

Pull request description:

  Fixes #13143 now #13482 was merged

Tree-SHA512: e7d00c8df1657f6b8d0eee1e06b9ce2b1b0a2de487377699382c1b057836e1571dac313ca878b5877c862f0461ba789a50b239d2a9f34accd8a6321f126e3d2a
2021-08-22 21:34:42 -05:00
MarcoFalke
a52460d709
Merge #14812: qa: fix p2p_invalid_messages on macOS
5a1f57646b qa: clean up assert_memory_usage_stable utility (James O'Beirne)
0cf1632f03 qa: fix p2p_invalid_messages on macOS (James O'Beirne)

Pull request description:

  Infinite mea culpa for the number of problems with this test.

  This change bumps the acceptable RSS increase threshold from 3% to 50% when spamming the test node with junk 4MB messages. On [@MarcoFalke's macOS test build](https://travis-ci.org/MarcoFalke/btc_nightly) we see RSS grow ~14% from ~71MB to 81MB, so a 50% increase threshold should be more than sufficient to avoid spurious failures.

Tree-SHA512: 150a7b88080fd883c7a5d0b9ffa470f61a97c4885fccc1a06fde6260aaef15640a7c1de7e89c581b245df7807d617ec3d86775330386ec5149ad567492fc5d31
2021-08-22 21:34:42 -05:00
MarcoFalke
f8a5d6fc76
Merge #14672: tests: Send fewer spam messages in p2p_invalid_messages
3d305e3b89 Send fewer spam messages in p2p_invalid_messages (James O'Beirne)

Pull request description:

  Builds on travis are failing because the test node isn't
  able to drop all the bad messages sent within the given
  timeout. Reduce the number of bad messages we're sending
  and increase the timeout to avoid failures on travis.

Tree-SHA512: 11c389619d9590caf7eca74e0efe6d950469415d34220072770689024b350cc08a2d5ec90634237d87ff71ba8b638c1152b8a45ffbb2815a48bde6a88fbb8fc6
2021-08-22 21:34:41 -05:00
Konstantin Akimov
ea6def648d
Fixed test by updating length of message accordingly dash' MAX MESSAGE SIZE 2021-08-22 21:34:41 -05:00
Wladimir J. van der Laan
cf627fba6d
Merge #14522: tests: add invalid P2P message tests
d20a9fa13d1c13f552e879798c0508be70190e71 tests: add tests for invalid P2P messages (James O'Beirne)
62f94d39f8de88a44bb0a8a2837d864f777aaacc tests: add P2PConnection.send_raw_message (James O'Beirne)
5aa31f6ef26f51ce461c917654dd1cfbbdd1409a tests: add utility to assert node memory usage hasn't increased (James O'Beirne)

Pull request description:

  - Adds `p2p_invalid_messages.py`: tests based on behavior for dealing with invalid and malformed P2P messages. Includes a test verifying that we can't DoS a node by spamming it with large invalid messages.
  - Adds `TestNode.assert_memory_usage_stable`: a context manager that allows us to ensure memory usage doesn't significantly increase on a node during some test.
  - Adds `P2PConnection.send_raw_message`: which allows us to construct and send messages with tweaked headers.

Tree-SHA512: 720a4894c1e6d8f1551b2ae710e5b06c9e4f281524623957cb01599be9afea82671dc26d6152281de0acb87720f0c53b61e2b27d40434d30e525dd9e31fa671f
2021-08-22 21:34:32 -05:00
fanquake
b10159648f partial merge bitcoin#19844: lint: add C++ code linter
This currently only checks for boost::bind usage.

Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
2021-08-21 15:33:37 -05:00
Wladimir J. van der Laan
7ac0213b1e Merge #14242: Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...)
d855e4cac8303ad4e34ac31cfa7634286589ce99 Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...) (practicalswift)

Pull request description:

  Avoid triggering undefined behaviour (`std::memset(nullptr, 0, 0)`) if an invalid string is passed to `DecodeSecret(...)`.

  Background reading: [memcpy (and friends) with NULL pointers](https://www.imperialviolet.org/2016/06/26/nonnull.html)

  Steps to reproduce:

  ```
  ./configure --with-sanitizers=undefined && make check && ./test/functional/test_runner.py
  ```

Tree-SHA512: b8325ced4f724d9c03065e0747af56b1f297a90d9fb09a24d46c3231a90dce3df6299f2c41f863b5cec18eaeded7b46ee4b93d9a52adc2541eb4c44d2c0965d9
2021-08-18 22:38:11 -03:00
MarcoFalke
33384816b5 Merge #14519: tests: add utility to easily profile node performance with perf
13782b8ba8 docs: add perf section to developer docs (James O'Beirne)
58180b5fd4 tests: add utility to easily profile node performance with perf (James O'Beirne)

Pull request description:

  Adds a context manager to easily (and selectively) profile node performance during functional test execution using `perf`.

  While writing some tests, I encountered some odd bitcoind slowness. I wrote up a utility (`TestNode.profile_with_perf`) that generates performance diagnostics for a node by running `perf` during the execution of a particular region of test code.

  `perf` usage is detailed in the excellent (and sadly unmerged) https://github.com/bitcoin/bitcoin/pull/12649; all due props to @eklitzke.

  ### Example

  ```python
  with node.profile_with_perf("large-msgs"):
      for i in range(200):
          node.p2p.send_message(some_large_msg)
      node.p2p.sync_with_ping()
  ```

  This generates a perf data file in the test node's datadir (`/tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data`).

  Running `perf report` generates nice output about where the node spent most of its time while running that part of the test:

  ```bash
  $ perf report -i /tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data --stdio \
    | c++filt \
    | less

  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 135  of event 'cycles:pp'
  # Event count (approx.): 1458205679493582
  #
  # Children      Self  Command          Shared Object        Symbol
  # ........  ........  ...............  ...................  ........................................................................................................................................................................................................................................................................
  #
      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)
                  |
                  ---CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNetMessage::readData(char const*, unsigned int)
                  |
                  ---CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      35.52%     0.00%  bitcoin-net      bitcoind             [.] std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                  |
                  ---std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                     CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

  ...
  ```

Tree-SHA512: 9ac4ceaa88818d5eca00994e8e3c8ad42ae019550d6583972a0a4f7b0c4f61032e3d0c476b4ae58756bc5eb8f8015a19a7fc26c095bd588f31d49a37ed0c6b3e
2021-08-18 22:24:36 -03:00
UdjinM6
b981c0df82
Merge pull request #4341 from PastaPastaPasta/backports-0.18-pr14
Backports 0.18 pr14
2021-08-18 22:05:46 +03:00
MarcoFalke
8e118581b2 Merge #14764: travis: Run thread sanitizer on unit tests
fa7d36b8e7 test: Move UBSAN suppressions to test/sanitizer_suppressions/ubsan (MarcoFalke)
fa36d4e456 travis: --disable-hardening for xenial thread sanitizer (MarcoFalke)
89bf196c88 travis: Run thread sanitizer (MarcoFalke)

Pull request description:

  On unit tests only for now. Disabled for the gui unit tests and all functional tests.

Tree-SHA512: 56f7d3b44e7cb68c76a2dc5abd85658955b1c2188932e988667c5a1cbcdd6be995d37bb949d62c6eb08a4aebfc43ff0370b7da1719d4e4f322a3495c1941a5e0
2021-08-18 13:56:42 -05:00
Dzutte
4b603e64e4
Backports v0.18: PR 13743: refactor: Replace boost::bind with std::bind (#4343)
* Merge #13743: refactor: Replace boost::bind with std::bind

cb53b825c2 scripted-diff: Replace boost::bind with std::bind (Chun Kuan Lee)
2196c51821 refactor: Use boost::scoped_connection in signal/slot, also prefer range-based loop instead of std::transform (Chun Kuan Lee)

Pull request description:

  Replace boost::bind with std::bind

  - In `src/rpc/server.cpp`, replace `std::transform` with simple loop.
  - In `src/validation.cpp`, store the `boost::signals2::connection` object and use it to disconnect.
  - In `src/validationinterface.cpp`, use 2 map to store the `boost::signals2::scoped_connection` object.

Tree-SHA512: 6653cbe00036fecfc495340618efcba6d7be0227c752b37b81a27184433330f817e8de9257774e9b35828026cb55f11ee7f17d6c388aebe22c4a3df13b5092f0

* Replace boost::bind with std::bind and remove Boost.Bind includes

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2021-08-17 23:31:09 +03:00
PastaPastaPasta
d7e57bdbe8
lint: fix linter failure in lint-python-dead-code.sh (#4344)
Signed-off-by: pasta <pasta@dashboost.org>
2021-08-17 23:08:49 +03:00
UdjinM6
3bc04d668a
Merge pull request #4338 from pravblockc/backports-v0.18-pr11
Backports v0.18: PR's #15176, 15235, 15272 and 15247
2021-08-17 22:55:21 +03:00
rkarthik2k21
883c84aa3e
Merge bitcoin#14272: init: Remove deprecated args from hidden args (#4335)
* Merge 9a3a984bb

Merge #14272: init: Remove deprecated args from hidden args

fa910e4301 init: Remove deprecated args from hidden args (MarcoFalke)

Pull request description:

  The args have been deprecated since 0.17 (maybe longer) and since we reject unknown args, there is no need to add deprecated args to the list of hidden args and then hand-craft an error message if a user provides them.

Tree-SHA512: 3a3191439ab0d7969fb72801d097bd86998524f84b3819380224f746cbe4b0f57beec1ad34744424f6587038035b0ddf418ad13171a8d9c3b97b4f3b7b3222a3

* Address review comment
Modified hidden_args in SetupServerArgs()
Removed usehd from list of unsupported/deprecated args

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2021-08-17 22:53:28 +03:00
MarcoFalke
8226f22efb Merge #15247: qa: Use wallet to retrieve raw transactions
fa5278a419 qa: Use wallet to retrieve raw transactions (MarcoFalke)
fa2198328e qa: Style-only fixes in touched files (MarcoFalke)

Pull request description:

  Instead of asking the coin database and block storage about a transaction, pull it directly from the wallet in wallet related tests.

  This refactoring only makes sense in light of #15159.

  <sub>This product may contain minor stylistic cleanups

Tree-SHA512: ec34c7150d873da9f19fead3f7e3f758baba5ef10061942384c470a47a6f320690109be9c5160f0c8bc228272a729653d44c78471455337318f657d6c164ba23
2021-08-16 23:56:24 -03:00
Wladimir J. van der Laan
ac01dbee63 Merge #15235: Do not import private keys to wallets with private keys disabled
e6c58d3b014ab8ef5cca4be68764af4b79685fcb Do not import private keys to wallets with private keys disabled (Andrew Chow)
b5c5021b644731d14a6ef04961320a99466f035a Refactor importwallet to extract data from the file and then import (Andrew Chow)
1f77f6754ce724493b0cb084ae0b35107d58605f tests: unify RPC argument to cli argument conversion and handle dicts and lists (Andrew Chow)

Pull request description:

  Fixes a bug where private keys could be imported to wallets with private keys disabled. Now every RPC which can import private keys checks for whether the wallet has private keys are disabled and errors if it is. Also added an belt-and-suspenders check to `AddKeyPubkeyWithDB` to have it assert that the wallet has private keys enabled.

Tree-SHA512: 5cd04febce9aa2bd9bfd02f312c6ff8705e37278cae59efd3895f6d6e2f1b477aefd297e2dd0860791bdd3d4f3cad8eb1a404f8f3d4e2035b91314ad2c1028ae

dash changes
2021-08-16 23:56:13 -03:00
PastaPastaPasta
592cd0a939
Merge pull request #4333 from Munkybooty/backports-0.18-pr13
Backports 0.18 pr13
2021-08-16 14:24:51 -05:00
MarcoFalke
2d5d90735a Merge #15026: [test] Rename rpc_timewait to rpc_timeout
4999992c34 whitespace: Split ~300 char line into multiple ones (MarcoFalke)
fa71b38168 scripted-diff: Rename rpc_timewait to rpc_timeout (MarcoFalke)
fa3e5786d0 scripted-diff: Remove unused 'split' parameter to setup_network (MarcoFalke)

Pull request description:

  This is a bugfix, since wallet_dump currently uses the wrong name:

  18857b4c40/test/functional/wallet_dump.py (L89-L92)

  Rename all to the same name with a scripted diff (and some unrelated cleanups).

Tree-SHA512: 338ddd20dae12e6cf7aa7adbcfb239cf648017a1572b373f8431fecb184bd2a65492846d81e75a023864d9e41c94afb53044c16b79651a5937d34a5a6b772f81
2021-08-15 11:08:08 -04:00
MarcoFalke
29ba5a37de Merge #14788: tests: Possible fix the permission error when the tests open the cookie file
d6b3790d1a tests: check readability of cookie file (Chun Kuan Lee)

Pull request description:

  This PR would wait until the `.cookie` file is readable
  Possible fix no. 5 `PermissionError` in #14446

Tree-SHA512: e7055c7ca26a6eadbbe19e4eef08ffee61cd17de79b30af2f0d090f0ad81ca24815e3c7e034e5e30d47c580bb0b221b3955e9ff2fcec2274fbf7b9232ab0cdc7
2021-08-15 11:08:08 -04:00
Wladimir J. van der Laan
debac13960 Partial Merge #14831: Scripts and tools: Use #!/usr/bin/env bash instead of #!/bin/bash.
688f665a5e526fda0fb797bf617412fe9cbe64fd Scripts and tools & Docs: Used #!/usr/bin/env bash instead of obsolete #!/bin/bash, added linting for .sh files shebang and updated the Developer Notes. (vim88)

Pull request description:

  As it was discussed in [#13510](https://github.com/bitcoin/bitcoin/pull/13510), it is better to use `#!/usr/bin/env bash` instead of `#!/bin/bash`.

Tree-SHA512: 25f71eb9a6a0cdc91568b5c6863205c5fe095f77a69e633503a2ac7805bd9013af8538e538c0c666ce96a28e3f43ce7a8df5f08d4ff007723bb588d85674f2da
2021-08-15 11:08:08 -04:00
Wladimir J. van der Laan
31924dbd30 Merge #14864: test: Run scripted-diff in subshell
43f909990190b3ff7883f0b2c117daa876d8fd99 scripted-diff: Run scripted-diff in subshell (Carl Dong)

Pull request description:

  scripted-diffs should be run in subshells so that their execution does not
  affect the shell variables of commit-script-check. Shell variables are not
  unset before evaluating the scripted-diff, so that they might be used in
  the subshell. To this end, the variable previously named i is now more
  descriptively named commit, this also allows scripted-diffs to use the
  commonly used variable i without fear of losing a reference to the
  commit.

Tree-SHA512: 0d86c069c2a978ca07d71bcd2b1b273e9bfabfe7e31a50c7b1b860e04f178b81c65814c3a38fb01e50b41a5065b646f0dab5b05d9be71138e72d4baba607e37b
2021-08-15 11:08:08 -04:00
Wladimir J. van der Laan
2d5a90f3b5 Merge #14816: Add CScriptNum decode python implementation in functional suite
2012d4df2 Add CScriptNum decode python implementation in functional suite (Gregory Sanders)

Pull request description:

  I needed this for reasons and thought it'd be good to upsteam it.

Tree-SHA512: 6ea89fa2a5f5a7759ba722f2b4ed5cd6423ebfff4e83ac8b8b5c935e6aa479684e626c5f41fa020816d2a9079a99af5564e30808594d5c13e3b51ec9b474926d
2021-08-15 11:08:08 -04:00
5tefan
4b2580102e Merge #14561: Remove fs::relative call and fix listwalletdir tests
ed2e18398b3ab657e98e3e1fe135cbf8dd94fda3 Remove fs::relative call and fix listwalletdir tests (João Barbosa)

Pull request description:

  The implementation of `fs::relative` resolves symlinks which is not
intended in ListWalletDir. The replacement does what is required, and
`listwalletdir` RPC tests are fixed accordingly.

  Also, `fs::recursive_directory_iterator` iteration is fixed to build
with boost 1.47.

  Based on #14559

Tree-SHA512: 1da516226073f195285d10d9d9648c90cce0158c5d1eb9c31217bb4abb575cd37f07c00787c5a850554d6120bbc5a3cbc5cb47d4488b32ac6bcb52bc1882d600
2021-08-14 11:56:56 -06:00
5tefan
12d24c70f4 Merge #14559: appveyor: Enable multiwallet tests
4dca7d0a98 appveyor: Enable multiwallet test (Chun Kuan Lee)

Pull request description:

  Based on #14320

  This PR enable multiwallet test on appveyor. Also re-enable symlink
tests on Windows which is available after Windows Vista.

  I disable these tests in #13964 because I suppose that Windows does
not support symlink, but I was wrong.

Tree-SHA512: 852cd4dedf36ec9c34aff8926cb34e6a560aea0bb9170c7a2264fc292dbb605622d561568d8df39aeb90d3d2bb700901d218ea7e7c5e21d84827c40d6370b369
2021-08-14 11:51:31 -06:00
5tefan
d09b13066c Merge #14465: tests: Stop node before removing the notification file
ca6d86c322 tests: Stop node before removing the notification file (Chun Kuan Lee)

Pull request description:

  Stop node before removing the notification file to make sure the
command has been terminated. After then we could removing those files
safely and do not receive any permission error. (See #14446)

  The permission error is Windows specific, documented in python doc:
>On Windows, attempting to remove a file that is in use causes an
exception to be raised

  See https://docs.python.org/3/library/os.html#os.remove

Tree-SHA512: fbdabf3a9a838bb59ba207dd9e9fbdd87c702a99ad66bee0b2b1537f80f8630d22d9d5e9c4ded23a82a66bfc10989227fb024b27393425abe0e5a2ad4e4cbb82
2021-08-13 22:06:22 -06:00
5tefan
ac3640899c Merge #14275: tests: Write the notification message to different files to avoid race condition in feature_notifications.py
67654b6405 tests: write the notification to different files to avoid race condition (Chun Kuan Lee)

Pull request description:

  This PR change the behavior that `feature_notifications.py` would
write to different files instead of writing to  the same file to avoid
race condition.

Tree-SHA512: 78406167cc6a3f570134b0ee76d2be1440bc1498cd7b1be72fae16d0ab86950e26ef3bf6008796016e5418231400c6492f0e062909dd882646541ecb7a70fb30
2021-08-13 22:06:22 -06:00
5tefan
f9498d0051 Merge #14291: wallet: Add ListWalletDir utility function
d56a0689354fb814510c6c393f3e07ac9362dc1f docs: Add release notes for listwalletdir RPC (João Barbosa)
0cb3cad166bbeb75e9cc1512286453f8e7d4f717 qa: Add tests for listwalletdir RPC (João Barbosa)
cc3377360c417780f5cbd7bd69b438817a9d60be rpc: Add listwalletdir RPC (João Barbosa)
d1b03b8e5f04a2cc9ebb985bd9a1aebd2068f757 interfaces: Add getWalletDir and listWalletDir to Node (João Barbosa)
fc4db35bfd78d85d6b52d5da3d89696160658450 wallet: Add ListWalletDir utility (João Barbosa)

Pull request description:

  `ListWalletDir` returns all available wallets in the current wallet
directory.

  Based on MeshCollider work in pull #11485.

Tree-SHA512: 5843e3dbd1e0449f55bb8ea7c241a536078ff6ffcaad88ce5fcf8963971d48c78600fbc4f44919523b8a92329d5d8a5f567a3e0ccb0270fdd27366e19603a716
2021-08-13 22:06:13 -06:00
UdjinM6
03bca032ad
Merge pull request #4331 from pravblockc/backports-v0.18-pr10
Backports v0.18: PR's 14530 and 14365
2021-08-13 23:24:58 +03:00
MarcoFalke
12047d77d0 Merge #14365: tests: Add Python dead code linter (vulture) to Travis
c82190cdb6 tests: Add Python dead code linter (vulture) (practicalswift)
590a57fdec tests: Remove unused testing code (practicalswift)

Pull request description:

  Add Python dead code linter (`vulture`) to Travis.

  Rationale for allowing dead code only after explicit opt-in (via `--ignore-names`):
  * Less is more :-)
  * Unused code is by definition "untested"
  * Unused code can be an indication of bugs/logical errors. By making the contributor aware of newly introduced unused code it gives him/her an opportunity to investigate if the unused code they introduce is malignant or benign :-)
  * Unused code is hard to spot for humans and is thus often missed during manual review
  * [YAGNI](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)

  Based on #14312 to make linter job pass.

Tree-SHA512: 4c581df7c34986e226e4ade479e0d3c549daf38f4a4dc4564b25564d63e773a1830ba55d1289c771b1fa325483e8855b82b56e61859fe8e4b7dfa54034b093b6
2021-08-12 14:42:32 -03:00
Kittywhiskers Van Gogh
21c7e57493 bitcoin#14121: Index for BIP 157 block filters
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-08-12 12:44:03 +05:30
PastaPastaPasta
39e34e2b52
Merge pull request #4334 from linuxsh2/bp-19
Backports v0.19 (16767, 16646, 16470, 16329, 16234, 16059, 15968, 15866, 15755, 15617, 15466, 15491)
2021-08-11 16:57:34 -05:00
fanquake
b08bc1c56c Merge #16767: test: Check for codespell in lint-spelling.sh
8340763dc3278c828ee7d525de4c71b4615d17cc Check for codespell in lint-spelling.sh (Kristaps Kaupe)

Pull request description:

  Similar check for `spellcheck` already exists in `lint-shell.sh`

ACKs for top commit:
  practicalswift:
    ACK 8340763dc3278c828ee7d525de4c71b4615d17cc -- diff looks correct
  fanquake:
    ACK 8340763dc3278c828ee7d525de4c71b4615d17cc  - Test is the same as in `lint-shell.sh`.

Tree-SHA512: f590fc4eae391c5246e86cb70cf79431bd3763ac872f82d3b2222c3a095235ca046a7072c5e61bbaeb3ed6ecd5ff85979769ee8b585de4fb97ac8cfbbf73b956
2021-08-11 13:58:48 -04:00
Wladimir J. van der Laan
b7e4be7f61 Merge #16646: qa: Run tests with UPnP disabled
b168dd30cf71ac176e271bc610b0b1a79ceaf075 Bugfix: QA: Run tests with UPnP disabled (Luke Dashjr)

Pull request description:

  This replaces #16560 by adding `upnp=0` to `bitcoin.conf` rather than passing it to nodes.

  > Needed for builds configured with --enable-upnp-default

  You can test this change using:
  ```bash
  ./configure --enable-upnp-default && make -j6 && test/functional/test_runner.py feature_config_args.py
  ```

  on master the test will fail without this change.

ACKs for top commit:
  practicalswift:
    ACK b168dd30cf71ac176e271bc610b0b1a79ceaf075 -- diff looks correct

Tree-SHA512: e639dd480dda2cffa19a679018c4bd7e4bd4d0f5e3001d6b407b833e3c166bde98b201063e267b8e45f8a20b0d53ec8bc028bec806b2357f9a7ba314cc4e2d07
2021-08-11 13:58:48 -04:00
Wladimir J. van der Laan
281e00f1f5 Merge #16470: test: Fail early on disconnect in mininode.wait_for_*
fac2e6a6045e4ddd6b473f4f3ddbb69d9d6921f6 test: Fail early on disconnect in mininode.wait_for_* (MarcoFalke)

Pull request description:

  The node might crash or disconnect when our mininode waits for data. Due to the crash, the data is guaranteed to never arrive and we can fail early with an assert

ACKs for top commit:
  laanwj:
    ACK fac2e6a6045e4ddd6b473f4f3ddbb69d9d6921f6

Tree-SHA512: 32ca844eb66bd70ea49103d51c76b953242b1886e0834d96fca8840fc984ff40346d0a799adf8f76b03514a783cb9cec69d45e00bdd328c5192c31b5d8d17af2
2021-08-11 13:58:48 -04:00
MarcoFalke
3c6c78e256 Merge #16329: test: Add tests for getblockchaininfo.softforks
faf6caf4daa33b9179f4f02c09e184245ea53fa1 test: Add tests for getblockchaininfo.softforks (MarcoFalke)

Pull request description:

ACKs for top commit:
  laanwj:
    Code review ACK faf6caf4daa33b9179f4f02c09e184245ea53fa1

Tree-SHA512: 8a0bb3b648f18fdba7a36a960d70c6217fd7312cf2ef52b3b911be0d7f1d27c5c50856946d7e6cb81d96c081913b7308cc5f9d89af34518439ff4ada024441da
2021-08-11 13:58:48 -04:00
MarcoFalke
0bcf02739b Merge #16234: test: Add test for unknown args
fa7dd88b71 test: Add test for unknown args (MarcoFalke)

Pull request description:

  Currently uncovered.

  Further reading:

  * https://marcofalke.github.io/btc_cov/total.coverage/src/util/system.cpp.gcov.html
  *  Fail on unknown config file options #15021

ACKs for commit fa7dd8:
  promag:
    ACK fa7dd88b71a1c6641bd450fae29a4a31849b1afd, tests looks good to me.
  hebasto:
    ACK fa7dd88b71a1c6641bd450fae29a4a31849b1afd, I have tested the code.

Tree-SHA512: 86ab370ce8e85925f945a52e81457b5678d71bbabcef01205a97782b780003f363552e0bad1ff678bccc784f82c6b511c3b88de3f8f25f62b0b713c387950564
2021-08-11 13:58:48 -04:00
MarcoFalke
22962a6a70 Merge #15866: test: Add missing syncwithvalidationinterfacequeue to wallet_import_rescan
fa465e4da4 test: Add missing syncwithvalidationinterfacequeue to wallet_import_rescan (MarcoFalke)

Pull request description:

  Fixes #15865

ACKs for commit fa465e:
  promag:
    utACK fa465e4da4c7242d7edd6339747572d23a39ff98.

Tree-SHA512: efc1d82b92aefb1f0e6c54ed0a2d69c547cd9dee7ff8d57a665022fefce01bcf726d394f0665abe4fbd3451abf3cb08eed6ff45def831857f917a988e13a1055
2021-08-11 13:58:48 -04:00
MarcoFalke
1935ab79b7 Merge #15466: tests: Print remaining jobs in test_runner.py
2e5d482659 tests: Print remaining jobs in test_runner.py (Steven Roose)

Pull request description:

  This helps finding out which tests fail to finish.

Tree-SHA512: d22beb82beecd33aaa50731c83075e49577842d29fd21aa63bcb859df5da99069eba9cc16eed5d91dbba8fb0fdc317fb88b3b370c4d3917e9da1cd13b0a622dc
2021-08-11 13:58:48 -04:00
PastaPastaPasta
90e7119a8b
Merge pull request #4312 from kittywhiskers/fuzz
merge bitcoin#15043, #15295, #15399, #17452, #16338, #15504, #17076, #17069, #17018: fuzzing
2021-08-11 11:28:26 -05:00
PastaPastaPasta
a9bfde558a
Merge pull request #4313 from Munkybooty/backports-0.18-pr12
Backports 0.18 pr12
2021-08-11 11:11:35 -05:00
Kittywhiskers Van Gogh
798bebce33 tests: remove unneeded boost dependency to satisfy linter 2021-08-11 15:01:08 +05:30
Kittywhiskers Van Gogh
422041f96b partial bitcoin#16236: Log output even if fuzzer failed 2021-08-11 09:48:41 +05:30
Kittywhiskers Van Gogh
4e6aca0ac1 bitcoin#17051: Add deserialization fuzzing harnesses 2021-08-11 09:48:41 +05:30
Kittywhiskers Van Gogh
d967c39222 bitcoin#15295: Add test/fuzz/test_runner.py and run it in travis 2021-08-11 08:50:43 +05:30
MarcoFalke
b45c353c5c Merge #14777: tests: Add regtest for JSON-RPC batch calls
3d2c7d6f94 Add regtest for JSON-RPC batch calls. (Daniel Kraft)

Pull request description:

  This adds a new regtest file `interface_rpc.py`, containing a test for batch JSON-RPC requests.  Those were previously not tested at all.  Tests for basic requests are not really necessary, as those are used anyway in lots of other regtests.

  The existing `interface_http.py` file is more about the underlying HTTP connection, so adding a new interface file for the JSON-RPC specific things makes sense.

Tree-SHA512: 7c7576004c8474e23c98f4bf25fb655328ba6bb73ea06744ebee1c0ffbb26bc132e621ae52955d51dab0803b322f8d711667626a777ac9b26003339c2484502f
2021-08-10 20:24:28 -04:00
MarcoFalke
0fd490ff28 Merge #14720: rpc: Correctly name arguments
fa0815c300 rpc: Correctly name arguments (Jon Layton)

Pull request description:

  Consistently use the same name to describe arguments in the documentation and add a test that uses the name.

  By splitting it up, the changes are easier to potentially backport and also make review easier when we switch to `RPCHelpMan`.

  The tests should pass with or without the changes in `src`.

  Partly stolen from #14459 (More RPC help description fixes by ch4ot1c)

Tree-SHA512: 1072992b1e93ac41006613523e54a0a8004f529fcb101eb9d74d91474abb0945a5a7539f249905151b904b87448f9efc0cacbd9e052fbe2ea9111e62f3e7249c
2021-08-10 20:24:28 -04:00
Stefan
97b3ad18af
Merge bitcoin#13399: rpc: Add submitheader (#4326)
* Merge bitcoin#13399: rpc: Add submitheader

fa091b001605c4481fb4eca415929a98d3478549 qa: Add tests for submitheader (MarcoFalke)
36b1b63f20cc718084971d2cadd04497a9b72634 rpc: Expose ProcessNewBlockHeaders (MarcoFalke)

Pull request description:

  This exposes `ProcessNewBlockHeaders` as an rpc called `submitheader`.
This can be used to check for invalid block headers and submission of
valid block headers via the rpc.

Tree-SHA512:
a61e850470f15465f88e450609116df0a98d5d9afadf36b2033d820933d8b6a4012f9f2b3246319c08a0e511bef517f5d808cd0f44ffca91d10895a938004f0b

* Update test/functional/mining_basic.py

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-08-10 22:37:50 +03:00
Kittywhiskers Van Gogh
fc8952aa19
build: add libgmp detection, make immer a package (#4311)
* build: detect the presence of libgmp before generating Makefile

* depends: add arximboldi/immer@v0.6.2 as a package and add detection

* depends: remove immer from source tree, build using package only

* Drop immer refs from tools

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-08-10 22:35:55 +03:00
UdjinM6
7aebf156e9
Merge pull request #4229 from kittywhiskers/auxports
merge #16117, #18358, #17383, #21052, #14424, #15159, #14689, #14978, partial #16908, #14978, #13932: Auxillary Backports
2021-08-10 22:34:17 +03:00
Kittywhiskers Van Gogh
522934703a merge #14978: Factor out PSBT utilities from RPCs for use in GUI code; related refactoring 2021-08-09 12:38:11 +05:30
Kittywhiskers Van Gogh
5ae8e75c24 merge #14689: Require a public key to be retrieved when signing a P2PKH input 2021-08-09 12:38:11 +05:30
Kittywhiskers Van Gogh
e8e48b33bb merge #15159: Remove lookup to UTXO set from GetTransaction
No need for extra `-txindex` in Dash-specific tests, it's `true` by default
2021-08-09 12:38:04 +05:30
PastaPastaPasta
f28cc7aeba
Merge pull request #4303 from linuxsh2/backport/batch-1
Backport v0.18 (15273, 15337, 15297, 15322, 15196, 14884, 14966, 15012, 14319, 14809, 14783, 14820, 14678)
2021-08-06 16:23:59 -05:00
PastaPastaPasta
ff2048a8be
Merge pull request #4315 from pravblockc/backports-v0.18-pr6
Backports v0.18 PR's: 14805, 14947 and 14953
2021-08-06 16:17:59 -05:00
PastaPastaPasta
e626522f1c
Merge pull request #4306 from pravblockc/backports-v0.18-pr5
Backports v0.18 PR:14310, 14305 and 14307 with dash specific changes
2021-08-06 16:16:54 -05:00
MarcoFalke
59ae41853b Merge #14307: Consolidate redundant implementations of ParseHashStr
9c5af58d51 Consolidate redundant implementations of ParseHashStr (Ben Woosley)

Pull request description:

  This change:
  * adds a length check to all calls to `ParseHashStr`, appropriate given its use to populate
    a 256-bit number from a hex str
  * allows the caller to handle the failure, which allows for the more
    appropriate `JSONRPCError` on failure in `prioritisetransaction` rpc

  Relative to #14288

Tree-SHA512: baa791147e5ceb3c30c70df3981aaf807bf7d4a90a0be3625540b59aa4b9a9d303a452bfef18bf167cbb833ef9591b4ef5948bf4a1ce67b421d804ae8d20ea53
2021-08-04 00:25:04 -03:00
MarcoFalke
1d3f047cd1 Merge #14305: Tests: enforce critical class instance attributes in functional tests, fix segwit test specificity
e460232876 Document fixed attribute behavior in critical test framework classes. (Justin Turner Arthur)
17b42f4122 Check for specific tx acceptance failures based on script signature (Justin Turner Arthur)
3a4449e9ad Strictly enforce instance attrs in critical functional test classes. (Justin Turner Arthur)
1d0ce94a54 Fix for incorrect version attr set on functional test segwit block. (Justin Turner Arthur)
ba923e32a0 test: Fix broken segwit test (practicalswift)

Pull request description:

  No extra attributes will be able to be added to instances of the C++ class ports or of other critical classes without causing an exception. Helps prevent adding or depending on attributes that aren't in the intended object structure. It may prevent issues such as the one fixed in bitcoin/bitcoin#14300.

  This request fixes the erroneous version attribute used in the p2p_segwit.py functional tests. This pull includes the commit from bitcoin/bitcoin#14300.

Tree-SHA512: 1b8c58e7aa0f71075ed5ff3e5be0a5182599108d8cd9bce682feac3b1842508124288e9335432b16a43f40f159c9710899e6d84af1b5868f48c947bc6f3e07ec
2021-08-04 00:21:42 -03:00
MarcoFalke
a309982e82 Merge #14947: scripts: Remove Python 2 import workarounds
4de11a3682 Remove Python 2 import workarounds (practicalswift)

Pull request description:

  Remove Python 2 import workarounds.

  As noted by @jnewbery in https://github.com/bitcoin/bitcoin/pull/14903#discussion_r241396925:

  > This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request.

Tree-SHA512: e0d21e6299dd62fb669ad95cbd3d19f7c803195fd336621aac72fd10ddc7431d90443831072a2e1eb2fc880d1d88eb7c3e2ead3da59f545f6db07d349af98fb3
2021-08-03 18:39:42 -03:00
Wladimir J. van der Laan
1bd1a23359 Merge #14805: tests: Support calling add_nodes more than once
98a1846b00d9c3076d6dcd96244fae6f923e26a0 tests: Support calling add_nodes more than once (Steven Roose)

Pull request description:

  Ran into this while writing [a multi-chain test for Elements](https://github.com/ElementsProject/elements/pull/458) where I call this method more than once.

Tree-SHA512: f2d698fcb560552aa5d81a4c3fbf40b7269b228b34d85a118291649ef83f8c0a30cd82a28d418237b55893bcecd538046b704e64a4d8a41f2c0aef8033dc83e5
2021-08-03 18:38:21 -03:00
MarcoFalke
8ce5b6b099 Merge #15337: rpc: Fix for segfault if combinepsbt called with empty inputs
30d0f7be6e rpc: Fix for segfault if combinepsbt called with empty inputs (benthecarman)

Pull request description:

  Fixes #15300

Tree-SHA512: 25e7b4e6e48d8b0d197f0ab96df308fff33e2110f8929cb48914877fa7f4c4a84f173b1378fdb2dec5d03fe7d6d1aced4b577e55f9fe180d8147d9106ebf543f
2021-08-03 10:48:15 -04:00
MeshCollider
7195f7cdf7 Merge #15297: wallet: Releases dangling files on BerkeleyEnvironment::Close
d3bf3b930 qa: Test .walletlock file is closed (João Barbosa)
2f8b8f479 wallet: Close wallet env lock file (João Barbosa)
8602a1e6a wallet: Close dbenv error file db.log (João Barbosa)

Pull request description:

  This PR closes `db.log` and removes `.walletlock` files when `BerkeleyEnvironment` is closed.

  Fixes https://github.com/bitcoin/bitcoin/issues/15291#issuecomment-459131886.

Tree-SHA512: 05d8b027feea914e0ba873e75d117857473d1fd7b400e41bd473d638171fa39d5be048990bf685dc0807f7d92418579b763056dc2a6dcf6b96777d5688ddee04
2021-08-03 10:46:20 -04:00
Jonas Schnelli
c2b8e5f0c9 Merge #15196: [test]: Update all subprocess.check_output functions to be Python 3.4 compatible
fdf82ba18 Update all subprocess.check_output functions in CI scripts to be Python 3.4 compatible (Graham Krizek)

Pull request description:

  CI is failing the `lint` stage on every Cron run (regular PR/Push runs still pass). The failure was introduced in 74ce326 and has been broken since. The Python version running in CI was downgraded to 3.4 from 3.6. There were a couple files that were using the `encoding` argument in the `subprocess.check_output` function. This was introduced in Python 3.6 and therefore broke the scripts that were using it. The `universal_newlines` argument was used as well, but in order to use it we must be able to set encoding because of issues on some BSD systems.

  To get CI to pass, I removed all `universal_newline` and `encoding` args to the `check_ouput` function. Then I decoded all `check_output` return values. This should keep the same behavior but be Python 3.4 compatible.

Tree-SHA512: f5e5885e98cf4777be9cc254446a873eedb03bdccbd8e06772a964db95e9fcf46736aa9cdcab1d8f123ea9f4947ed6020679898d8b2f47ffb1d94c21a4b08209
2021-08-03 10:43:56 -04:00
Wladimir J. van der Laan
d70d401c72 Merge #14884: Travis: enforce Python 3.4 support through linter
31926ee8cfc73501524dfa0fef2ccbaa786d6a00 [test] functional framework: add CScript hex() for Python 3.4 (Sjors Provoost)
74ce32683199b987e45eb16f0320ae392ff10edc [test] Travis: enforce Python 3.4 support in functional tests (Sjors Provoost)

Pull request description:

  The minimum supported version of Python is 3.4 according to [dependencies.md](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md). This PR makes the Travis linter use this version in order to catch accidental use of modern syntax.

Tree-SHA512: 71b2c102be72b135a8ba049378d66875760f20a04a657102a399240c5c2b2ddbdfa7d5ab4c0c0242ecc3259e0ee8eb2273f331bc5eb824f4ae4c3cc58aea37ac
2021-08-03 10:39:19 -04:00
Kittywhiskers Van Gogh
15055e46f6
merge bitcoin#13960: Fix PSBT deserialization of 0-input transactions (#4310) 2021-08-03 12:15:44 +03:00
PastaPastaPasta
f87d62d677
refactor: misc bls, evo, include refactoring (#4305)
* refactor/bls: misc refactoring and spelling/grammar fixes in bls code

* refactor/evo: misc refactoring and spelling/grammar fixes in evo code

* refactor: some include changes

* refactor: remove redundant `public`

* fix linter

Signed-off-by: pasta <pasta@dashboost.org>

* Sort includes

* Move `class CTxDSIn;`

* Drop unused functions in CBLSWorker

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-07-31 21:29:12 +03:00
MarcoFalke
e68964ca20 Merge #14310: [wallet] Ensure wallet is unlocked before signing
20442f617f [wallet] remove redundand restart node (gustavonalle)
db15805668 [wallet] Ensure wallet is unlocked before signing (gustavonalle)

Pull request description:

  Fixes #14082

Tree-SHA512: 200620a2ced934f958933aba34541565a992e5033cf04c4e2be48b99e7708973c85f8274968962cec943f0c1d76fb2faa5e056469bbf59ce7f768614572322f9
2021-07-29 22:27:57 -03:00
MarcoFalke
2f59f766d6 Merge #14410: rpcwallet: 'ischange' field for 'getaddressinfo' RPC
14a06525b2 tests: add test for 'getaddressinfo' RPC result 'ischange' field (whythat)
93d1aa9abc rpcwallet: add 'ischange' field to 'getaddressinfo' response (whythat)

Pull request description:

  Implementation of proposal in #14396.

  This introduces `CWallet::IsChange(CScript&)` method and replaces original `CWallet::IsChange(CTxOut&)` method with overloaded version that delegates to the new method with *txout*'s `scriptPubKey`. In this way `TODO` note from the original method can still be addressed in a single place.

Tree-SHA512: ef5dbc82d76b4b9b2fa6a70abc3385a677c55021f79e187ee2f392ee32bc6b406191f4129acae5c17b0206e72b6712e7e0cad574a4bbd966871c2e656c45e041

# Conflicts:
#	doc/release-notes-14282.md
#	src/wallet/rpcwallet.cpp
2021-07-28 12:08:07 -04:00
Wladimir J. van der Laan
65c030f7ac Merge #14377: check that a separator is found for psbt inputs, outputs, and global map
4fb3388db95f408566e43ebb9736842cfbff0a7d check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow)

Pull request description:

  Currently it doesn't make sure that a separator was found so PSBTs missing a trailing separator would still pass. This fixes that and adds a test case for it.

  It really only makes sense to check for the separator for the output maps as if an input or global map was missing a separator, the fields following it would be interpreted as belonging to the previous input or global map. However I have added the check for those two anyways to be consistent.

Tree-SHA512: 50c0c08e201ba02494b369a4d36ddb73e6634eb5a4e4e201c4ef38fd2dbeea2c642b8a04d50c91615da61ecbfade37309e47431368f4b1064539c42015766b50
2021-07-28 12:08:07 -04:00
MarcoFalke
6d4984b0a7 Merge #14630: test_runner: Remove travis specific code
fa43626611 test_runner: Remove travis specific code (MarcoFalke)

Pull request description:

  The tests are no longer run on travis, but in a docker, developer machines or a windows vm.

  The code was essentially dead for months now. Fix that by explicitly passing in `--ci` to the test runner on our docker and appveyor windows vm.

Tree-SHA512: 5d48693c03e8eb27536658ccf9ba738fe93a72abd4b72c80caac084b5b2cdffa77a1031a671eeefe70b71d63500f55917803d4be54d01849722afdccb700a9e6
2021-07-28 12:08:07 -04:00
MarcoFalke
6e0fdc7321 Merge #14571: [tests] Test that nodes respond to getdata with notfound
fa78a2fc67 [tests] Test that nodes respond to getdata with notfound (MarcoFalke)

Pull request description:

  If a node has not announced a tx at all, then it should respond to
  getdata messages for that tx with notfound, to avoid leaking tx
  origination privacy.

  In the future this could be adjusted such that a node responds with
  notfound when a tx has not been announced to us, but that seems
  to be a more involved change. See e.g.
  https://github.com/jnewbery/bitcoin/commits/pr14220.1

Tree-SHA512: 6244afa5bd5d8fec9b89dfc02c9958bc370195145a0f3715f33200d6cf73a376c94193d44bf4523867196e6591c53ede8f9b6a77cb296b48c114a117b8c8b1fa
2021-07-26 09:57:14 -04:00
PastaPastaPasta
edf0552c0c
Merge pull request #4187 from kittywhiskers/scantxout
merge #12196, #13697: Add scantxoutset RPC method
2021-07-25 19:10:11 -05:00
Wladimir J. van der Laan
07c0eec88c Merge #14518: rpc: Always throw in getblockstats if -txindex is required
3be209d103297aaf2fe4711e237a65046488ea19 rpc: Always throw in getblockstats if -txindex is required (João Barbosa)

Pull request description:

  Previously blocks with only the coinbase transaction didn't cause
  the RPC error even if the requested stats required -txindex and
  it wasn't enabled.

  Fixes #14499.

Tree-SHA512: d3a6402889e3ce7199632e79eba66d7d471ff7de5c564d35312e2340cc6d84ef544a8172548fbc2eedf5e637b56dc57bbf7a9815ab798c7f226755f897fd8f3e
2021-07-23 10:12:54 -04:00
MarcoFalke
4f5a966f66 Merge #14419: [tests] Remove rpc_zmq.py
42a995ae48 [tests] Remove rpc_zmq.py (John Newbery)

Pull request description:

  rpc_zmq.py is racy and fails intermittently. Remove that test file and
  move the getzmqnotifications RPC test into interface_zmq.py.

Tree-SHA512: 666c8f252f8a392deda1bd531e84fdc04bdae4eab09407657ade2b5fc0aeffa247735e20314236f56e4e3402476673f3b7538d6e09f5af6976021ba2377ce63c
2021-07-22 16:02:58 -04:00
UdjinM6
54816bfbfd
Fix devnet name, tweak tests (#4284)
* Fix GetDevNetName

* Fix initialize_datadir

* Adjust peer_connect to use the same devnet name as in initialize_datadir

* Tweak p2p_connect_to_devnet.py to test mininode devnet connections
2021-07-22 11:24:46 +03:00
Pasta
b5607b39d4
fix wallet_upgradetohd.py 2021-07-21 15:53:39 -05:00
Wladimir J. van der Laan
3cb8293ba5
Merge #15990: Add tests and documentation for blocksonly
fa8ced32a60dea37ac169241cf9a1f708ef46c4b doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke)
fa320de79faaca2b088fcbe7f76701faa9bff236 test: Add test for p2p_blocksonly (MarcoFalke)
fa3872e7b4540857261aed948b94b6b2bfdbc3d1 test: Format predicate source as multiline on error (MarcoFalke)
fa1dce7329d3e74d46ab98b93772b1832a3f1819 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke)

Pull request description:

  This is de-facto no longer hidden

ACKs for commit fa8ced:
  jamesob:
    utACK fa8ced32a6

Tree-SHA512: 474fbdee6cbd035ed9068a066b6056c1f909ec7520be0417820fcd1672ab3069b53f55c5147968978d9258fd3a3933fe1a9ef8e4f6e14fb6ebbd79701a0a1245
2021-07-21 15:53:38 -05:00
MarcoFalke
077f21875f
Merge #14179: qa: Fixups to "Run all tests even if wallet is not compiled"
fa8433e379 qa: Remove unneded import_deterministic_coinbase_privkeys overwrite, add comments (MarcoFalke)
e413c2ddd1 qa: Fix codespell error and have lint-spelling error instead of warn (MarcoFalke)

Pull request description:

  Currently the functional tests require the wallet module to be compiled into the Bitcoin Core executable. For example the premine (or datadir cache) to speed up tests when run in parallel would mine a bunch of blocks and store the private keys to sign the coinbase tx outputs in a wallet. There is no need to have the overhead of the whole wallet module by using keys that are deterministic for all runs.

  Note that this change most likely requires the `./test/cache/` to be cleared.

Tree-SHA512: 9ce26036b0e10f0f888f66a1e50be6a357343f9ffb302ae24a7bb3df2f083a31702ef308b738a03b08a1b623aeddac5d6563dc1b15078c0357b7dafad7808ec3
2021-07-21 15:53:38 -05:00
MarcoFalke
fcdf4a4092
partial Merge #14180: qa: Premine to deterministic address with -disablewallet
Signed-off-by: pasta <pasta@dashboost.org>
2021-07-21 15:53:38 -05:00
Kittywhiskers Van Gogh
4127918e86 tests: re-adapt scantxoutset RPC tests for Dash 2021-07-21 12:00:37 +05:30
Kittywhiskers Van Gogh
2bdb8540b6 Merge #13697: Support output descriptors in scantxoutset
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-07-21 11:58:00 +05:30
UdjinM6
6696f45a32
Change devnet uacomment from devnet=<name> to devnet.<name> (#4282)
Backporting 15654 in 4213 broke devnet connections because of SanitizeString for cleanSubVer. The real issue is using unsafe character in devnet uacomments actually, so to fix this we should replace unsafe `=` with something safe e.g. `.`.
2021-07-20 15:34:33 +03:00
Wladimir J. van der Laan
909a13082f Merge #16631: net: The default whitelistrelay should be true
3b05f0f70fbaee5b5eaa0d1b6f3b9d32f44410bb Reformat p2p_permissions.py (nicolas.dorier)
ce7eac3cb0e7d301db75de24e9a7b0af93c61311 [Fix] The default whitelistrelay should be true (nicolas.dorier)

Pull request description:

  I thought `whitelistrelay` default was `false` when it is `true`.

  The root of the issue come from the fact that all references to `DEFAULT_` are not in the scope of this file, so hard coding of default values are used everywhere in `net.cpp`. I think that in a separate PR we should fix that more fundamentally everywhere.

ACKs for top commit:
  promag:
    ACK 3b05f0f70fbaee5b5eaa0d1b6f3b9d32f44410bb.
  Sjors:
    re-ACK 3b05f0f70fbaee5b5eaa0d1b6f3b9d32f44410bb

Tree-SHA512: f4a75f986fa2adf1a5f1c91605e0d261f7ac5ac8535fb05437d83b8392dbcf5cc1a47d755adcf8ad8dc67a88de28060187200fd3ce06545261a5c7ec0fea831a
2021-07-19 19:00:04 -05:00
MarcoFalke
ce8b04fc38 Merge #16618: [Fix] Allow connection of a noban banned peer
d117f4541d4717e83c9396273e92960723622030 Add test for setban (nicolas.dorier)
dc7529abf0197dccb876dc4a93cbdd2ad9f03e5c [Fix] Allow connection of a noban banned peer (nicolas.dorier)

Pull request description:

  Reported by @MarcoFalke on https://github.com/bitcoin/bitcoin/pull/16248#discussion_r314026195

  The bug would mean that if the peer connecting to you is banned, but whitelisted without specific permissions, it would not be able to connect to the node.

  The solution is just to move the same line below.

ACKs for top commit:
  Sjors:
    Agree inline is more clear. utACK d117f45
  MarcoFalke:
    ACK d117f4541d4717e83c9396273e92960723622030

Tree-SHA512: 0fed39acb1e8db67bb0bf4c4de3ad034ae776f38d55bd661f1ae0e1a4c6becaf1824ab46ed8279f2f31df3f4b29ff56461d8b167d3e9cece62cfe58b5a912811
2021-07-19 19:00:04 -05:00
Wladimir J. van der Laan
6c75d20277 Merge #16248: Make whitebind/whitelist permissions more flexible
c5b404e8f1973afe071a07c63ba1038eefe13f0f Add functional tests for flexible whitebind/list (nicolas.dorier)
d541fa391844f658bd7035659b5b16695733dd56 Replace the use of fWhitelisted by permission checks (nicolas.dorier)
ecd5cf7ea4c3644a30092100ffc399e30e193275 Do not disconnect peer for asking mempool if it has NO_BAN permission (nicolas.dorier)
e5b26deaaa6842f7dd7c4537ede000f965ea0189 Make whitebind/whitelist permissions more flexible (nicolas.dorier)

Pull request description:

  # Motivation

  In 0.19, bloom filter will be disabled by default. I tried to make [a PR](https://github.com/bitcoin/bitcoin/pull/16176) to enable bloom filter for whitelisted peers regardless of `-peerbloomfilters`.

  Bloom filter have non existent privacy and server can omit filter's matches. However, both problems are completely irrelevant when you connect to your own node. If you connect to your own node, bloom filters are the most bandwidth efficient way to synchronize your light client without the need of some middleware like Electrum.

  It is also a superior alternative to BIP157 as it does not require to maintain an additional index and it would work well on pruned nodes.

  When I attempted to allow bloom filters for whitelisted peer, my proposal has been NACKed in favor of [a more flexible approach](https://github.com/bitcoin/bitcoin/pull/16176#issuecomment-500762907) which should allow node operator to set fine grained permissions instead of a global `whitelisted` attribute.

  Doing so will also make follow up idea very easy to implement in a backward compatible way.

  # Implementation details

  The PR propose a new format for `--white{list,bind}`. I added a way to specify permissions granted to inbound connection matching `white{list,bind}`.

  The following permissions exists:
  * ForceRelay
  * Relay
  * NoBan
  * BloomFilter
  * Mempool

  Example:
  * `-whitelist=bloomfilter@127.0.0.1/32`.
  * `-whitebind=bloomfilter,relay,noban@127.0.0.1:10020`.

  If no permissions are specified, `NoBan | Mempool` is assumed. (making this PR backward compatible)

  When we receive an inbound connection, we calculate the effective permissions for this peer by fetching the permissions granted from `whitelist`  and add to it the permissions granted from `whitebind`.

  To keep backward compatibility, if no permissions are specified in `white{list,bind}` (e.g. `--whitelist=127.0.0.1`) then parameters `-whitelistforcerelay` and `-whiterelay` will add the permissions `ForceRelay` and `Relay` to the inbound node.

  `-whitelistforcerelay` and `-whiterelay` are ignored if the permissions flags are explicitly set in `white{bind,list}`.

  # Follow up idea

  Based on this PR, other changes become quite easy to code in a trivially review-able, backward compatible way:

  * Changing `connect` at rpc and config file level to understand the permissions flags.
  * Changing the permissions of a peer at RPC level.

ACKs for top commit:
  laanwj:
    re-ACK c5b404e8f1973afe071a07c63ba1038eefe13f0f

Tree-SHA512: adfefb373d09e68cae401247c8fc64034e305694cdef104bdcdacb9f1704277bd53b18f52a2427a5cffdbc77bda410d221aed252bc2ece698ffbb9cf1b830577
2021-07-19 19:00:04 -05:00
UdjinM6
7ec01fd77a
Merge pull request #4278 from PastaPastaPasta/backports-0.18-pr9
Backports 0.18 pr9
2021-07-20 02:26:47 +03:00
Pasta
682c31dcab
14105 dashification 2021-07-19 17:11:20 -05:00
Wladimir J. van der Laan
da474c024c
Merge #14199: [psbt]Remove redundant BIP174 test from rpc_psbt.json
b6a253337f6371e4aa27c488ad70741d2b750d01 Remove redundant BIP174 test from rpc_psbt.json (araspitzu)

Pull request description:

  There was a duplicate test for SIGNER role inside 'test/functional/data/rpc_psbt.json', namely test number 2 was equal to test number 3 in the array of data for 'signer'. This pull request removes the 3rd (redundant) test.

Tree-SHA512: e2128c93183f2e0acf5247274397c77a962accf95dee3bb6f785494cf3080a3f28ea47d8209e36b3064490c821690d1742c22e0d76370cb1688dcb2ab91d8f57
2021-07-19 17:11:20 -05:00
MarcoFalke
e722918927
Merge #14189: qa: Fix silent merge conflict in wallet_importmulti
fa263bcfe4 qa: Fix silent merge conflict in wallet_importmulti (MarcoFalke)

Pull request description:

  Fixup to 13c842e

Tree-SHA512: 622616d5259cc639f6a8709c80c1f21abb8b21470412cbe3904c5e63c3c3b55a4472a37d7ae579a7f1d1af10bccb8a187dd9957d00975d10854047f7650bde76
2021-07-19 17:11:19 -05:00
Wladimir J. van der Laan
a1a1a0766b
Merge #14105: util: Report parse errors in configuration file
ed2332aeffb071a3404be9cff8f9fb8a81a9fbfb test: Add test for config file parsing errors (MarcoFalke)
a66c0f78a941968340f030911765a84219908c4d util: Report parse errors in configuration file (Wladimir J. van der Laan)

Pull request description:

  Report errors while parsing the configuration file, instead of silently ignoring them.

      $ src/bitcoind -regtest
      Error reading configuration file: parse error on line 22: nodebuglogfile, if you intended to specify a negated option, use nodebuglogfile=1 instead
      $ src/bitcoind -regtest
      Error reading configuration file: parse error on line 22: sdafsdfafs
      $ src/bitcoind -regtest
      Error reading configuration file: parse error on line 24: -nodebuglogfile=1, options in the configuration file must be specified without leading -

  (inspired by https://github.com/bitcoin/bitcoin/pull/14100#issuecomment-417264823)

Tree-SHA512: d516342b65db2969edf200390994bbbda23654c648f85dcc99f9f2d217d3d59a72e0f58227be7b4746529dcfa54ba26d8188ba9f14a57c9ab00015d7283fade2
2021-07-19 17:11:18 -05:00
Wladimir J. van der Laan
0b76f1495a
Merge #14122: Test rpc_help.py failed: Check whether ZMQ is enabled or not.
8dfc2f30dea6bde0f74d23691377f248966011ab Test rpc_help.py failed: Check whether ZMQ is enabled or not. (Kvaciral)

Pull request description:

  /test/functional/rpc_help.py checks for the zmq-category even while zmq may be disabled (in /test/config.ini) , I have added a check function to test_framework.py that can be used whether to determine to include zmq in a test or not.

Tree-SHA512: 6819050277e2dc875f8d9bf49a02291555cb7b301379dfb9d898e6d8e14bfb8eeb6bef8af46d07b5db45b2fe281b35ea7f98af9ffba703768658a69addbc81b1
2021-07-19 17:11:17 -05:00
UdjinM6
95f89eec56
Fix more spelling errors 2021-07-19 12:52:03 -05:00
UdjinM6
9b4a29393d
Add unparseable to lint-spelling.ignore-words.txt 2021-07-19 12:52:02 -05:00
UdjinM6
16877311da
Ignore crypto and immer in lint-spelling.sh 2021-07-19 12:52:02 -05:00
pasta
c12d3fd2cb
fix misc. spelling errors
Signed-off-by: pasta <pasta@dashboost.org>
2021-07-19 12:51:30 -05:00
Pieter Wuille
07abb538c3
Merge #14495: build: Warn (don't fail!) on spelling errors
c32cf6a0f2 Add ignored word: mut (practicalswift)
4ae50daaa7 Revert "qa: Fix codespell error and have lint-spelling error instead of warn" (practicalswift)

Pull request description:

  Revert `codespell` policy change introduced in #14179.

  Context: https://github.com/bitcoin/bitcoin/pull/13954#issuecomment-430200183

Tree-SHA512: 4606b19bb32cdd661f90b3778759818d3493e5ed1a4a2f95982f07eeb6b9c889bc8d53cde31706e0a3b9524c3d3a7378f1b769a60baeb0d00da4c68fd3068114
2021-07-19 12:51:30 -05:00
MarcoFalke
41494eea70
Merge #13954: Warn (don't fail!) on spelling errors. Fix typos reported by codespell.
f8a81f73ac lint: Add spell check linter (codespell) (practicalswift)
ada356208e Fix typos reported by codespell (practicalswift)

Pull request description:

  * Check for common misspellings using `codespell`.
  * Fix recently introduced typos reported by `codespell`.

Tree-SHA512: 9974c0e640b411c7d0ebc5b45de253c19bac7fe3002cd98601ff8da8db584224c2fd7d331aee3df612c9f2cfef540d647a9b4c5a1a73fd208dc93ce4bf9e5e3e
2021-07-19 12:51:24 -05:00
UdjinM6
8e19b6b398
Merge pull request #4271 from PastaPastaPasta/backports-0.18-pr8
Backports 0.18 pr8
2021-07-19 20:49:51 +03:00
UdjinM6
f11c1bc1f8
Ignore immer in code coverage checks, lint-whitespace.sh and copyright_header.py scripts (#4268) 2021-07-19 12:32:29 +03:00
UdjinM6
46e3a8c295
Fix lint-git-commit-check.sh (#4267)
We merge PRs into develop, not in master
2021-07-19 12:32:12 +03:00
MarcoFalke
dc425c3fea Merge #14526: docs: Document lint tests
8640631ebc docs: Document lint tests (Mason Simon)

Pull request description:

  Replaces #13708.
  Fixed the macOS nit, and added `codespell` as a requirement.

Tree-SHA512: efdef8238f9d4433cc6403f58075b906d39d6a2114821cb113a16f2fc45d0c10c603588272865edd40a0498d9685ff8ac25d2491d9fcf0f1f328b6d65751ac2c
2021-07-17 14:25:42 -05:00
Pieter Wuille
bf84aca4db Merge #14524: Trivial: fix typo
7e18673f04 Fix typo (Kristaps Kaupe)

Pull request description:

Tree-SHA512: 3f3557d9aad007562b780e34c25584d0de6f240cb9ff56779d224bf9b8cd7bd657c92a73222fd8d7f679c282dce6a75265ca61e20d50a834caa4a9f21a286b3a
2021-07-17 14:22:51 -05:00
UdjinM6
88da87d202
Merge pull request #4262 from PastaPastaPasta/backport-triv-pr17
Backport triv pr17
2021-07-16 20:30:46 +03:00
UdjinM6
0c2b1be930
Merge pull request #4261 from PastaPastaPasta/backport-triv-pr16
Backport triv pr16
2021-07-16 20:20:26 +03:00
UdjinM6
47317e8fd0
Merge pull request #4254 from UdjinM6/fix_permitsigdata
Merge #14356: fix converttopsbt permitsigdata arg, add basic test
2021-07-16 20:16:33 +03:00
MarcoFalke
12cb360247 Merge #21084: test: fix timeout decrease in feature_assumevalid
0d39b5848a7a341cd2b958336861cdd4098e2616 test: fix timeout decrease in feature_assumevalid (Bruno Garcia)

Pull request description:

  This PR fixes the timeout decrease in assert_blockchain_height function.

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

Tree-SHA512: ae3c83420b4de4ad41f1b20b6e77c3a26a8c5ac4fb136b2645fde119545a413c61312f76a16473141774bc955d30ac4fc86e5ca6cf729f8978a17d0dab520feb
2021-07-16 10:04:09 -05:00
fanquake
f827bf9d93 Merge #20763: test: Fix comment typo in BitcoinTestFramework
40fdb2a212d0a0e775114e4766d065e6d234c155 test: Fix Comment Typo in BitcoinTestFramework (Joel Klabo)

Pull request description:

  Missing "override" in comment describing use of set_test_params

ACKs for top commit:
  michaelfolkson:
    ACK 40fdb2a212d0a0e775114e4766d065e6d234c155

Tree-SHA512: bf893a0d5f8dc86a3ec2eaf48cd7c0f0f832f3b3d254b3d99953336db7e294571b1d2c8686030bf8a27cbe67b1a85a54e53ebefb2e57d6d8d6ac864a15dce4e7
2021-07-16 10:04:09 -05:00
Kittywhiskers Van Gogh
4619630551 merge #13671: Remove boost/algorithm/string/case_conv.hpp 2021-07-16 20:19:42 +05:30
UdjinM6
84769e128a
Merge pull request #4259 from PastaPastaPasta/backport-triv-pr13
backport: 'trivial' pr14
2021-07-16 03:38:13 +03:00
MarcoFalke
b682ce2a79 Merge #20101: rpc: change no wallet loaded message to be clearer
907f142fc7e1d35f443be076367739faf11cc2cc rpc: change no wallet loaded message to be clearer (Andrew Chow)

Pull request description:

  Changes the no wallet is loaded rpc error message to be clearer that no wallet is loaded and how the user can load or create a wallet. Also changes the error code from METHOD_NOT_FOUND to RPC_WALLET_NOT_FOUND as that makes more sense.

ACKs for top commit:
  MarcoFalke:
    review ACK 907f142fc7e1d35f443be076367739faf11cc2cc
  kristapsk:
    ACK 907f142fc7e1d35f443be076367739faf11cc2cc. In addition to standard tests, just in case tested that this doesn't break anything with JoinMarket.
  meshcollider:
    utACK 907f142fc7e1d35f443be076367739faf11cc2cc

Tree-SHA512: 4b413e6ab5430ec75a79de9db6583f2f3f38ccdf71aa373d8386a56e64f07f92200c8107c8c82c92c7c431d739615977c208b771a24c5960fa8676789b5497a2
2021-07-15 19:30:07 -05:00
MarcoFalke
76eb5e3a03 Merge #19887: test: Fix flaky wallet_basic test
56b018ca7f37d25041b74f1bec305bdf54a55b9b test: Fix flaky wallet_basic test (Fabian Jahr)

Pull request description:

  Fixes #19853

  I investigated the issue in #19876 and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, #19876 will only provide an error where before it was reporting a false balance.

Top commit has no ACKs.

Tree-SHA512: 52bb2388a3e77aa20d26ab0fd45796bc1781483b1cffe49cbb44e2488a72e76998edfb1198495373f9c6fd2ec26064d4176bd1a64dd59806622d5e50a4f4e870
2021-07-15 19:30:07 -05:00
MarcoFalke
1382c881df Merge #19722: test: Add test for getblockheader verboseness
5067c5acc30c5cf87496c1bf8eb03712cc66b206 [test] Add test for getblockheader verboseness (Torhte Butler)

Pull request description:

  Improve test coverage by adding a test for getblockheader with verbose argument set to false.

ACKs for top commit:
  theStack:
    ACK 5067c5acc3

Tree-SHA512: e55593f1026a89dc7b796fa985b4cbcdb596e91d80d42dfb0660bda1692aaa35749ec29f9cd7032803f6225afb323f085df1ef6a9982de87be8e098f7253cdd5
2021-07-15 19:30:07 -05:00
MarcoFalke
fb7b4bbdca Merge #19654: lint: Don't use TRAVIS_COMMIT_RANGE in commit message linter
72351784b3df21a89f79076f4b814a6e700b6469 lint: Remove travis env var from commit linter (Fabian Jahr)

Pull request description:

  #19439 was recently merged and seemed to work fine but I now noticed strange behavior when it was running in Travis, which I could not reproduce locally. It turns out `TRAVIS_COMMIT_RANGE` which is used in Travis to get the commits for the linter, uses all the commits that were in a push, which includes all rebase commits for example. This means that the linter can fail on a commit that the developer has never even seen before, which can be very confusing. See an example here which caused me to look into this: https://travis-ci.org/github/bitcoin/bitcoin/jobs/714296381 The commit that is reported as failing in my PR is not part of my PR.

  I think we rather want to use something like `git merge-base` to get the commit range by default and in Travis. I am leaving the env variable functionality in place with a different name but this is not a variable that can be expected to be present in the CI environments so the `merge-base` range should be used there by default.

ACKs for top commit:
  hebasto:
    ACK 72351784b3df21a89f79076f4b814a6e700b6469, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: afb27bb386855cb8d5cf84fd3a6c11ef1160b25af6175ed0aa146bf04b9a26eb77298df70df0a855f8c46f19f08b3f62c49872c12974fcfa5526a15ee05b3c10
2021-07-15 19:30:07 -05:00
MarcoFalke
7a92af887d Merge #19439: script: Linter to check commit message formatting
284a969cc082ae3c63ab523f22e71da86ad4ab20 Linter to check commit message formatting (Amir Ghorbanian)

Pull request description:

  Write linter to check that commit messages have a new line before the body or no body at all. fixes issue #19091.

ACKs for top commit:
  troygiorshev:
    ACK 284a969cc082ae3c63ab523f22e71da86ad4ab20 Reviewed, manually tested. Works great!
  fjahr:
    tested ACK 284a969cc082ae3c63ab523f22e71da86ad4ab20
  adamjonas:
    utACK 284a969cc082ae3c63ab523f22e71da86ad4ab20

Tree-SHA512: fa278f090780b54e4fa6e2967a62b4c1a4da55d112ec1ad6dd7e1181ac490c5c1af0165524b5781b463fdd6d0f79fd3d95b5160184e6eca432ccff1189f77390
2021-07-15 19:30:07 -05:00
UdjinM6
d0385cc04d
Merge pull request #4251 from PastaPastaPasta/backport-triv-pr12
backport: 'trivial' pr12
2021-07-16 02:01:43 +03:00
MarcoFalke
106e69f979 Merge bitcoin/bitcoin#22103: test: Fix IPv6 check on BSD systems
2be35725069fd4c589497b93e09e1c6db6946372 test: Fix IPv6 check on BSD systems (nthumann)

Pull request description:

  I noticed that `test_ipv6_local()` always returns `False` on macOS or FreeBSD, even though IPv6 is working perfectly fine. This causes `test/functional/rpc_bind.py --ipv6` and `test/functional/feature_proxy.py` to skip their run.
  Apparently, there's a check if the port number is `0` (see [here](64881da478/sys/netinet6/udp6_usrreq.c (L248)) or [here](8f02f2a044/bsd/netinet6/udp6_usrreq.c (L282))), while Linux has no problem with this.
  This is fixed by specifying any other port number than `0`, e.g. `1`. Still, because of `SOCK_DGRAM`, no actual connection is made.

ACKs for top commit:
  fanquake:
    ACK 2be35725069fd4c589497b93e09e1c6db6946372 - nice improvement. I checked that with this change ipv6 related tests in `feature_proxy.py` are being run.
  theStack:
    ACK 2be35725069fd4c589497b93e09e1c6db6946372

Tree-SHA512: 8417c2d3cf71050529f3fa409a03872040fe5d249eae4172f276e62156e505a20d375b963712a186c9ad7967d8a497b5900d327c74a9693f68c33063871d4691
2021-07-15 16:01:43 -05:00
Kittywhiskers Van Gogh
da33c9619c
partial merge #17398: Update leveldb to 1.22+ (#4230)
* Update to leveldb upstream using subtree merge

* Import crc32c using subtree merge as as 'src/crc32c'

* build: Update build system for new leveldb

Upstream leveldb switched build systems, which means we need to define
a few different values.

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* doc: Add crc32c subtree to developer notes

* test: Add crc32c to subtree check linter

* test: Add crc32c exception to various linters and generation scripts

* build: Add LCOV exception for crc32c

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* build: CRC32C build system integration

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-07-15 15:42:55 -05:00
MarcoFalke
8c1a763ccc Merge #18866: test: Fix verack race to avoid intermittent test failures
fae153b40968bfd974a4709bcd841a59447abf18 test: Fix verack race to avoid intermittent test failures (MarcoFalke)

Pull request description:

  Fixes #18832

ACKs for top commit:
  laanwj:
    ACK fae153b40968bfd974a4709bcd841a59447abf18

Tree-SHA512: 071de8c8e2b2787c9433c7460e18b9a54beaf471a52ce848c5ac7263fc2a40f5b976d4f558ecc494fd0fa07284b7c98d29267cade58f80ab74fe9a7d18d94298
2021-07-15 13:26:07 -05:00
UdjinM6
07e7be34d2
Merge pull request #4250 from PastaPastaPasta/backport-triv-pr11
backport: 'trivial' pr11
2021-07-15 20:34:04 +03:00
fanquake
037fa2dd14 Merge #17893: qa: Fix double-negative arg test
8b2f471a1bff753cc4df29805ef38c3623f64f6e qa: Fix double-negative arg test (Hennadii Stepanov)

Pull request description:

  Commit 67518f7cc61bf59ddfa0fd7c8dbbdec3653b9556 tests do not catch that a pointer is returned instead of a value.

  This PR makes test to not accept trailing characters after 0.

  From [IRC](http://www.erisian.com.au/bitcoin-core-dev/log-2020-01-07.html#l-358):
  >  \<hebasto\> ryanofsky: hmm, why test/functional/feature_config_args.py passed on 67518f7cc61bf59ddfa0fd7c8dbbdec3653b9556 ?
  >  \<hebasto\> I see now: test is broken.
  >  \<ryanofsky\> test should be unaffected by that change, do you see a break somewhere?
  >  \<hebasto\> yes: "-connect=0x7fff50369968" != "-connect=0"
  > ...
  >  \<ryanofsky\> Oh I see how that would happen, it should not be a problem in the current PR.
  >  \<hebasto\> going to submit a pr to fix test
  >  \<ryanofsky\> in the commit you mentioned, value is a pointer to a string, and it was printing the pointer address instead of the string on: LogPrintf("Warning: parsed potentially confusing double-negative -%s=%s\n", key, value);
  >  \<hebasto\> correct
  >  \<ryanofsky\> oh I see, test could be fixed to more robust and not accept trailing characters after 0

ACKs for top commit:
  ryanofsky:
    Code review ACK 8b2f471a1bff753cc4df29805ef38c3623f64f6e. I don't know how you found this but it's a nice catch! This change should make the test more reliable.

Tree-SHA512: 454b3d4415771d353a2da766f6ae6e0bfae7bdf485aaa7bfdd323595282356eeaf3f40e556b39f753bc35f578cbe9684368887eef2d63c5d7f0d7d9fa971697a
2021-07-15 11:07:36 -05:00
fanquake
89af1a9f1e Merge #17532: test: add functional test for non-standard txs with too large scriptSig
8f2d7737cc236b6122f30e31856eb3181960fba1 test: add functional test for non-standard txs with too large scriptSig (Sebastian Falbesoner)

Pull request description:

  Approaches another missing functional test of issue #17394 (counterpart to unit test in PR #17480, Commit 5e8a56348b): A transaction is rejected by the mempool with reason `"scriptsig-size"` if any of the inputs' scriptSig is larger than 1650 bytes.

ACKs for top commit:
  MarcoFalke:
    ACK 8f2d7737cc236b6122f30e31856eb3181960fba1
  instagibbs:
    ACK 8f2d7737cc

Tree-SHA512: 7a45b8a4181158be3e3b91756783ddf032f132ca8780dc35fac91b2df2149268f784d28ac56005135c4d86a357c57805c5a54b8155f0d049932844b18dc03992
2021-07-15 11:07:17 -05:00
Wladimir J. van der Laan
7d66e6647b
Merge #14356: fix converttopsbt permitsigdata arg, add basic test
88a79cb436b30b39d37d139da723f5a31e9d161b fix converttopsbt permitsigdata arg, add basic test (Gregory Sanders)

Pull request description:

  The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior.

  Resolves https://github.com/bitcoin/bitcoin/issues/14355

Tree-SHA512: 5157a74b8ddebd7d836fba96765c4d7ed15a73d4289817353d3566a0f6803bd4bbc3f936735c517c7a83a6cbdb4052b9c61d23f6cc4ad00a6077278cd51adbd4
2021-07-15 04:52:38 +03:00
Kittywhiskers Van Gogh
931a88e2fd Merge #12196: Add scantxoutset RPC method 2021-07-14 10:11:17 +05:30
MarcoFalke
9156e07334 Merge #18350: test: Fix mining to an invalid target + ensure that a new block has the correct hash internally
7a6627ae87b637bf32c03122865402bd71adf0d1 Fix mining to an invalid target + ensure that a new block has the correct hash internally in Python tests (Samer Afach)

Pull request description:

  Test with block 47 in the `feature_block.py` creates a block with a hash higher than the target, which is supposed to fail. Now two issues exist there, and both have low probability of showing up:

  1. The creation is done with `while (hash < target)`, which is wrong, because hash = target is a valid mined value based on the code in the function `CheckProofOfWork()` that validates the mining target:
  ```
      if (UintToArith256(hash) > bnTarget)
          return false;
  ```
  2. As we know the hash stored in CBlock class in Python is stateful, unlike how it's in C++, where calling `CBlock::GetHash()` will actively calculate the hash and not cache it anywhere. With this, blocks that come out of the method `next_block` can have incorrect hash value when `solve=False`. This is because the `next_block` is mostly used with `solve=True`, and solving does call the function `rehash()` which calculates the hash of the block, but with `solve=False`, nothing calls that method. And since the work to be done in regtests is very low, the probably of this problem showing up is very low, but it practically happens (well, with much higher probability compared to issue No. 1 above).

  This PR fixes both these issues.

Top commit has no ACKs.

Tree-SHA512: f3b54d18f5073d6f1c26eab89bfec78620dda4ac1e4dde4f1d69543f1b85a7989d64c907e091db63f3f062408f5ed1e111018b842819ba1a5f8348c7b01ade96
2021-07-13 21:19:47 -05:00
MarcoFalke
6a0627d073 Merge #18172: test: Transaction expiry from mempool
d6d2602a32251c1017da88b47c801b7283c66ce3 add: test that transactions expire from mempool (0xb10c)

Pull request description:

  This adds the functional test `mempool_expiry.py` covering mempool transaction expiry. Both the default `DEFAULT_MEMPOOL_EXPIRY` of 336 hours (two weeks, set in #9312) and the user definable mempool expiry via the `-mempoolexpiry=<n>` command line option are tested. The test checks that descendants of expired transactions are removed as well.

  *Notes for reviewers*
  - `LimitMempoolSize()` (which is the only caller of `CTxMemPool::Expire()`) is only called when a transaction is added to the mempool. In order to test expiry of a transaction-that-should-expire, the mocktime is set and a random transaction is broadcast to trigger `LimitMempoolSize()`. The transaction-that-should-expire is then checked for expiry. LMK if there is another way, but I don't think there is.

ACKs for top commit:
  MarcoFalke:
    ACK d6d2602a32251c1017da88b47c801b7283c66ce3
  theStack:
    ACK d6d2602a32
  promag:
    Code review ACK d6d2602a32251c1017da88b47c801b7283c66ce3.

Tree-SHA512: eb68cd9e2d870872b8e8e1522fed8954fb99cc9e4edda4b28bb2a4e41cddbc53fe6f7d9c090f1e0e98ab49beb24bf37ff3787a9e9801a95e8ae9ca9eb34fe6f0
2021-07-13 21:19:43 -05:00
Wladimir J. van der Laan
a426a8b2e6 Merge #18056: ci: Check for submodules
2a95c7c95690112a03b14ccb0fb8f66db12cb75b ci: Check for submodules (Emil Engler)

Pull request description:

  See #18019.
  The current solution looks like this (I also tested with multiple submodules):
  ```
  These submodules were found, delete them:
   355a5a310019659d9bf6818d2fd66fbb214dfed7 curl (curl-7_68_0-108-g355a5a310)
  ```
  The submodule example command was `git submodule add https://github.com/curl/curl.git curl`

ACKs for top commit:
  laanwj:
    ACK 2a95c7c95690112a03b14ccb0fb8f66db12cb75b

Tree-SHA512: 64bf388123f0a88d12e3e41ff29bc190339377a0615c35dc3f2700bb7773470a8fa426e0ff57188a60ed88bded39f75082ff0b73118651ff403b163422395005
2021-07-13 21:17:15 -05:00
fanquake
2747862848 Merge #17329: linter: Strip trailing / in path for git-subtree-check
60582d6060542c1e3a23141ea825e36818fbbd54 [linter] Strip trailing / in path for git-subtree-check (John Newbery)

Pull request description:

  git-subtree-check fails if the directory is given with a trailing slash,
  eg:

  ```
  > test/lint/git-subtree-check.sh src/univalue/
  ERROR: src/univalue/ is not a subtree
  ```

  Shell autocompletes will add the trailing slash when autofilling the
  path name, which will therefore cause the script to fail.

  Just ignore any trailing slash.

ACKs for top commit:
  laanwj:
    ACK 60582d6060542c1e3a23141ea825e36818fbbd54
  dongcarl:
    ACK 60582d6060542c1e3a23141ea825e36818fbbd54
  fanquake:
    ACK 60582d6060542c1e3a23141ea825e36818fbbd54 - tested before and after.

Tree-SHA512: 5a91979b60e1d4b1310fd02a0ccc5465dbff57d9c94bba81e4758442a627cfa32217ab8f973990a17b5d961ecae61fb56b56ccf10f87e61dd03e88a1e0b8f99d
2021-07-13 20:43:16 -05:00
UdjinM6
3004c3498b
Merge pull request #4245 from PastaPastaPasta/backport-triv-pr9
backport: 'trivial' pr9
2021-07-14 02:52:00 +03:00
PastaPastaPasta
e98241da5d
Merge pull request #4186 from kittywhiskers/psbt
merge #13269, #13425,  #13557,  #13721,  #13666, #13723: BIP 174 PSBT Serializations and RPCs
2021-07-13 13:54:34 -05:00
Wladimir J. van der Laan
3d8cb7b430
Merge #17030: test: Fix Python Docstring to include all Args.
8acd58927a614e006641384f61f8e7fca1cc68fc Fix Python Docstring to include all Args. (John Bampton)

Pull request description:

  Found a Python function that had incorrect and missing arguments in its Docstring.

ACKs for top commit:
  laanwj:
    ACK 8acd58927a614e006641384f61f8e7fca1cc68fc

Tree-SHA512: 936f275f29a700d630bb479b5283e47b66f2df76d8b8c053f594e6aedf783cc98a29c924c3a46613f112dfc884acb50f21a0b18f96d939e887b12b921ef2e10f
2021-07-13 13:14:04 -05:00
UdjinM6
90e990e1ac
Merge pull request #4244 from PastaPastaPasta/backport-triv-pr8
backport: 'trivial' pr8
2021-07-13 20:53:57 +03:00
UdjinM6
6aea99094b
Merge pull request #4243 from Munkybooty/backports-0.18-pr7.1
Merge bitcoin#13877: utils: Make fs::path::string() always return utf-8 string on Windows
2021-07-13 20:53:30 +03:00
PastaPastaPasta
48487122ad
Merge pull request #4239 from Munkybooty/backports-0.18-pr7
Backports 0.18 pr7
2021-07-13 11:51:50 -05:00
Kittywhiskers Van Gogh
1a887a0067 tests: adapt PSBT RPC tests for Dash testnet 2021-07-13 22:00:18 +05:30
UdjinM6
fa5956a64d tests: Swap some valid/invalid test cases
Can't spend from segwit but at the same time we do not care about errors in segwit keys (they are unknown to us).
2021-07-13 22:00:18 +05:30
Kittywhiskers Van Gogh
1e15a6116d core: remove all leftover references to segwit/rbf 2021-07-13 22:00:18 +05:30
Kittywhiskers Van Gogh
8b891c2b10 Merge #13723: PSBT key path cleanups 2021-07-13 22:00:18 +05:30
Kittywhiskers Van Gogh
472cfcbf7f Merge #13666: Always create signatures with Low R values 2021-07-13 22:00:18 +05:30
Kittywhiskers Van Gogh
737ccd2de3 Merge #13721: Bugfixes for BIP 174 combining and deserialization 2021-07-13 22:00:18 +05:30
Kittywhiskers Van Gogh
c00b3e942f Merge #13557: BIP 174 PSBT Serializations and RPCs 2021-07-13 22:00:17 +05:30
MarcoFalke
e8c2117b16 Merge #13877: utils: Make fs::path::string() always return utf-8 string on Windows
2c3eade704 Make fs::path::string() always return utf-8 string (Chun Kuan Lee)

Pull request description:

  Imbue `fs::path` with `std::codecvt_utf8_utf16` at `SetupEnvironment()`, so that default string encoding will be utf-8 inside `fs::path`.

Tree-SHA512: 0cb59464d777278decbf24771fc5ff0cb2caa7bc2fe8ee5cd36c97a2324873a3caad131f08f050393b488316ee7f4ab0b28b7fa4699e41839f8e51b9867d5118

# Conflicts:
#	src/qt/guiutil.cpp
2021-07-13 09:51:49 -04:00
Wladimir J. van der Laan
c585c4a792 Merge #13734: gui: Drop boost::scoped_array and use wchar_t API explicitly on Windows
bb6ca65f9890e8280ace32de5a37774e14705859 gui: get special folder in unicode (Chun Kuan Lee)
1c5d22585384c8bb05a27a04eab5c57b31d623fb Drop boost::scoped_array (Chun Kuan Lee)

Pull request description:

  Drop boost::scoped_array and simplify the code.

  `TCHAR` should be defined as `wchar_t` if `UNICODE` is defined. So we can use `.toStdWString().c_str()` to get wchar_t C-style string.

  Fix #13819

Tree-SHA512: 3fd4aa784129c9d1576b01e6ee27faa42d793e152d132f2dde504d917dad3a8e95e065fcbc54a3895d74fb6b2a9ed4f5ec67d893395552f585e225486a84a454

# Conflicts:
#	src/qt/guiutil.cpp
2021-07-12 21:57:11 -04:00
MarcoFalke
d36d5efee5 Merge #16768: test: Make lint-includes.sh work from any directory
490da639cbd48ce0dc438abbfc89ab796391cb2a Make lint-includes.sh work from any directory (Kristaps Kaupe)

Pull request description:

  Before this change it works from root folder of bitcoin git repo, but if you do `cd test/lint; ./test-includes.sh`, you will have a lot of false positive messages like this:
  ```
  Good job! The circular dependency "chainparamsbase -> util/system -> chainparamsbase" is no longer present.
  Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh
  to make sure this circular dependency is not accidentally reintroduced.

  Good job! The circular dependency "index/txindex -> validation -> index/txindex" is no longer present.
  Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh
  to make sure this circular dependency is not accidentally reintroduced.

  ```

Top commit has no ACKs.

Tree-SHA512: 07fa69cb2883181dcee922191acac4b242722eeb2916cdffdc7163421302b22f3c9525aaf4c754a9dba1c307032c05285e38191d5c6aabc894321f8a27bbceaa
2021-07-12 20:52:56 -05:00
Wladimir J. van der Laan
12b5403aa6 Merge #16695: rpc: Add window final block height to getchaintxstats
d48c1e837ae1bd08e0f18ad1b57ff72675c3d6ad Add window final block height to getchaintxstats (Jonathan "Duke" Leto)

Pull request description:

  This patch is motivated by the desire to make the output of `getchaintxstats` more useful and optimized for applications to consume and render the data.

  Firstly, this data is already available to the RPC, no additional work is done. Currently additional RPC calls will be needed to look up the height of the final block in the window or the block height that began the window.

  By adding the block height of the final block in the window, the JSON is "self-contained" and applications can calculate the exact block height range of the window with no additional RPC requests.
  For example, a web application which wants to render historical information for `getchaintxstats` RPC on various window sizes might call the RPC with various window lengths, once per day, and store the JSON results somewhere. Because the final block height of each dataset is included, it's no extra work to determine the exact block window range of each JSON response.

ACKs for top commit:
  promag:
    ACK d48c1e837ae1bd08e0f18ad1b57ff72675c3d6ad.

Tree-SHA512: fd4952c125f81a4ad18f7c78498c6b3e265b93cb574832166ac25596321ce84957f971f3f78f37d7e42638dc65f2a5d4d760f289873c9c2f2a82eb00a0f87c3f
2021-07-12 20:52:56 -05:00
PastaPastaPasta
4258056196 dashification
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-07-12 20:16:37 -05:00
fanquake
db4c8cf41e Merge #15305: [validation] Crash if disconnecting a block fails
a47df13471e3168e2e02023fb20cdf2414141b36 [qa] Test disconnect block failure -> shutdown (Suhas Daftuar)
4433ed0f730cfd60eeba3694ff3c283ce2c0c8ee [validation] Crash if disconnecting a block fails (Suhas Daftuar)

Pull request description:

  If we're unable to disconnect a block during normal operation, then that is a
  failure of our local system (such as disk failure) or the chain that we are on
  (eg CVE-2018-17144), but cannot be due to failure of the (more work) chain that
  we're trying to validate.

  We should abort rather than stay on a less work chain.

  Fixes #14341.

ACKs for top commit:
  practicalswift:
    utACK a47df13471e3168e2e02023fb20cdf2414141b36
  TheBlueMatt:
    utACK a47df13471e3168e2e02023fb20cdf2414141b36. Didn't bother to review the test in detail, it looked fine. Debated whether invalidateblock should ever crash the node, but *not* crashing in the case of hitting a pruned block (which is the only change here) is clearly better, even if there are other cases I'd argue we should crash in.
  ryanofsky:
    utACK a47df13471e3168e2e02023fb20cdf2414141b36. Only change since last review is new comment.
  promag:
    ACK a47df1347, it takes awhile to quit (RPC connection timeouts) but that's unrelated - hope to fix that soon.
  fanquake:
    ACK a47df13471e3168e2e02023fb20cdf2414141b36

Tree-SHA512: 4dec8cef6e7dbbe513c138fc5821a7ceab855e603ece3c16185b51a3830ab7ebbc844a28827bf64e75326f45325991dcb672f13bd7baede53304f27289c4af8d
2021-07-12 20:16:37 -05:00
fanquake
d47df667bd Merge #16374: test: Enable passing wildcard test names to test runner from root
e142ee03e7a139168aa1dbf5910c616f60d25042 doc: describe how to pass wildcard names to test runner (Jon Atack)
6a7a70b8cf05a82737c72020fd2b0eebc97cb5e4 test: enable passing wildcards with path to test runner (Jon Atack)

Pull request description:

  Currently, passing wildcard testname args to the test runner from outside the test/functional/ directory does not work, even though developers expect it to. See these recent IRC discussions for more background: http://www.erisian.com.au/bitcoin-core-dev/log-2019-07-10.html#l-262 (lines 262 to 323) and http://www.erisian.com.au/bitcoin-core-dev/log-2019-07-11.html#l-134.

  1. [BUGFIX] Enable passing wildcards with paths. Examples:
      - `test/functional/test_runner.py test/functional/wallet*`
      - `functional/test_runner.py functional/wallet*`
      - `test/functional/test_runner.py ./test/functional/tool* test/functional/mempool*`
      - A current limitation this PR does not change: 9 test files with arguments in their filename are not picked up by wildcard search.

  2. [Docs] Describe how to pass wildcard names (multiple and with paths) to the test runner in test/README.md.

ACKs for top commit:
  jnewbery:
    tested ACK e142ee03e7a139168aa1dbf5910c616f60d25042
  jachiang:
    Tested ACK e142ee03e7. Thanks a lot for this fix!
  MarcoFalke:
    ACK e142ee03e7a139168aa1dbf5910c616f60d25042, fine with me

Tree-SHA512: cb3d994880cdc9b8918546b573a25faa5b4c7339826ac7cfe20f076aac6e731a34271609c0cf5a7ee5e4a2d5ae205298319d24bf36ef5b5d569a1a0c57883e54
2021-07-12 20:16:37 -05:00
MarcoFalke
1234cea86a Merge #16390: qa: Add --filter option to test_runner.py
1a6242526093424947eb49f3416dc0c6bc9fc3a8 qa: Add --filter option to test_runner.py (João Barbosa)

Pull request description:

  Allows to run functional tests like:
  ```sh
  test/functional/test_runner.py --filter wallet
  ```

ACKs for top commit:
  jonatack:
    ACK 1a6242526093424947eb49f3416dc0c6bc9fc3a8

Tree-SHA512: 53199e01da3b2e0112843c1c68c69d8fd7fc9bb6a6cb45a81c324973c4824ebf5fef574f9efab81a64d52e397e25d979ae40f0eaba35afb771e80012768f0b08
2021-07-12 20:16:37 -05:00
MarcoFalke
6e626934af Merge #15282: test: Replace hard-coded hex tx with class in test framework
8f250ab7882a852f1b1947cef4837d2de5ca6913 TEST: Replace hard-coded hex tx with classes (Steven Roose)

Pull request description:

  Came across these breaking Elements.

ACKs for top commit:
  MarcoFalke:
    ACK 8f250ab7882a852f1b1947cef4837d2de5ca6913
  instagibbs:
    utACK 8f250ab788

Tree-SHA512: e8615dad4cda0beea4b0c7d4951a467fb9882a0a64d49c9b5ecf167369ea62a3fe5348e2401153162b0ccadecdb128492c94be36ebb881c3c42659626d86eda8
2021-07-12 20:16:37 -05:00
MarcoFalke
15b2a8aabf Merge #14215: [qa] Use correct python index slices in example test
9dcb6763fb [qa] Use correct python index slices in example test (Suhas Daftuar)

Pull request description:

  There's an off-by-one in the list indices used in example_test.py.

Tree-SHA512: d75b77c1e0b3931d02dfa043da4cb6fe8e62864a73717ce5c184d9dbeb25579342c6365cc7bbcc7c4382d76a320a528bf3c69107854dfc6fa704133d0ba11012

# Conflicts:
#	test/functional/example_test.py
2021-07-12 11:50:33 -04:00
gabriel-bjg
ee6d2f5b0d
Fix data races in bls_worker and use ctpl_stl queue. (#4240)
Change ctpl implementation to use STL queue & mutex.

Use ctpl synchronized queue instead of boost lockfree queue in bls worker aggregator.

Use smart pointers for memory management of Aggregator and VectorAggregator. With 'delete this;' the objects are prone to data race on the delete operator.

Use smart pointers for memory management of ContributionVerifier.

Pass shared_ptr by value to other threads via worker pool.
2021-07-11 22:25:27 -05:00
UdjinM6
08558d67ee
Merge pull request #4235 from PastaPastaPasta/backport-triv-pr7
backport: 'trivial' pr7
2021-07-10 21:46:25 +03:00
MarcoFalke
038997ff45 Merge #16036: travis: Run all lint scripts even if one fails
f3b90f2e05 Run all lint scripts (Julian Fleischer)

Pull request description:

  The description reads:

  ```
  # This script runs all contrib/devtools/lint-*.sh files, and fails if any exit
  # with a non-zero status code.
  ```

  This runs all scripts and returns with a non-zero exit code if any failed.

ACKs for commit f3b90f:

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

Pull request description:

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

Tree-SHA512: 3a2564c9b8392c2ef13657138fa0ba4a521015e2d53331156d2a07ccc9497fb268f21e8d93b065c5734d25e4aea8f5cf67f07e6ab93b0ec2987d66a136f94bb8
2021-07-10 12:10:51 -05:00
UdjinM6
90266a9465
Merge pull request #4234 from UdjinM6/backports-0.17-pr35
Backports 0.17 pr35
2021-07-10 12:11:49 +03:00
PastaPastaPasta
3bdf9922af
Merge pull request #4223 from Munkybooty/backports-0.18-pr4
Backports 0.18 pr4
2021-07-09 12:10:22 -05:00
UdjinM6
637a8a28fe
Merge pull request #4226 from PastaPastaPasta/backport-triv-pr6
backport: 'trivial' pr6
2021-07-08 23:25:09 +03:00
MarcoFalke
4c2211dd41 Partial merge #13863: travis: move script sections to files in .travis/ subject to shellcheck
414326952c use export LC_ALL=C.UTF-8 (Julian Fleischer)
728c82d029 make script exit if a command fails (Julian Fleischer)
506890b24d move remaining travis build steps into individual files (Julian Fleischer)
272306ea57 number .travis/ script according to build lifecycle and add README to explain (Julian Fleischer)
519e2739cf move lint stage up to resemble travis build ui (Julian Fleischer)
86d34f0e65 abort script in END_FOLD on non-zero exit code (Julian Fleischer)
4f2f88c7b0 move script sections info individual files and comply with shellcheck (Julian Fleischer)

Pull request description:

  This PR is extracted from https://github.com/bitcoin/bitcoin/pull/13816 to make that one easier to review. It follows on https://github.com/bitcoin/bitcoin/pull/13849 and https://github.com/bitcoin/bitcoin/pull/13851

  In here the shell script parts from `travis.yml` are extracted into `.travis/before_install.sh`, `.travis/install.sh`, `.travis/before_script.sh`, `.travis/script.sh`, and `.travis/lint.sh`.

  This has the benefit that `test/lint/lint-shell.sh` will also shellcheck these parts. Also it makes the individual script parts more readable.

Tree-SHA512: c497e1687ceb1c1d795de177d3fc35af908bc8e3f781a871afabdecf031e581d4db229290627249e35ef7c09952bc34884e4734ea91d40f57b4a9efb85bba2e3
2021-07-08 13:09:43 -04:00
MarcoFalke
74fbdc413c
Merge #14930: test: pruning: Check that verifychain can be called when pruned
fa3e874d69 test: pruning: Check that verifychain can be called when pruned (MarcoFalke)

Pull request description:

Tree-SHA512: b921e550fdad27b791665883ed9fc50210575b0f968840a45284ad0e060ddd443ea7b9b12c17916f68ad28877c58ac51a6acc76ae4ea71bf7bfb2f744b286884
2021-07-08 11:57:16 -05:00
MarcoFalke
f10236c2bd
Merge #14960: lint/format-strings: Correctly exclude escaped percent symbols
57281199b8 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
2021-07-08 11:57:15 -05:00
MarcoFalke
ae56cb67ae
Merge #14931: test: mempool_persist: Verify prioritization is dumped correctly
fa30a0e7f7 test: mempool_persist: Verify prioritization is dumped correctly (MarcoFalke)

Pull request description:

Tree-SHA512: ef39c470cd418443741b55e9765ee84e0a87a44e7756f88dea86df9b4d37a121a4fbcb97976fbe4693692691650fb1196093b7dadd3922359eb4720845d28f05
2021-07-08 11:57:14 -05:00
MarcoFalke
81f9d7500e
Merge #14795: test: allows test_runner command line to receive parameters for each test
5c40e7b91a test: allows test_runner command line to receive parameters for each test (marcoagner)

Pull request description:

  Fixes #14791.
  Seems to address the asked behaviour in a simple way, but could address more if a more complex behaviour is found to be needed (e.g. call `rpc_bind --ipv4` without the ".py" and have it added).

Tree-SHA512: d7e21dd0ada36dd97dac71196bb97702a92986b181beb3753e37e3294b899fb65129aff5f9a45fe92b06fbf7c74e605ccb87a422f874f7a85d30401f4c2228c8
2021-07-08 11:57:12 -05:00
Wladimir J. van der Laan
7214b034eb Merge #14128: lint: Make sure we read the command line inputs using utf-8 decoding in python
5d62dcf9cfb5c0b2511c10667ed47ec3b3610d72 lint: Make sure we read the command line inputs using utf-8 decoding in python (Chun Kuan Lee)

Pull request description:

  Make sure we read the command line inputs using utf-8 decoding in python

  occurred from travis cron job:

  contrib/verify-commits/verify-commits.py should run with utf-8, otherwise it would raise UnicodeDecodeError
  `UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 744: ordinal not in range(128)`

Tree-SHA512: 90e4ad57fdbbbecb0a21fc2d2b03a04f5ef125e54124719ef36e5a85326930b732b47534757a7c3a8730096f3947b009ec898191928b5c2d38f9f4b3e37db48d

# Conflicts:
#	contrib/devtools/optimize-pngs.py
2021-07-07 12:04:53 -04:00
MarcoFalke
9f4f52ae4e
Merge #13054: tests: Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports.
68400d8b96 tests: Use explicit imports (practicalswift)

Pull request description:

  Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports.

  Wildcard imports make it unclear which names are present in the namespace, confusing both readers and many automated tools.

  An additional benefit of not using wildcard imports in tests scripts is that readers of a test script then can infer the rough testing scope just by looking at the imports.

  Before this commit:

  ```
  $ contrib/devtools/lint-python.sh | head -10
  ./test/functional/feature_rbf.py:8:1: F403 'from test_framework.util import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:9:1: F403 'from test_framework.script import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:10:1: F403 'from test_framework.mininode import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:15:12: F405 bytes_to_hex_str may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:17:58: F405 CScript may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:25:13: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:26:31: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:26:60: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:30:41: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:30:68: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  $
  ```

  After this commit:

  ```
  $ contrib/devtools/lint-python.sh | head -10
  $
  ```

Tree-SHA512: 3f826d39cffb6438388e5efcb20a9622ff8238247e882d68f7b38609877421b2a8e10e9229575f8eb6a8fa42dec4256986692e92922c86171f750a0e887438d9
2021-07-06 20:29:33 +03:00
MarcoFalke
7f46a29dee
Merge #10704: [tests] nits in dbcrash.py
27c63dc [tests] nits in dbcrash.py (John Newbery)

Tree-SHA512: 2a75feeb65e6147e3337200cde982248bea8977a9585d5ee284d62bbc25f6d7c368754da0083aec37338c8f66cf698ee25bbd9e192df14a9fb976b8f75afa986
2021-07-06 20:29:33 +03:00
MarcoFalke
ae4f7f4d08
Merge #13918: rpc: Replace median fee rate with feerate percentiles in getblockstats
4b7091a842 Replace median fee rate with feerate percentiles (Marcin Jachymiak)

Pull request description:

  Currently,  the `medianfeerate` statistic is calculated from the feerate of the middle transaction of a list of transactions sorted by feerate.

  This PR instead uses the value of the 50th percentile weight unit in the block, and also calculates the feerate at the 10th, 25th, 75th, and 90th percentiles.  This more accurately corresponds with what is generally meant by median feerate.

Tree-SHA512: 59255e243df90d7afbe69839408c58c9723884b8ab82c66dc24a769e89c6d539db1905374a3f025ff28272fb25a0b90e92d8101103e39a6d9c0d60423a596714
2021-07-06 20:29:32 +03:00
Wladimir J. van der Laan
90154c6074
Merge #13666: Always create signatures with Low R values
e306be742932d4ea5aca0ea4768e54b2fc3dc6a0 Use 72 byte dummy signatures when watching only inputs may be used (Andrew Chow)
48b1473c898129a99212e2db36c61cf93625ea17 Use 71 byte signature for DUMMY_SIGNATURE_CREATOR (Andrew Chow)
18dfea0dd082af18dfb02981b7ee1cd44d514388 Always create 70 byte signatures with low R values (Andrew Chow)

Pull request description:

  When creating signatures for transactions, always make one which has a 32 byte or smaller R and 32 byte or smaller S value. This results in signatures that are always less than 71 bytes (32 byte R + 32 byte S + 6 bytes DER + 1 byte sighash) with low R values. In most cases, the signature will be 71 bytes.

  Because R is not mutable in the same way that S is, a low R value can only be found by trying different nonces. RFC 6979 for deterministic nonce generation has the option to specify additional entropy, so we simply use that and add a uin32_t counter which we increment in order to try different nonces. Nonces are sill deterministically generated as the nonce used will the be the first one where the counter results in a nonce that results in a low R value. Because different nonces need to be tried, time to produce a signature does increase. On average, it takes twice as long to make a signature as two signatures need to be created, on average, to find one with a low R.

  Having a fixed size signature makes size calculations easier and also saves half a byte of transaction size, on average.

  DUMMY_SIGNATURE_CREATOR has been modified to produce 71 byte dummy signatures instead of 72 byte signatures.

Tree-SHA512: 3cd791505126ce92da7c631856a97ba0b59e87d9c132feff6e0eef1dc47768e81fbb38bfbe970371bedf9714b7f61a13a5fe9f30f962c81734092a4d19a4ef33
2021-07-06 20:29:32 +03:00
Wladimir J. van der Laan
aaf5235b78
Merge #13944: test: Port usage of deprecated optparse module to argparse module
5654efb187d24eb29a343c720e3937b01457c8b7 Ported usage of deprecated optparse module to argparse module (Kvaciral)

Pull request description:

  The optparse module is deprecated since Python 2,7/3.2 . Recommend usage of the argparse module which improves upon optparse.

Tree-SHA512: ffd0e3e6f3babef1675226b107eeb7a6bab6e5199de572703da9d94e1f69c70d1c9abc353e9664b40670bb4976c06964bb2606deee52f5dfcc619f336ceb8cf8
2021-07-06 20:29:32 +03:00
MarcoFalke
2972dbb951
Merge #13867: qa: Make extended tests pass on native Windows
fafe73a626 qa: Raise feature_help timeout to 5s (MarcoFalke)
faabd7bc47 qa: Use files for stdout/stderr to support Windows (MarcoFalke)
facb56ffaf qa: Run gen_rpcauth with sys.executable (MarcoFalke)
fada8966c5 qa: Close stdout and stderr file when node stops (MarcoFalke)

Pull request description:

  ### qa: Close stdout and stderr file when node stops

  Since these files are potentially deleted by the test framework for cleanup, they should be closed first. Otherwise this will lead to errors on Windows when the tests finish successfully.

  Side note: After the patch, it is no longer possible to reopen the file on Windows (see https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile)

  ### qa: Run gen_rpcauth with sys.executable

  Similar to `test_runner.py`, the `sys.executable` needs to be passed down into subprocesses to pass on native Windows. (Should have no effect on Linux)

  ###   qa: Use files for stdout/stderr to support Windows

  It seems that using PIPE is not supported on Windows. Also, it is easier to just use the files that capture the stdout and stderr within the test node class.

Tree-SHA512: ec675012b10705978606b7fcbdb287c39a8e6e3732aae2fa4041d963a3c6993c6eac6a9a3cbd5479514e7d8017fe74c12235d1ed6fed2e8af8f3c71981e91864
2021-07-06 20:29:31 +03:00
MarcoFalke
290a23a9e4
Merge #13915: [qa] Add test for max number of entries in locator
fa85c985ed qa: Add p2p_invalid_locator test (MarcoFalke)

Pull request description:

  Should not be merged *before* #13907

Tree-SHA512: a67ca407854c421ed20a184d0b0dc90085aed3e3431d9652a107fa3022244767e67f67e50449b7e95721f56906836b134615875f28a21e8a012eb22cfe6a66a5
2021-07-06 20:29:31 +03:00
MarcoFalke
20e1f4a8ef
Merge #13669: Tests: Cleanup create_transaction implementations
44bbceeef1 [Tests] Cleanup feature_block.py, remove unnecessary PreviousSpendableOutput object (Conor Scott)
736f941424 [Tests] Cleanup extra instances of create_transaction (Conor Scott)
157651855f [Tests] Rename create_tx and move to blocktools.py (Conor Scott)

Pull request description:

  There currently exist seven ([1](https://github.com/bitcoin/bitcoin/blob/master/test/functional/feature_cltv.py#L52-L60), [2](https://github.com/bitcoin/bitcoin/blob/master/test/functional/feature_csv_activation.py#L88-L95) [3](https://github.com/bitcoin/bitcoin/blob/master/test/functional/feature_dersig.py#L40-L48), [4](https://github.com/bitcoin/bitcoin/blob/master/test/functional/feature_nulldummy.py#L100-L108), [5](https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/util.py#L529-L535), [6](https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/blocktools.py#L120-L129), [7](https://github.com/bitcoin/bitcoin/blob/master/test/functional/feature_block.py#L1218-L1220)) implementations of a function called something similar to `create_transaction` in the functional tests, some of which are exact copies of each other.

  This PR aims to clean this up into [three different cases implemented in blocktools.py](https://github.com/conscott/bitcoin/blob/create_tx_cleanup/test/functional/test_framework/blocktools.py#L121-L149)
  1. `create_tx_with_script`: Return transaction object spending generic tx output optionally specifying scriptSig and scriptPubKey
  2. `create_transaction`: Return transaction object spending coinbase tx
  2. `create_raw_transaction`: Return raw transaction (hex string) spending coinbase tx

  I am not committed to any of these function names, so I'll gladly take suggestions on there.

  Additionally there are some related cleanups to feature_block.py tests, specifically removing the [PreviousSpendableOutput](https://github.com/conscott/bitcoin/blob/master/test/functional/feature_block.py#L51-L54) object, which seems like an unnecessary layer given that every instance spends the 0 output.

Tree-SHA512: 63c6233b6f0942c81ba1ca67ea6770809b8c9409314c6d4cf8e5a3991cb9ee92b22bebe88c0dde45cd71e754eb351230c4c404b70ff118f5f43c034452ada65c
2021-07-06 20:29:31 +03:00
MarcoFalke
e1497f67b2
Merge #13916: qa: wait_for_verack by default
fa5587fe71 qa: wait_for_verack by default (MarcoFalke)

Pull request description:

  This removes the need to do so manually every time a connection is added.

Tree-SHA512: a46c92cb4df41e30778b42b9fd3dcbd8d2d82aa7503d1213cb1c1165034f648d8caee01c292e2d87d05b0f71696996eef5be8a753f35ab49e5f66b0e3bf29f21
2021-07-06 20:29:31 +03:00
Kittywhiskers Van Gogh
b5db3c3d65 merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
UdjinM6
bc09637998
Merge pull request #4225 from PastaPastaPasta/backport-triv-pr5
backport: 'trivial' pr5
2021-07-04 00:07:27 +03:00
MarcoFalke
d227d814a3 Merge #14619: tests: Fix value display name in test_runner help text
5a05aa2db2 Add metavar to match var name in help text + Change wording for better readability (Martin Erlandsson)

Pull request description:

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

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

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

  ---

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

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

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

Pull request description:

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

Pull request description:

  Fix a comment that was false

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

Pull request description:

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

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

  Fixes #14452.

Tree-SHA512: 311e839234f5fb7955ab5412a2cfc1903ee7132ea56a8ab992ede3614586834886bd65192b76531ae0aa3a526b38e70ca2e1cdbabe52995906ff97b49d93c268
2021-07-03 13:44:50 -05:00
PastaPastaPasta
df65bd0238
Merge pull request #4224 from Munkybooty/backports-0.18-pr5
Backports 0.18 pr5
2021-07-03 12:33:17 -05:00
UdjinM6
22451a23e4
Merge pull request #4222 from Munkybooty/backports-0.18-pr3
Backports 0.18 pr3
2021-07-03 14:21:16 +03:00
Wladimir J. van der Laan
025a33bb23 Merge #14101: qa: Use named args in validation acceptance tests
fa782a308dbe7bc579c122f63c1c65666fc85e91 qa: Use named args in some tests (MarcoFalke)
b4d33096734d787b0e1d754064039cbb64ce8d61 scripted-diff: Use named arguments in feature_block (MarcoFalke)
749ba35e7c9fbc21dbea27fd1be102b91313d132 scripted-diff: Pass node into p2p_segwit acceptance tests (MarcoFalke)

Pull request description:

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

  Run some scripted diffs to put meaning to them.

Tree-SHA512: d768df2375ea3c77145ebb1bf4c2d690581a379031449ded7ae160022d975eb13890aa8c6a44a5eebda8791cb2910a599326e431af76ed9e60afe1d182ada65c

# Conflicts:
#	test/functional/feature_block.py
#	test/functional/mining_basic.py
#	test/functional/p2p_segwit.py
2021-07-02 11:39:23 -04:00
MarcoFalke
805cda6f5f Merge #13985: [trivial] Fix slightly confusing mispelling in feature_blocksdir.py log message
241f8b5de4 Fix typo in feature_blocksdir.py log message (Alexander Leishman)

Pull request description:

  Typo I came across while writing some new tests.

Tree-SHA512: cc494553125a1e84f9238a14761e3fb76623e98d951811dd3bfb13595a03a1888d73859487a2cbb76c7ae85897bc64016a220a92c2636b35ea6356a5b5340d66

# Conflicts:
#	test/functional/feature_blocksdir.py
2021-07-02 10:38:08 -04:00
Wladimir J. van der Laan
0214211a7f
Merge #13667: wallet: Fix backupwallet for multiwallets
a1a998cf24c0cf1232e44ec8eaf2ad6875ab5153 wallet: Fix backupwallet for multiwallets (Daniel Kraft)

Pull request description:

  `backupwallet` was broken for multiwallets in their own directories (i.e. something like `DATADIR/wallets/mywallet/wallet.dat`).  In this case, the backup would use `DATADIR/wallets/wallet.dat` as source file and not take the specific wallet's directory into account.

  This led to either an error during the backup (if the wrong source file was not present) or would silently back up the wrong wallet; especially the latter behaviour can be quite bad for users.

Tree-SHA512: 7efe2450ca047e40719fcc7cc211ed94699056020ac737cada7b59e8240298675960570c45079add424d0aab520437d5050d956acd695a9c2452dd4317b4d2c4
2021-07-02 12:59:30 +03:00
Wladimir J. van der Laan
37edce56fb
Merge #13859: qa: Add emojis to test_runner path and wallet filename
5e1777777790e855a9f3c8604208bc9bd6c8c99f qa: Create unicode tempdir in test_runner (MarcoFalke)

Pull request description:

  Now that wallet filenames are properly quoted when used for rpc (#13823), we can add some unicode symbols to the test_runner path. Thus, the "extern" wallet that uses a full path has a unicode symbol in its name.

  Should add unicode coverage to
  * `listwallets`
  * `wallet.getwalletinfo`
  * `(un)loadwallet`

Tree-SHA512: 1633fde56f8748df0cfef9c31a878c105dfaac85d1041b292261f44c4d40e96942aacbf7d6e839e8bbf979dc131d81c24ceb521e927fc8a5a71ba093f36b891b
2021-07-02 12:59:29 +03:00
Wladimir J. van der Laan
d33dd31032
Merge #13837: qa: Extract rpc_timewait as test param
fa5b440971a0dfdd64c1b86748a573fcd7dc65d3 qa: Extract rpc_timewait as test param (MarcoFalke)

Pull request description:

  Also increase it for wallet_dump and wallet_groups

Tree-SHA512: 7367bc584228bda3010c453713a1505c54a8ef3d116be47dab9934d30594089dfeb27ffa862f7517fd0ec8b5dc07f4904d67ef2a53dd284cbe2a58982e410e2b
2021-07-02 12:59:29 +03:00
MarcoFalke
4bbf00a6e4
Merge #13805: [wallet] Correctly limit output group size
a13647b8bd [qa] Add test for too-large wallet output groups (Suhas Daftuar)
57ec1c97b2 [wallet] correctly limit output group size (Suhas Daftuar)

Pull request description:

  Also add a test to ensure that output groups are being limited, even if a wallet has many outputs corresponding to the same scriptPubKey (the test fails without the first commit).

Tree-SHA512: 2aaa82005b0910488f5cbf40690d4c5e2f46949e299ef70b4cb6e440713811443d411dcbc6d71b1701fd82423073125e21747787d70830cd021c841afb732d51
2021-07-02 12:59:29 +03:00
MarcoFalke
8f745e57b7
Merge #13799: Ignore unknown config file options; warn instead of error
247d5740d2 Ignore unknown config file options for now (Pieter Wuille)
04ce0d88ca Report when unknown config file options are ignored (Pieter Wuille)

Pull request description:

  As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like `-rpcclienttimeout` which aren't defined for `bitcoind`.

  A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (`bitcoind`, `bitcoin-qt`, `bitcoin-cli`). Both of these seem too invasive to introduce for 0.17.

  As a compromise, this PR makes it ignores those options, but still warn about it in the log file.

Tree-SHA512: dfddc771b91df3031a9c98d9f3292f8f4fcd1b97ebb7317b2f457e12d9f205dc63f42721302e7258dbb53f273d7cc041a65a0a9120972769555784e1f1cc9aef
2021-07-02 12:59:28 +03:00
MarcoFalke
ea58f30a6f
Merge #13747: tests: Skip P2PConnection's is_closing() check when not available
64b9f27e0e Skip is_closing() check when not available. (Daniel Kraft)

Pull request description:

  #13715 introduced a new check for `_transport.is_closing()` in mininode's `P2PConnection`'s.  This function is [only available from Python 3.4.4](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing), though, while Bitcoin Core is supposed to support all Python 3.4 versions.

  In this change, we make the check conditional on `is_closing` being available.  If it is not, then we revert to the behaviour before the check was introduced; this means that #13579 is not fixed for old systems, but at least the tests work as they used to do before.

  This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added.

  Fixes #13745.

Tree-SHA512: 15be03b8b49c40a946c5b354c5974858d14dc46283ad48ee25d9e269377077ce741c6b379b3f6581ab981cb65be799809afbb99da278caaa2d8d870fa4fb748f
2021-07-02 12:59:28 +03:00
MarcoFalke
05142685e9
Merge #13725: Fix bitcoin-cli --version
5b82aa7352 Fix bitcoin-cli --version (Ben Woosley)

Pull request description:

  By declaring the relevant option, as it is in init.cpp

  2dc5ab6378/src/init.cpp (L356)

  Note contrib/devtools/gen-manpages.sh relies on this version information.

Tree-SHA512: 64c1b9635e86fea42b797471f66f784ed0c7ad4d6a454a49eb433018d8936265624fa4edf2f138efe3ff938af61763bd473b7b86d558f5288687b25f59fa87ea
2021-07-02 12:59:28 +03:00
Wladimir J. van der Laan
a9fb8a57ab
Merge #13482: Remove boost::program_options dependency
f447a0a7079619f0d650084df192781cca9fd826 Remove program options from build system (Chun Kuan Lee)
11588c639e8912f1b28e981c1a2a0e4306dbd093 Replace boost program_options (Chun Kuan Lee)

Pull request description:

  Concept from #12744, but without parsing negated options.

Tree-SHA512: 7f418744bb8934e313d77a5f162633746ef5d043de802b9c9cd9f7c1842e7e566eb5f171cd9e2cc13317281b2449c6fbd553fa4f09b837e6af2f5d2b2aabdca2
2021-07-02 12:59:27 +03:00
Wladimir J. van der Laan
74a717d556
Merge #9662: Add createwallet "disableprivatekeys" option: a sane mode for watchonly-wallets
a3fa4d6a6acf19d640a1d5879a00aa1f059e2380 QA: Fix bug in -usecli logic that converts booleans to non-lowercase strings (Jonas Schnelli)
4704e5f074e57782d058404a594a7313cf170cf0 [QA] add createwallet disableprivatekey test (Jonas Schnelli)
c7b8f343e99d9d53ea353ddce9a977f1886caf30 [Qt] Disable creating receive addresses when private keys are disabled (Jonas Schnelli)
2f15c2bc20d583b4c1788da78c9c635c36e03ed0 Add disable privatekeys option to createwallet (Jonas Schnelli)
cebefba0855cee7fbcb9474b34e6779369e8e9ce Add option to disable private keys during internal wallet creation (Jonas Schnelli)
9995a602a639b64a749545b7c3bafbf67f97324f Add facility to store wallet flags (64 bits) (Jonas Schnelli)

Pull request description:

  This mode ('createwallet {"disableprivatekeys": true}') is intended for a sane pure watch-only mode, ideal for a use-case where one likes to use Bitcoin-Core in conjunction with a hardware-wallet or another solutions for cold-storage.

  Since we have support for custom change addresses in `fundrawtransaction`, pure watch-only wallets including coin-selection are possible and do make sense for some use cases.

  This new mode disables all forms of private key generation and ensure that no mix between hot and cold keys are possible.

Tree-SHA512: 3ebe7e8d54c4d4e5f790c348d4c292d456f573960a5b04d69ca5ef43a9217c7e7671761c6968cdc56f9a8bc235f3badd358576651af9f10855a0eb731f3fc508
2021-07-02 12:59:27 +03:00
MarcoFalke
6f3d5a3e1b
Merge #13715: tests: fixes mininode's P2PConnection sending messages on closing transport
ea5340c9d2 tests: fixes mininode's P2PConnection sending messages on closing transport (marcoagner)

Pull request description:

  Fixes #13579.
  I think one possible solution is to check for [`_transport.is_closing()`](https://docs.python.org/3.4/library/asyncio-protocol.html#asyncio.BaseTransport.is_closing) in the lambda before sending a message (compatible with Python 3.4 too). Let me know if I missed any side effects this introduces.

Tree-SHA512: cab46f81dccfec7b4460fda478a617845564520694449a9e85bf8a5f1e75f35f52cafd7c64966712c3d6c29956344d5a9dbad8851424f061eb3748bc621b900b
2021-07-02 12:59:27 +03:00
Wladimir J. van der Laan
c02337e1b0
Merge #13517: qa: Remove need to handle the network thread in tests
fa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd qa: Avoid start/stop of the network thread mid-test (MarcoFalke)

Pull request description:

  This simplifies test writing by removing the need to handle the network thread in tests. E.g. start thread, join thread, restart thread mid-test, adding p2p connections at the "right" time, ...

Tree-SHA512: 533642f12fef5496f1933855edcdab1a7ed901d088d34911749cd0f9e044c8a6cb1f89985ac3a7f41a512943663e4e270a61978f6f072143ae050cd102d4eab8
2021-07-02 12:59:26 +03:00
Wladimir J. van der Laan
aade9c3100 Merge #9332: Let wallet importmulti RPC accept labels for standard scriptPubKeys
98ea64cf232c34d4b1aebe738b3956191667cd76 Let wallet importmulti RPC accept labels for standard scriptPubKeys (Russell Yanofsky)

Pull request description:

  Allow importmulti RPC to apply address labels when importing standard scriptPubKeys. This makes the importmulti RPC less finnicky about import formats and also simpler internally.

Tree-SHA512: 102426b21239f1fa5f38162dc3f4145572caef76e63906afd786b7aff1670d6cd93456f8d85f737588eedc49c11bef2e1e8019b8b2cbf6097c77b3501b0cab1f
2021-07-01 16:54:18 -05:00
Wladimir J. van der Laan
4cd32e43e4
Merge #13235: Break circular dependency: init -> * -> init by extracting shutdown.h
1fabd59e7 Break circular dependency: init -> * -> init by extracting shutdown.h (Ben Woosley)
e62fdfeea Drop unused init.h includes (Ben Woosley)

Pull request description:

  Most includers just wanted to react to pending shutdown.

  This isolates access to `fRequestShutdown` and limits access to the shutdown api functions, including the new `CancelShutdown` for setting it to `false`.

Tree-SHA512: df42f75dfbba163576710e9a67cf1228531fd99d70a2f187bfba0bcc476d6749cf88180a97e66a81bb5b6c3c7f0917de7402d26039ba7b644cb7509b02f7e267
2021-07-02 00:42:18 +03:00
UdjinM6
e6d008d385
Merge pull request #4220 from PastaPastaPasta/backport-triv-pr4
backport: 'trivial' pr4
2021-07-02 00:39:13 +03:00