Commit graph

18099 commits

Author SHA1 Message Date
Julian Fleischer
519e2739cf move lint stage up to resemble travis build ui
adjust indentation to 2 spaces
2018-08-27 12:23:25 +02:00
Julian Fleischer
86d34f0e65 abort script in END_FOLD on non-zero exit code 2018-08-27 12:23:25 +02:00
Julian Fleischer
4f2f88c7b0 move script sections info individual files and comply with shellcheck 2018-08-27 12:23:25 +02:00
Wladimir J. van der Laan
cb98effc5c
Merge #14031: Make IS_TRIVIALLY_CONSTRUCTIBLE consistent on GCC < 5, don't patch clang
f1640d093f Make IS_TRIVIALLY_CONSTRUCTIBLE consistent on GCC < 5 (Ben Woosley)

Pull request description:

  `std::is_trivially_constructible<T>` is equivalent to `std::is_trivially_default_constructible<T>`
  `std::has_trivial_default_constructor<T>` is the GCC < 5 name for `std::is_trivially_default_constructible<T>`

  https://en.cppreference.com/w/cpp/types/is_default_constructible
  https://www.gnu.org/software/gcc/gcc-5/changes.html

  `std::is_trivial` was also used when compiling with clang, due to clang's use of `__GNUC__`. Test `__clang__`  to target the intended implementations.
  https://stackoverflow.com/a/28166605

  All callers currently only pass one template argument to IS_TRIVIALLY_CONSTRUCTIBLE, with this change the build would fail if someone attempted passing more.

Tree-SHA512: 3e36ddf20a1c0d76ad94d7c95f3fe5b90f4ee00389d5516b35c657136205e7a3ddff60789b0b0b2375624631f15a51eaad3570ef19a7b9df1469a50ba28415d1
2018-08-27 12:00:21 +02:00
Wladimir J. van der Laan
0ae15bd05f
Merge #14036: travis: Run unit tests --with-sanitizers=undefined
fad8afa388 travis: Run unit tests --with-sanitizers=undefined (MarcoFalke)
0d00fd5901 depends: allow CC/CXX to be overridden during configure (Cory Fields)

Pull request description:

  See issue #12691

Tree-SHA512: 0772e8e037411cb4664270945a0fc9c0c1ed24eeaf5308460baee707868f7b700d8e740a6babb1d02bc818a8a4b71d9e33601ab2cc850ff315755fcf3d79d29e
2018-08-27 11:07:58 +02:00
Wladimir J. van der Laan
deed63f6fb
Merge #14056: Docs: Fix help message typo optiona -> optional
7d0a8ad310 Docs: Fix help message typo optiona -> optional (Ben Woosley)

Pull request description:

Tree-SHA512: 1812b45d912769f11280e3f72d7c8bd273f6d151797d5d32d21cd5a3bbe8725515406494291953be7a9afc02a2cef23bed1930ac3638f8118c0d8346ee8d6332
2018-08-27 10:48:35 +02:00
MarcoFalke
e8061831e8
Merge #14071: qa: Stop txindex thread before calling destructor
faf4a9b674 qa: Stop txindex thread before calling destructor (MarcoFalke)

Pull request description:

  Same as #13894, but for the tests.

Tree-SHA512: a21d9f8ad8dc9703217d1808cb14bd969903c364fe30bbdc0dd2df170ddc0cbaba98b0bde28bc21ff1319222aaf6cb4f1b2c45cd6b236fe3c645a92eab6bacba
2018-08-26 22:04:32 -04:00
MarcoFalke
427253cf7e
Merge #14062: build: generate MSVC project files via python script
0b16f679d5 auto generate MSVC project files (Chun Kuan Lee)

Pull request description:

  The reason that I move from original `*.vcxproj` to template `*.vcxproj.in` file:
  - There are many developers does not know how to edit .vcxproj file
  - To keep consistency, don't need to edit file at two different places

  Now the devs do not have to update two seperate files.

