Commit Graph

893 Commits

Author SHA1 Message Date
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
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
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