Tree-SHA512: ab06dbec588cab57f16c1993ea80ed25a49b0b129884634512a8bcd8a21a1a55d38636922489bcf9120d504cfc2cbe4d2b888a217c4e65a50555b41fcd3b7004
2018-08-26 12:40:46 -04:00
Chun Kuan Lee
0b16f679d5 auto generate MSVC project files 2018-08-26 23:54:26 +08:00
MarcoFalke
fad8afa388
travis: Run unit tests --with-sanitizers=undefined 2018-08-26 10:57:39 -04:00
Wladimir J. van der Laan
c775dc4a94
Merge #12254: BIP 158: Compact Block Filters for Light Clients
254c85b687 bench: Benchmark GCS filter creation and matching. (Jim Posen)
f33b717a85 blockfilter: Optimization on compilers with int128 support. (Jim Posen)
97b64d67da blockfilter: Unit test against BIP 158 test vectors. (Jim Posen)
a4afb9cadb blockfilter: Additional helper methods to compute hash and header. (Jim Posen)
cd09c7925b blockfilter: Serialization methods on BlockFilter. (Jim Posen)
c1855f6052 blockfilter: Construction of basic block filters. (Jim Posen)
53e7874e07 blockfilter: Simple test for GCSFilter construction and Match. (Jim Posen)
558c536e35 blockfilter: Implement GCSFilter Match methods. (Jim Posen)
cf70b55005 blockfilter: Implement GCSFilter constructors. (Jim Posen)
c454f0ac63 blockfilter: Declare GCSFilter class for BIP 158 impl. (Jim Posen)
9b622dc722 streams: Unit tests for BitStreamReader and BitStreamWriter. (Jim Posen)
fe943f99bf streams: Implement BitStreamReader/Writer classes. (Jim Posen)
87f2d9ee43 streams: Unit test for VectorReader class. (Jim Posen)
947133dec9 streams: Create VectorReader stream interface for vectors. (Jim Posen)

Pull request description:

  This implements the compact block filter construction in [BIP 158](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki). The code is not used anywhere in the Bitcoin Core code base yet. The next step towards [BIP 157](https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki) support would be to create an indexing module similar to `TxIndex` that constructs the basic and extended filters for each validated block.

  ### Filter Sizes

  [Here](https://gateway.ipfs.io/ipfs/QmRqaAAQZ5ZX5eqxP7J2R1MzFrc2WDdKSWJEKtQzyawqog) is a CSV of filter sizes for blocks in the main chain.

  As you can see below, the ratio of filter size to block size drops after the first ~150,000 blocks:

  ![filter_sizes](https://user-images.githubusercontent.com/881253/42900589-299772d4-8a7e-11e8-886d-0d4f3f4fbe44.png)

  The reason for the relatively large filter sizes is that Golomb-coded sets only achieve good compression with a sufficient number of elements. Empirically, the average element size with 100 elements is 14% larger than with 10,000 elements.

  The ratio of filter size to block size is computed without witness data for basic filters. Here is a summary table of filter size ratios *for blocks after height 150,000*:

  | Stat | Filter Type |
  |-------|--------------|
  | Weighted Size Ratio Mean | 0.0198 |
  | Size Ratio Mean | 0.0224 |
  | Size Ratio Std Deviation | 0.0202 |
  | Mean Element Size (bits) | 21.145 |
  | Approx Theoretical Min Element Size (bits) | 21.025 |

Tree-SHA512: 2d045fbfc3fc45490ecb9b08d2f7e4dbbe7cd8c1c939f06bbdb8e8aacfe4c495cdb67c820e52520baebbf8a8305a0efd8e59d3fa8e367574a4b830509a39223f
2018-08-26 16:57:05 +02:00
MarcoFalke
1117283543
Merge #14069: qa: Use assert not BOOST_CHECK_* from multithreaded tests
737670c036 Use assert when running from multithreaded code as BOOST_CHECK_* are not thread safe (Jesse Cohen)

Pull request description:

  Resolves thread sanitizer failure @MarcoFalke found in #14058

Tree-SHA512: 24d86c2cdae21fee029ee4b06f633de4b3e655d3371d97f09db6fd3f24b29388a78110996712249c49e7fefa7bbc3d3c405d8b480382174831fe2f9a042a557e
2018-08-26 10:29:30 -04:00
MarcoFalke
faf4a9b674
qa: Stop txindex thread before calling destructor 2018-08-26 10:18:06 -04:00
Jesse Cohen
737670c036 Use assert when running from multithreaded code as BOOST_CHECK_* are not thread safe 2018-08-26 09:41:57 -04:00
MarcoFalke
683838b7e4
Merge #14063: Move cs_main locking annotations from .cpp to .h
9e2de6b9d0 Move cs_main locking annotations from .cpp to .h (practicalswift)

Pull request description:

  Move `cs_main` locking annotations from `.cpp` to `.h`.

Tree-SHA512: 591bdc408a7a04c8208530fb6992b7535f30d2473e6c33fe39920330319a40e8dfb40407f2ea2d4c6c0d4624c24e34ffbdf57271b332e82f98339792372be84e
2018-08-26 06:38:03 -04:00
practicalswift
9e2de6b9d0 Move cs_main locking annotations from .cpp to .h 2018-08-26 11:15:17 +02:00
MarcoFalke
91186e5984
Merge #13083: Add compile time checking for cs_main runtime locking assertions
9e0a514112 Add compile time checking for all cs_main runtime locking assertions (practicalswift)

Pull request description:

  Add compile time checking for `cs_main` runtime locking assertions.

  This PR is a subset of #12665. The PR was broken up to make reviewing easier.

  The intention is that literally all `EXCLUSIVE_LOCKS_REQUIRED`/`LOCKS_EXCLUDED`:s added in this PR should follow either directly or indirectly from `AssertLockHeld(…)`/`AssertLockNotHeld(…)`:s already existing in the repo.

  Consider the case where function `A(…)` contains `AssertLockHeld(cs_foo)` (without
  first locking `cs_foo` in `A`), and that `B(…)` calls `A(…)` (without first locking `cs_main`):
  * It _directly_ follows that: `A(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation.
  * It _indirectly_ follows that: `B(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation.

Tree-SHA512: 120e7410c4c223dbc7d42030b1a19e328d01a55f041bb6fb5eaac10ac35cb0c5d469b9b3bda6444731164c73b88ac6495a00890672b107d9305e891571f64dd6
2018-08-25 18:31:29 -04:00
practicalswift
9e0a514112 Add compile time checking for all cs_main runtime locking assertions 2018-08-26 00:25:28 +02:00
Wladimir J. van der Laan
6516b36731
Merge #12676: Show "bip125-replaceable" flag, when retrieving mempool entries
870bd4c73d Update functional RBF test to check replaceable flag (dexX7)
820d31f95f Add "bip125-replaceable" flag to mempool RPCs (dexX7)

Pull request description:

  This pull request adds a flag "bip125-replaceable" to the mempool RPCs getrawmempool, getmempoolentry, getmempoolancestors and getmempooldescendants, which indicates whether an unconfirmed transaction might be replaced.

  Initially the flag was added to the raw transaction RPCs, but thanks to @conscott, it was moved to the mempool RPCs, which actually have access to the mempool.

  ~~This pull request adds a flag "bip125-replaceable" to the RPCs "getrawtransaction" and "decoderawtransaction", which indicates, whether a transaction signals BIP 125 replaceability.~~

  There was some discussion in #7817, whether showing replaceability in the UI could lead to the false assumption that transactions that don't signal BIP 125 are truely non-replaceable, but given that this PR tackles the raw transaction interface, which is a rather low level tool, I believe having this extra piece of information isn't bad.

Tree-SHA512: 1f5511957af2c20a9a6c79d80a335c3be37a2402dbf829c40cceaa01a24868eab81a9c1cdb0b3d77198fa3bb82799e3540a5c0ce7f35bbac80d73f7133ff7cbc
2018-08-26 00:04:05 +02:00
Wladimir J. van der Laan
f6eb85d17c
Merge #13707: tests: Add usage note to check-rpc-mappings.py
03a2d68010 Tests: add usage note to check-rpc-mappings.py (Mason Simon)

Pull request description:

  This test would previously fail without a user-friendly warning message, if invoked with no arguments.

  Test plan:
  ```
  bitcoin @_@$ python3 test/lint/check-rpc-mappings.py
  Usage: test/lint/check-rpc-mappings.py ROOT-DIR
  bitcoin @_@$ echo $?
  1
  bitcoin @_@$ python3 test/lint/check-rpc-mappings.py .
  * Checking consistency between dispatch tables and vRPCConvertParams
  bitcoin @_@$ echo $?
  0
  ```

Tree-SHA512: 0b7a94125d18ba5dbf3c3281a4af60718d2e495bf7645d7c2a3e1a2a1d80cffcea1383c90247186728037f1f2b38de75d0f59ccf7f792d69edd33884f3698c07
2018-08-25 22:41:33 +02:00
Wladimir J. van der Laan
6f5372a171
Merge #13961: util: Replace boost::signals2 with std::function
ddddce0e46 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  #13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1
2018-08-25 21:13:46 +02:00
Jim Posen
254c85b687 bench: Benchmark GCS filter creation and matching. 2018-08-25 10:02:37 -07:00
Jim Posen
f33b717a85 blockfilter: Optimization on compilers with int128 support. 2018-08-25 10:02:37 -07:00
Jim Posen
97b64d67da blockfilter: Unit test against BIP 158 test vectors.
Full test of block filter and header construction.
2018-08-25 10:02:37 -07:00
Jim Posen
a4afb9cadb blockfilter: Additional helper methods to compute hash and header. 2018-08-25 10:02:37 -07:00
Jim Posen
cd09c7925b blockfilter: Serialization methods on BlockFilter. 2018-08-25 10:02:37 -07:00
Jim Posen
c1855f6052 blockfilter: Construction of basic block filters. 2018-08-25 10:02:37 -07:00
Jim Posen
53e7874e07 blockfilter: Simple test for GCSFilter construction and Match. 2018-08-25 10:02:37 -07:00
Jim Posen
558c536e35 blockfilter: Implement GCSFilter Match methods. 2018-08-25 10:02:37 -07:00
Jim Posen
cf70b55005 blockfilter: Implement GCSFilter constructors. 2018-08-25 10:02:37 -07:00
Jim Posen
c454f0ac63 blockfilter: Declare GCSFilter class for BIP 158 impl. 2018-08-25 10:02:37 -07:00
Jim Posen
9b622dc722 streams: Unit tests for BitStreamReader and BitStreamWriter. 2018-08-25 10:02:37 -07:00
Jim Posen
fe943f99bf streams: Implement BitStreamReader/Writer classes.
Golomb-Rice coding, as specified in BIP 158, involves operations on
individual bits. These classes will be used to implement the
encoding/decoding operations.
2018-08-25 10:02:37 -07:00
Jim Posen
87f2d9ee43 streams: Unit test for VectorReader class. 2018-08-25 10:02:37 -07:00
Jim Posen
947133dec9 streams: Create VectorReader stream interface for vectors.
This is a read analogue for the existing CVectorWriter.
2018-08-25 10:02:37 -07:00
Wladimir J. van der Laan
021dce935a
Merge #13946: p2p: Clarify control flow in ProcessMessage
fa6c3dea42 p2p: Clarify control flow in ProcessMessage() (MarcoFalke)

Pull request description:

  `ProcessMessage` is effectively a massive switch case construct. In the past there were attempts to clarify the control flow in `ProcessMessage()` by moving each case into a separate static function (see #9608). It was closed because it wasn't clear if moving each case into a function was the right approach.
  Though, we can quasi treat each case as a function by adding a return statement to each case. (Can be seen as a continuation of bugfix #13162)

  This patch does exactly that.

  Also note that this patch is a subset of previous approaches such as #9608 and #10145.

  Review suggestion: `git diff HEAD~ --function-context`

Tree-SHA512: 91f6106840de2f29bb4f10d27bae0616b03a91126e6c6013479e1dd79bee53f22a78902b631fe85517dd5dc0fa7239939b4fefc231851a13c819458559f6c201
2018-08-25 18:18:15 +02:00
Wladimir J. van der Laan
4cef8e0593
Merge #13429: Return the script type from Solver
984d72ec65 Return the script type from Solver (Ben Woosley)

Pull request description:

  Because false is synonymous with TX_NONSTANDARD, this conveys the same
  information and makes the handling explicitly based on script type,
  simplifying each call site.

  Prior to this change it was common for the return value to be ignored, or for the
  return value and TX_NONSTANDARD to be redundantly handled.

Tree-SHA512: 31864f856b8cb75f4b782d12678070e8b1cfe9665c6f57cfb25e7ac8bcea8a22f9a78d7c8cf0101c841f2a612400666fb91798bffe88de856e98b873703b0965
2018-08-25 17:41:00 +02:00
Wladimir J. van der Laan
776fa60c4b
Merge #13631: Add CMerkleTx::IsImmatureCoinBase method
23f4343781 Add CMerkleTx::IsImmatureCoinBase method (Ben Woosley)

Pull request description:

  All but one call to `GetBlocksToMaturity` is testing it relative to 0
  for the purposes of determining whether the coinbase tx is immature.
  In such case, the value greater than 0 implies that the tx is coinbase,
  so there is no need to separately test that status.

  This names the concept for easy singular use.

Tree-SHA512: 4470d07404a0707144f9827b9a94c5c4905f23ee6f9248edc5df599a59d28e21ea0201d8abe5d5d73b39cb05b60c861ea8e04767eef04433e2ee95dcfed653ee
2018-08-25 16:53:21 +02:00
Ben Woosley
7d0a8ad310
Docs: Fix help message typo optiona -> optional 2018-08-24 15:02:16 -07:00
MarcoFalke
55c18a4530
Merge #14024: qa: Add TestNode::assert_debug_log
fa3e9f7627 qa: Add TestNode::assert_debug_log (MarcoFalke)

Pull request description:

  Closes #13006

Tree-SHA512: 8e2d2331039d70525a425aad65a4eaf9b83fb1f85a4260d69453176f04dbede6dd9b7bb4d5f089b46cf8f8c98571aa6ba7fac8fa6847bb3bdf6a6ad21a27b1a7
2018-08-24 14:07:24 -04:00
MarcoFalke
fa3e9f7627
qa: Add TestNode::assert_debug_log 2018-08-24 12:30:13 -04:00
MarcoFalke
ddddce0e46
util: Replace boost::signals2 with std::function 2018-08-24 08:34:38 -04:00
Cory Fields
0d00fd5901 depends: allow CC/CXX to be overridden during configure 2018-08-23 17:43:35 -04:00
Ben Woosley
f1640d093f
Make IS_TRIVIALLY_CONSTRUCTIBLE consistent on GCC < 5
std::is_trivially_constructible<T> is equivalent to std::is_trivially_default_constructible<T>
std::has_trivial_default_constructor<T> is the GCC < 5 name for std::is_trivially_default_constructible<T>

std::is_trivial was also used when compiling with clang, due to clang's use of __GNUC__. Test __clang__
to target the intended implementations.
2018-08-23 10:38:59 -07:00
Wladimir J. van der Laan
540bf8aacc
Merge #12559: Avoid locking cs_main in some wallet RPC
00f58f8c48 rpc: Avoid locking cs_main in some wallet RPC (João Barbosa)

Pull request description:

  Avoid locking `cs_main` in the folllowing wallet RPC:
   - `decoderawtransaction`
   - `getnewaddress`
   - `getrawchangeaddress`
   - `setlabel`

Tree-SHA512: 54089766b2a969a17479af6c60e8ce151fac1f8cec268d43c61e679d5d17e76d17e414240c9ca2bfd280165f3a04e24a51310eb283591cd601a7eebc8b2423ea
2018-08-23 19:38:18 +02:00
MarcoFalke
5b52aa6858
Merge #14025: p2p: Remove dead code for nVersion=10300
fa74d3d720 qa: Remove unused deserialization code in msg_version (MarcoFalke)
fa5099ceb7 p2p: Remove dead code for nVersion=10300 (MarcoFalke)

Pull request description:

  This code is undocumented and confusing as well as dead, since peers with a version that old are disconnected immediately.

Tree-SHA512: 58c131a2730b630ffdc191cd65fe736ed1bd57e184902e2af1b1399443c4654617e68774432016df023434055e85d2e8cd32fb03b40c508c3bb8db6d19427434
2018-08-23 11:11:34 -04:00
MarcoFalke
fa74d3d720
qa: Remove unused deserialization code in msg_version 2018-08-23 10:05:43 -04:00
João Barbosa
00f58f8c48 rpc: Avoid locking cs_main in some wallet RPC 2018-08-23 01:46:59 +01:00
Wladimir J. van der Laan
271b379e63
Merge #14018: Bugfix: NSIS: Exclude Makefile* from docs
8563341714 Bugfix: NSIS: Exclude Makefile* from docs (Luke Dashjr)

Pull request description:

  Otherwise, the generated Makefile is included in the NSIS-installed documentation, which can lead to non-determinism (eg, if gawk is installed on some build VMs, but others only have mawk)

  (gawk is part of the standard Ubuntu bionic server install, but for some reason missing on many other developers' build VMs.)

  (Branch is safe to merge cleanly into 0.14-0.17 branches also)

  Testing requested. I have a separate `fix_nsis_makefile` branch directly on the `v0.17.0rc1` tag, which produces for me (with gawk installed):

  ```
  f2f0e81e053f6bb59f3007a182e3e8b5cc4ccd374cfee29c80861d00c508a798  bitcoin-0.17.0-win-unsigned.tar.gz
  935d4ef25e9602352833bbd594003a7b07ef9e2281fa9a2258c0f71167bdaaca  bitcoin-0.17.0-win32-debug.zip
  37a789993f4fef6007633a988614f8008389463ded6807c1beaaf3c04212d5f9  bitcoin-0.17.0-win32-setup-unsigned.exe
  8b04d4d7de3d4308bff5f2e61bb771926dd66fa815fcea1eadc8d627f0f8970a  bitcoin-0.17.0-win32.zip
  8883dad775c2b97085b2217175e9916a9aa894ff97fbdc9b7ca74b4e8206298d  bitcoin-0.17.0-win64-debug.zip
  cd30d3eb2b739f6e4956c768ea4fb0230fb23e01dcad094d2fbf4efa6c7dad52  bitcoin-0.17.0-win64-setup-unsigned.exe
  817d5b9df4cc3f7fd323e134ed8670787aa9cafc921e883bbbb9cdfb439b03da  bitcoin-0.17.0-win64.zip
  e3ed7f2d4a5993e4c343e967cfa838c6314fa98900c43519572a31b96d3e00ca  src/bitcoin-0.17.0.tar.gz
  38d2f92cf2c9823ea3c52aaa9c42f7cb38a87a12896a89379bfc4315a04d2e92  bitcoin-win-0.17-res.yml
  ```

Tree-SHA512: dda68a765e3e682f7b4352a8ec6942559eb6a29c740d6bd1008c788e3e50f44fd2d157100616cc7aaffc2568640ec6a74fb063a29645cd02ba14a0828ab6f01c
2018-08-22 15:28:52 +02:00
MarcoFalke
fa5099ceb7
p2p: Remove dead code for nVersion=10300 2018-08-22 09:22:04 -04:00