Commit graph

23800 commits

Author SHA1 Message Date
MarcoFalke fa47cf9d95
wallet: Fix typo in assert that is compile-time true 2020-05-04 10:40:48 -04:00
MarcoFalke ae32e5ce3d
Merge #18669: log: Use Join() helper when listing log categories
faec063887 log: Use Join() helper when listing log categories (MarcoFalke)

Pull request description:

  This removes the global `ListLogCategories` and replaces it with a one-line member function `LogCategoriesString`, which just calls `Join`.

  Should be a straightforward refactor to get rid of a few LOC.

ACKs for top commit:
  laanwj:
    ACK faec063887
  promag:
    ACK faec063887, I also think it's fine as it is (re https://github.com/bitcoin/bitcoin/pull/18669#discussion_r412944724).

Tree-SHA512: 2f51f9ce1246eda5630015f3a869e36953c7eb34f311baad576b92d7829e4e88051c6189436271cd0a13732a49698506345b446b98fd28e58edfb5b62169f1c9
2020-04-26 19:57:41 -04:00
MarcoFalke 9ddfce6712
Merge #18753: test: Fix intermittent failure in wallet_importmulti
fa8b9b5d1f test: Fix intermittent failure in wallet_importmulti (MarcoFalke)

Pull request description:

  The wallet is async, so after generating a block, we must call `syncwithvalidationinterfacequeue`. Otherwise the timestamp will be of the previous block.

  https://travis-ci.org/github/bitcoin/bitcoin/jobs/677685073#L2648

ACKs for top commit:
  promag:
    ACK fa8b9b5d1f.

Tree-SHA512: c21f9912aabbe22019d4ac9d0da06d6e46ef7f2a84d2781110e04c9836eb0ecf90a22cf2bae7f608be611670d17b20600135d1c5e5404aa1e762839816285fb4
2020-04-26 10:47:37 -04:00
MarcoFalke 3cf464de2e
Merge #18770: test: Remove raw-tx byte juggling in mempool_reorg
fa489011d9 test: Remove raw-tx byte juggling in mempool_reorg (MarcoFalke)

Pull request description:

ACKs for top commit:
  robot-visions:
    ACK fa489011d9

Tree-SHA512: 2ae537a5b34e48d2954ba02d9e050ae1a99043080266d5decca3f983b13bc3ddcbee1f3f3c7457e16ee76ea17b9ce08cac2e3205cf46b5e3c3e4ca5f758f00de
2020-04-26 07:41:01 -04:00
MarcoFalke fa489011d9
test: Remove raw-tx byte juggling in mempool_reorg 2020-04-25 19:36:02 -04:00
MarcoFalke 65276c7737
Merge #18744: test: Add fuzzing harnesses for various classes/functions in primitives/
fd8e99da57 tests: Add fuzzing harness for functions in primitives/transaction.h (practicalswift)
d5a31b7cb4 tests: Add fuzzing harness for functions in primitives/block.h (practicalswift)

Pull request description:

  Add fuzzing harnesses for various classes/functions in `primitives/`.

  See [`doc/fuzzing.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md) for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the [Bitcoin Core fuzzing corpus repo](https://github.com/bitcoin-core/qa-assets).

  Happy fuzzing :)

Top commit has no ACKs.

Tree-SHA512: ed54bd5b37ff5e40cfa8d3cd8c65d91a2f64fca87b6a5c3b8ddd6becd876ed172735fb53da4d00a86f318fb94517afd179e07cb28a43edf301ffe4dad703cca4
2020-04-25 09:50:12 -04:00
MarcoFalke 3e7c118d65
Merge #18688: fuzz: Run in parallel
fa66280396 fuzz: Run in parallel (MarcoFalke)

Pull request description:

  Can be reviewed with `--ignore-all-space`

ACKs for top commit:
  practicalswift:
    ACK fa66280396 -- patch looks correct and the live demo in https://github.com/bitcoin-core/qa-assets/pull/11#issuecomment-615439226 convinced me: this is good!
  fanquake:
    ACK fa66280396 - this seems sane, and clearly provides some speedup. I'd post benchmarks but can't seem to get through a full run of `./test/fuzz/test_runner.py` without hitting at least a few crashes; see #18763, 18762.

Tree-SHA512: d3b545ca90c75bed27f08fe712399d0ed1ac36b13fb289c83e5606eee8dec4c19f5f5cf91758f0a6b1606d8d6b455fbe46df2588faffe7462b185bd34dc2baaf
2020-04-25 09:28:33 -04:00
MarcoFalke bab81f7e4d
Merge #18739: doc: Document how to fuzz Bitcoin Core using Honggfuzz
bb1ec36fb1 doc: Document how to fuzz Bitcoin Core using honggfuzz (practicalswift)

Pull request description:

  Document how to fuzz Bitcoin Core using Honggfuzz.

ACKs for top commit:
  fanquake:
    ACK bb1ec36fb1 - did a couple quick runs on a severely under powered VM.

Tree-SHA512: 117944c52763a5672f988c62fecb01b85f19f3827fad5582a51464aefdaac4d9a9cd81e2118199f6ea1bb3ab0893c8459ca3d1df7f67bfcf215d5e305225f210
2020-04-25 09:26:52 -04:00
MarcoFalke fd48e7ad99
Merge #18585: test: use zero-argument super() shortcut (Python 3.0+)
0956e46bff test: use zero-argument super() shortcut (Python 3.0+) (Sebastian Falbesoner)

Pull request description:

  This mini-PR replaces all calls to `super(...)` with arguments with the zero-argument shortcut `super()` where applicable. See [PEP 3135](https://www.python.org/dev/peps/pep-3135/#specification):

  > The new syntax:
  >
  >     super()
  >
  > is equivalent to:
  >
  >     super(__class__, <firstarg>)
  >
  > where __class__ is the class that the method was defined in, and <firstarg> is
  > the first parameter of the method (normally self for instance methods, and cls
  > for class methods).

ACKs for top commit:
  fanquake:
    ACK 0956e46bff

Tree-SHA512: 4ac66fe7ab2be2e8a514e5fcfc41dbb298f21b23ebb7b7b0310d704b0b3cef8adf287a8d80346d1ea9418998c597b4f0ff1f66148d0d806bb43db6607e0fe1cf
2020-04-25 09:25:50 -04:00
MarcoFalke 6f51f6f357
Merge #18754: bench: add CAddrMan benchmarks
a9b957740e bench: add CAddrMan benchmarks (Vasil Dimov)

Pull request description:

  The added benchmarks exercise the public methods Add(), GetAddr(),
  Select() and Good().

ACKs for top commit:
  naumenkogs:
    utACK a9b9577
  MarcoFalke:
    ACK a9b957740e

Tree-SHA512: af54b2fbd97db34faf4cc6c9bacb20d2c97d0aaddb9cf91b220bc2e09227b55345402ed17e34450745493e3a2b286c176c031cdeb477415570a757cee16b06a8
2020-04-25 08:38:39 -04:00
MarcoFalke 9fac600aba
Merge #17383: Refactor: Move consts to their correct translation units
e9ea95a30d [net processing] Move all const declarations to top of net_processing.cpp (John Newbery)
507b36dd1b [validation] Move all const declarations to top of validation.h (John Newbery)
0109622b08 [validation] Move validation-only consts to validation.cpp (John Newbery)
b8580cacc7 [net processing] Move net processing consts to net_processing.cpp (John Newbery)

Pull request description:

  Following the main.cpp split, there are still some constants in the wrong places, eg net_processing constants in validation.h. Move them all to their rightful homes. At the same time, make them constexpr.

  Also move all const declarations to the top of their files, and ensure that they all have doxygen comments.

ACKs for top commit:
  practicalswift:
    ACK e9ea95a30d -- patch looks correct
  MarcoFalke:
    ACK e9ea95a30d 🚉

Tree-SHA512: 44d81da73c7be01e1d36b939789d793f297d3b94f84ea4e7ac853c621cc7054b5a05c7c9e7b83db506db44c16f344541be8f240d955694211e53a84c32b0d2c5
2020-04-25 08:36:39 -04:00
Sebastian Falbesoner 0956e46bff test: use zero-argument super() shortcut (Python 3.0+)
as defined in PEP 3135:

"The new syntax:

    super()

is equivalent to:

    super(__class__, <firstarg>)

where __class__ is the class that the method was defined in, and <firstarg> is
the first parameter of the method (normally self for instance methods, and cls
for class methods)."
2020-04-25 13:49:08 +02:00
MarcoFalke 5f19155e5b
Merge #18724: test: add coverage for -rpcwallet cli option
2495110012 test: add coverage for -rpcwallet cli option (Jon Atack)

Pull request description:

  The bitcoin-cli `-rpcwallet=` option is an essential RPC/CLI option when more than one wallet is loaded (see `bitcoin-cli -help | grep -A5 rpcwallet` or `src/bitcoin-cli.cpp::L61`) and it currently has no test coverage.

  It is not only used by users, but also by the test framework and ~10 test files via `get_wallet_rpc()`.

  This PR adds coverage, while simultaneously improving the `-getinfo` coverage when multiple wallets are loaded. This is similar to the test coverage that would be added in #18594.

ACKs for top commit:
  robot-visions:
    ACK 2495110012

Tree-SHA512: caaa8b99fb8fa481ab2c6b2a287ed29720bb4553c3f66657462c44fa2990acaaf36cabeaaf81408678e5fdce4e105d729dd94b5ed8588dd1a6f2cb03fc25acf3
2020-04-24 18:41:22 -04:00
MarcoFalke a215c61333
Merge #18756: refactor: test: use wait_for_getdata() in p2p_compactblocks.py
c4027e7350 refactor: test: use wait_for_getdata() in p2p_compactblocks.py (Sebastian Falbesoner)

Pull request description:

  The method `wait_for_getdata()` was recently changed to be more precise by waiting for a specified list of hashes, instead of only matching _any_ `getdata` message (see Issue #18614 and PR  #18690). This PR replaces the remaining occurences of manual inspection of `last_messages` with this call.

ACKs for top commit:
  robot-visions:
    ACK c4027e7350

Tree-SHA512: e10b346742f235b6ee2ef1f32f7fd74406c1a277389f020fb9913a93e94cc9530e1e9414872b83c9d2ae652ebce2b09b2c8c8372260c1afb4e0e54fbf7a935b0
2020-04-24 16:37:17 -04:00
MarcoFalke 29637a5c56
Merge #18745: test: Check submitblock return values
fa262712ca test: Check submitblock return values (MarcoFalke)

Pull request description:

  Add `assert_equal` in some tests to check the `submitblock` return value

ACKs for top commit:
  robot-visions:
    ACK fa262712ca

Tree-SHA512: 25d9effe82a4f6852184b9ac848f96336cc2cafb0bb07edb2792f00cd363f0759575bc9c164dd62f64425d3754028b4acd0675600c07d51277aa80bf66c6f960
2020-04-24 16:34:43 -04:00
Jon Atack 2495110012
test: add coverage for -rpcwallet cli option
and add -getinfo coverage with multiple wallets loaded.
2020-04-24 21:51:00 +02:00
MarcoFalke 8c0f86f284
Merge #18757: test: Remove enumeration of expected deserialization exceptions in ProcessMessage(...) fuzzer
fdceb63283 fuzz: Remove enumeration of expected deserialization exceptions in ProcessMessage(...) fuzzer (practicalswift)

Pull request description:

  Remove enumeration of expected deserialization exceptions in `ProcessMessage(...)` fuzzer.

  Closes #18749.

Top commit has no ACKs.

Tree-SHA512: fe0411dd1e574fe635019d9e3329202798295c8be1b0c5cb9c092ecc27ab7d4d2883104d7bd781ff5d422d13480d858fc8a7f5578d09268d142ae966afb79002
2020-04-24 14:38:23 -04:00
MarcoFalke 7812889849
Merge #18157: doc: fixing init.md documentation to not require rpcpassword
a2a03c3ca9 fixing documentation to not require rpcpassword (“jkcd”)

Pull request description:

  Configuration section in [doc/init.md](https://github.com/bitcoin/bitcoin/blob/master/doc/init.md) says user must set rpcpassword in order to run bitcoind. Since [71cbea](71cbeaad9a) fixed the code to use a cookie for authentication, it is not mandatory to set rpcpassword in the configuration.

  Fixes #16346

ACKs for top commit:
  hebasto:
    ACK a2a03c3ca9, modulo nit

Tree-SHA512: a62816fef78bed32200bb278cfc7aacf6ea154a60fdf5181927e48b806a1bd694bdf3ccec8362f5e58aad694d636c63f540323d54d85b61deaa417b95b8b56eb
2020-04-24 14:22:14 -04:00
practicalswift fdceb63283 fuzz: Remove enumeration of expected deserialization exceptions in ProcessMessage(...) fuzzer 2020-04-24 14:53:59 +00:00
MarcoFalke d1aa0ae1ad
Merge #18712: test: display command line options passed to send_cli() in debug log
8f5dc8800a test: display command line options passed to send_cli() in debug log (Jon Atack)

Pull request description:

  as per https://github.com/bitcoin/bitcoin/pull/18691#discussion_r411382589, and revert two cli calls changed in #18691 from rpc commands back to command line options (these were the only occurrences).

ACKs for top commit:
  MarcoFalke:
    ACK 8f5dc8800a

Tree-SHA512: fcb3eca00aa4099066028c90d5e50a02e074366e09a17f5f5b937d9f7562dd054ff65681aa0ad4c94f6de1e98b1e2b9ac4cd084ddc297010253989a80483b1b9
2020-04-24 08:41:15 -04:00
practicalswift fd8e99da57 tests: Add fuzzing harness for functions in primitives/transaction.h 2020-04-24 12:16:03 +00:00
MarcoFalke 85bae24d06
Merge #18752: test: Fix intermittent error in mempool_reorg
fae98668d1 test: Fix intermittent error in mempool_reorg (MarcoFalke)

Pull request description:

  Example: https://travis-ci.org/github/bitcoin/bitcoin/jobs/677689899#L4717

  Also speed up tx relay and fix two pep8 errors while touching the file anyway.

ACKs for top commit:
  vasild:
    utACK fae9866

Tree-SHA512: 23a7894e71ad0e1a59c74c73643708fca21b505fa4e980038d554294063fd63c396669eefb233ffdffb0083968e51b702c643cb449df8f656dd8345a20f33907
2020-04-24 07:57:48 -04:00
Sebastian Falbesoner c4027e7350 refactor: test: use wait_for_getdata() in p2p_compactblocks.py 2020-04-24 13:55:20 +02:00
fanquake d8ca51db5d
Merge #18589: Fix naming of macOS SDK and clarify version
eb37275a6f Fix naming of macOS SDK and clarify version (Andrew Chow)

Pull request description:

  Fixes the `MacOSX10.14.sdk.tar.gz` creation command to have `MacOSX.sdk` be correctly named as `MacOSX10.14.sdk` and for the resulting file to be placed in the current directory. Gitian requires that `tar.gz` contains a folder named `MacOSX10.14.sdk` and the command did not do this originally. Having the file be placed in the current directory is a convenience so builders don't have to go find it.

  Also clarifies which version of Xcode to download and where it can be downloaded.

ACKs for top commit:
  fanquake:
    ACK eb37275a6f - tested the macOS and Linux SDK extraction. Also noticed something seemingly broken with Apple `tar`, but will open an issue to follow up.
  Sjors:
    ACK eb37275 for the macOS instruction

Tree-SHA512: d691e14711cf195999291dd6fb7ffe552c86f8b30d2b1a77e88b4db6050dd817ba128b047cf36d29b0bb0d4183e709b7c03aa27f31b64e562ea8cd948434ca55
2020-04-24 17:22:54 +08:00
MarcoFalke fa8b9b5d1f
test: Fix intermittent failure in wallet_importmulti 2020-04-23 19:01:26 -04:00
MarcoFalke fae98668d1
test: Fix intermittent error in mempool_reorg 2020-04-23 18:43:44 -04:00
Andrew Chow eb37275a6f Fix naming of macOS SDK and clarify version 2020-04-23 13:22:16 -04:00
John Newbery e9ea95a30d [net processing] Move all const declarations to top of net_processing.cpp 2020-04-23 12:54:06 -04:00
John Newbery 507b36dd1b [validation] Move all const declarations to top of validation.h 2020-04-23 12:54:06 -04:00
John Newbery 0109622b08 [validation] Move validation-only consts to validation.cpp 2020-04-23 12:54:06 -04:00
John Newbery b8580cacc7 [net processing] Move net processing consts to net_processing.cpp 2020-04-23 12:54:03 -04:00
MarcoFalke 64139803f1
Merge #18690: test: Check object hashes in wait_for_getdata
9f5608c289 test: check for matching object hashes in wait_for_getdata (Danny Lee)

Pull request description:

  Previously, `wait_for_getdata` only looked for the presence of a recent `"getdata"` message.  Additionally checking the object hashes inside the message should make tests involving `wait_for_getdata` more robust.

  `p2p_sendheaders.py` already overrides `wait_for_getdata` do this check; we can use the same approach consistently across all tests that call `wait_for_getdata`.

  This PR is progress towards #18614 , but closing that issue would also involve some additional changes to `wait_for_getheaders`.

ACKs for top commit:
  theStack:
    ACK 9f5608c289 🍻

Tree-SHA512: 8e7f95881c19631db014d4bb2399fea0d14686a32542f6ca3b60809744b0d684eac4e4c107c87143991f3cd0c2d4ab09d0c17486239768a9b40bee25f2e4d54a
2020-04-23 06:37:53 -04:00
Samuel Dobson e890c15e2c
Merge #18671: wallet: Add BlockUntilSyncedToCurrentChain to dumpwallet
fa60afc4fb wallet: Add BlockUntilSyncedToCurrentChain to dumpwallet (MarcoFalke)

Pull request description:

  dumpwallet includes the block hash in the output, so this method depends on the chainstate. According to the developer notes e84a5f0004/doc/developer-notes.md (L1095) it must include a `BlockUntilSyncedToCurrentChain`.

  This is a minor fix and does not need backport, I think.

  It fixes test failures such as https://travis-ci.org/github/bitcoin/bitcoin/jobs/675487097#L2657 , which can only happen in master because the test was not backported.

ACKs for top commit:
  promag:
    Code review ACK fa60afc4fb.
  ryanofsky:
    Code review ACK fa60afc4fb
  meshcollider:
    utACK fa60afc4fb

Tree-SHA512: 8df70b06b226b2cdf880dec9264adb72d66fd81b09b404fd1665a79e5f5236d26122eebf15df00fe71ee292b5c91b2dc23a0a42b2aa50a8d690604b23832723f
2020-04-23 14:12:35 +12:00
Samuel Dobson 4f802e59a0
Merge #17509: gui: save and load PSBT
764bfe4cba [psbt] add file size limit (Sjors Provoost)
1cd8dc2556 [gui] load PSBT (Sjors Provoost)
f6895301f7 [gui] save PSBT to file (Sjors Provoost)
1d05a9d80b Move DEFAULT_MAX_RAW_TX_FEE_RATE to node/transaction.h (Sjors Provoost)
86e22d23bb [util] GetFileSize (Sjors Provoost)
6ab3aad9a5 [gui] send dialog: split on_sendButton_clicked (Sjors Provoost)

Pull request description:

  This adds:
  * a dialog after Create Unsigned, which lets you save a PSBT file in binary format, e.g. to an SD card
  * a "Load PSBT" menu entry lets you pick a PSBT file. We broadcast the transaction if complete

  ## Save flow
  <img width="482" alt="Schermafbeelding 2020-01-04 om 20 39 34" src="https://user-images.githubusercontent.com/10217/71765684-ba60d580-2f32-11ea-8dea-0c4398eb6e15.png">

  <img width="287" alt="Schermafbeelding 2020-01-04 om 20 40 35" src="https://user-images.githubusercontent.com/10217/71765677-a0bf8e00-2f32-11ea-8172-12dfd34a89f3.png">

  <img width="594" alt="Schermafbeelding 2020-01-04 om 20 41 12" src="https://user-images.githubusercontent.com/10217/71765681-aa48f600-2f32-11ea-8e2c-c4f6bf9f5309.png">

  <img width="632" alt="Schermafbeelding 2020-01-04 om 20 41 28" src="https://user-images.githubusercontent.com/10217/71765691-d19fc300-2f32-11ea-97ff-70f5dd59987a.png">

  By default the file name contains the destination address(es) and amount(s).

  We only use the binary format for files, in order to avoid compatibility hell. If we do want to add base64 file format support, we should use a different extension for that (`.psbt64`?).

  ## Load flow

  Select a file:
  <img width="649" alt="Schermafbeelding 2020-01-04 om 21 08 57" src="https://user-images.githubusercontent.com/10217/71766089-2ba28780-2f37-11ea-875d-074794b5707d.png">

  Offer to send if complete:

  <img width="308" alt="Schermafbeelding 2020-01-04 om 21 09 06" src="https://user-images.githubusercontent.com/10217/71766088-2a715a80-2f37-11ea-807d-394c8b840c59.png">

  Tell user if signatures are missing, offer to copy to clipboard:
  <img width="308" alt="Schermafbeelding 2020-01-04 om 21 15 57" src="https://user-images.githubusercontent.com/10217/71766115-702e2300-2f37-11ea-9f62-a6ede499c0fa.png">

  Incomplete for another reason:

  <img width="309" alt="Schermafbeelding 2020-01-04 om 21 07 51" src="https://user-images.githubusercontent.com/10217/71766090-2c3b1e00-2f37-11ea-8a22-6188377b67a1.png">

ACKs for top commit:
  instagibbs:
    re-ACK  764bfe4cba
  achow101:
    ACK 764bfe4cba
  jb55:
    Tested ACK 764bfe4cba
  jonatack:
    ACK 764bfe4c
  promag:
    Code review ACK 764bfe4cba.

Tree-SHA512: d284ed6895f3a271fb8ff879aac388ad217ddc13f72074725608e1c3d6d90650f6dc9e9e254479544dd71fc111516b02c8ff92158153208dc40fb2726b37d063
2020-04-23 13:16:23 +12:00
MarcoFalke fa262712ca
test: Check submitblock return values 2020-04-22 16:56:56 -04:00
practicalswift d5a31b7cb4 tests: Add fuzzing harness for functions in primitives/block.h 2020-04-22 19:51:42 +00:00
MarcoFalke 47b94a337e
Merge #18732: test: Remove unused, undocumented and misleading CScript.__add__
faff9e4bb4 test: Remove unused, undocumented and misleading CScript.__add__ (MarcoFalke)

Pull request description:

  See the corresponding pull #18612

ACKs for top commit:
  laanwj:
    ACK faff9e4bb4 provided it passes Travis

Tree-SHA512: 5d9c4d5b6453c70b24a6960d3b42834e9b31f6dbb99ac47a6abfd85f2739d5372563e7188c22aceabeee1c37eb218bf580848356f4a77268d65f178a9419b269
2020-04-22 15:49:22 -04:00
MarcoFalke fb89af26d8
Merge #18733: doc: Add wallet release notes for 0.21.0
facaefadd3 doc: Add wallet release notes for 0.21.0 (MarcoFalke)
faa4243c11 Add release notes skeleton, so that notes can be filled easier (MarcoFalke)

Pull request description:

ACKs for top commit:
  fjahr:
    ACK facaefadd3
  achow101:
    ACK facaefadd3

Tree-SHA512: a17ab86e422ca3d3e53deffa7fecf09cdd9b816588deeded3a15e80a1c268ff1e8b56a0e052a417f1a091872099cd3d2b89993d4773a86516b0bdef880a949a0
2020-04-22 15:45:56 -04:00
Danny Lee 9f5608c289 test: check for matching object hashes in wait_for_getdata 2020-04-22 10:46:08 -07:00
practicalswift bb1ec36fb1 doc: Document how to fuzz Bitcoin Core using honggfuzz 2020-04-22 15:22:36 +00:00
MarcoFalke a7a6f1ff41
Merge #18575: bench: Remove requirement that all benches use same testing setup
fa1fdb02fc bench: Replace ::mempool globabl with test_setup.mempool (MarcoFalke)
fab1170964 bench: Remove requirement that all benches use RegTestingSetup (MarcoFalke)

Pull request description:

  The benches have always set up one global testing setup. This makes it hard to pick no testing setup at all or one with different params.

  Fix this by removing any global state setup from the main `bench.cpp` and leave the setup to each individual bench.

  One reason to have one global testing setup is to set the datadir location to a tempdir to avoid reading or writing in the default datadir location. But #13687 should prevent this already.

Top commit has no ACKs.

Tree-SHA512: 7c98aea7725a20f4b9225221f4279b9e9f7257ed5c14712ad01ea80d87c3b0fed760b40f413892498bbb354a917ee02d4c575cbe8423a403b86755e8ee11f33b
2020-04-22 10:52:40 -04:00
MarcoFalke facaefadd3
doc: Add wallet release notes for 0.21.0 2020-04-22 09:22:49 -04:00
Wladimir J. van der Laan 5dcb061589
Merge #18702: build: fix ASLR for bitcoin-cli on Windows
315a4d36f7 build: fix ASLR for bitcoin-cli on Windows (fanquake)

Pull request description:

  ASLR is not currently working for the `bitcoin-cli.exe` binary. This is
  due to it not having a .reloc section, which is stripped by default by
  the mingw-w64 ld we use for gitian builds. A good summary of issues with
  ld and mingw-w64 is available in this thread:
  https://sourceware.org/bugzilla/show_bug.cgi?id=19011.

  All other Windows binaries that we distribute (bitcoind, bitcoin-qt,
  bitcoin-wallet, bitcoin-tx and test_bitcoin) do not suffer this issue,
  and currently having working ASLR. This is due to them exporting
  (inadvertent or not) libsecp256k1 symbols, and, as a result, the .reloc
  section is not stripped by ld.

  This change is a temporary workaround, also the same one described here:
  https://www.kb.cert.org/vuls/id/307144/, that causes main() to be
  exported. Exporting a symbol will mean that the .reloc section is not
  stripped, and ASLR will function correctly.

  Ultimately, this will be fixed by using a newer version of binutils (that has this [change](https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=dc9bd8c92af67947db44b3cb428c050259b15cd0)). Whether that's through bumping our gitian distro, or Guix.

  Related to #18629, which has a bunch of additional information in the PR description. If you would like to verify whether or not ASLR is indeed working, with or without this change. One easy way to check is using a tool like [VMMap](https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap).

  Here are the memory mappings for the 0.20.0rc1 `bitcoind.exe` and `bitcoin-cli.exe` binaries. You'll notice that over machine restarts, even though the image is marked `(ASLR)` (which I assume may be due to the header bit being set), no ASLR is actually occuring for `bitcoin-cli.exe`:

  #### bitcoind.exe

  ![bitcoind-1](https://user-images.githubusercontent.com/863730/79678203-74065c80-822b-11ea-90bc-9c883d0aeefa.png)

  ![bitcoind-2](https://user-images.githubusercontent.com/863730/79678204-7668b680-822b-11ea-9263-3e7ba22f904c.png)

  ![bitcoind-3](https://user-images.githubusercontent.com/863730/79678206-7963a700-822b-11ea-972f-af31a514b9b4.png)

  #### bitcoin-cli.exe

  ![bitcoin-cli-1](https://user-images.githubusercontent.com/863730/79678208-7ec0f180-822b-11ea-8480-a4b5d1762945.png)

  ![bitcoin-cli-2](https://user-images.githubusercontent.com/863730/79678213-81bbe200-822b-11ea-964d-994f58ff12b0.png)

  ![bitcoin-cli-3](https://user-images.githubusercontent.com/863730/79678215-84b6d280-822b-11ea-9cd6-fee2e239c003.png)

ACKs for top commit:
  dongcarl:
    ACK 315a4d36f7
  laanwj:
    ACK 315a4d36f7

Tree-SHA512: 95f4dc15420ed9bcdeacb763e11c3c7e563eec594a172746fa0346c13f97db3a8769357dffc89fea1e57ae67133f337b1013a73b584662f5b6c4d251ca20a2b1
2020-04-22 15:18:11 +02:00
MarcoFalke faa4243c11
Add release notes skeleton, so that notes can be filled easier 2020-04-22 09:16:05 -04:00
Wladimir J. van der Laan ce4e1f0282
Merge #18553: Avoid non-trivial global constants in SHA-NI code
8508473094 Avoid non-trivial global constants in SHA-NI code (Pieter Wuille)

Pull request description:

  This is a potential solution for #18456.

  It seems that the compiler cannot turn `_mm_set_epi64x(<constant>,<constnant>)` into a constant itself, and thus emits a global initializer for the `MASK`, `INIT0`, and `INIT1` global constants in the sha-ni SHA256 implementation.

  Change this by turning them into dumb byte arrays, loading them into an SSE variable whenever needed.

  Tested on a SHA-NI capable machine. I do not observe any obvious performance impact (but this is hard to measure, it's already very fast...).

ACKs for top commit:
  laanwj:
    Code review ACK 8508473094
  elichai:
    ACK 8508473094

Tree-SHA512: 07049cf1a33624c22df2be48b814d5636c037b368861eb13ee073bdce2b7c902a56e96518218961f55a2a1631a40825ded6dbbc28d7fe0e7fec267d704e39112
2020-04-22 15:09:19 +02:00
MarcoFalke faff9e4bb4
test: Remove unused, undocumented and misleading CScript.__add__ 2020-04-22 09:00:56 -04:00
Wladimir J. van der Laan 9e8e813df5
Merge #18410: Docs: Improve commenting for coins.cpp|h
21fa0a44ab [docs] use consistent naming for possible_overwrite (John Newbery)
2685c214cc [tests] small whitespace fixup (John Newbery)
e9936966c0 scripted-diff: Rename PRUNED to SPENT in coins tests (John Newbery)
c205979031 [docs] Improve commenting in coins.cpp|h (John Newbery)

Pull request description:

  - Add full commenting for spentness / DIRTYness / FRESHness and which combinations are valid
  - Remove the 'pruned' terminology, which doesn't make sense since per-txout chainstate db was merged (#10195).
  - Rename `potential_overwrite` to `possible_overwrite` to standardize terminology (there were previously examples of both, which made searching the codebase difficult).
  - Make other minor improvements to the comments

ACKs for top commit:
  jonatack:
    Re-ACK 21fa0a4 per `git diff 98bee55 21fa0a4` the only change since my previous review is the following code commenting diff in `src/coins.cpp::L177-179`;  rebuilt/ran unit tests anyway as a sanity check on the unit test changes.

Tree-SHA512: 391e01588ef5edb417250080cec17361f982c4454bc5f8c6d78bbd528c68a2bb94373297760691295c24660ce1022ad3ef7599762f736c8eed772ce096d38c3d
2020-04-22 14:23:56 +02:00
Wladimir J. van der Laan acb4fa0741
Merge #18665: Do not expose and consider -logthreadnames when it does not work
b91e4ae0d8 Do not expose and consider -logthreadnames when it does not work (Hennadii Stepanov)

Pull request description:

  There are conditions when the `HAVE_THREAD_LOCAL` macro is undefined what causes the `-logthreadnames` option does not work -- instead of thread names empty strings `[]` only are printed in the `debug.log` file.

  This PR does not exposes the `-logthreadnames` option in such cases.

  Refs:
  - #16059
  - #18652

ACKs for top commit:
  MarcoFalke:
    ACK b91e4ae0d8, looked at the diff, didn't test

Tree-SHA512: 3bd58e5ea603c69686589ddc94d6fa441cab4f712004378f2f1661e12638804ca03cfb6426e6393e55b6a095b325f3161d3c5371af05d7fc79d6d328227bf40c
2020-04-22 14:18:06 +02:00
Wladimir J. van der Laan 19032c750c
Merge #18612: script: Remove undocumented and unused operator+
ccccd51908 script: Remove undocumented and unused operator+ (MarcoFalke)

Pull request description:

  This operator has no documented use case and is also unused outside of test code. The test code and all other (imaginary) code that might use this operator is written more clear and concise by the existing CScript push operators for opcodes and data.

  Removing the operator is also going to protect against accidentally reintroducing bugs like this 6ff5f718b6 (diff-8458adcedc17d046942185cb709ff5c3L1135) (last time it was used).

ACKs for top commit:
  laanwj:
    ACK ccccd51908

Tree-SHA512: 43898ac77e4d9643d9f8ac6f8f65497a4f0bbb1fb5dcaecc839c3719aa36181ba77befb213e59a9f33a20a29e0173a0e9c4763b1930940b32c3d1598b3e39af9
2020-04-22 14:17:01 +02:00
fanquake c90a9e6fff
Merge #18713: scripts: Add MACHO stack canary check to security-check.py
8334ee31f8 scripts: add MACHO LAZY_BINDINGS test to test-security-check.py (fanquake)
7b99c7454c scripts: add MACHO Canary check to security-check.py (fanquake)

Pull request description:

  7b99c7454c uses `otool -Iv` to check for `___stack_chk_fail` in the macOS binaries. Similar to the [ELF check](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/security-check.py#L105). Note that looking for a triple underscore prefixed function (as opposed to two for ELF) is correct for the macOS binaries. i.e:
  ```bash
  otool -Iv bitcoind | grep chk
  0x00000001006715b8   509 ___memcpy_chk
  0x00000001006715be   510 ___snprintf_chk
  0x00000001006715c4   511 ___sprintf_chk
  0x00000001006715ca   512 ___stack_chk_fail
  0x00000001006715d6   517 ___vsnprintf_chk
  0x0000000100787898   513 ___stack_chk_guard
  ```

  8334ee31f8 is a follow up to #18295 and adds test cases to `test-security-check.py` that for some reason I didn't add at the time. I'll sort out #18434 so that we can run these tests in the CI.

ACKs for top commit:
  practicalswift:
    ACK 8334ee31f8: Mitigations are important. Important things are worth asserting :)
  jonasschnelli:
    utACK 8334ee31f8.

Tree-SHA512: 1aa5ded34bbd187eddb112b27278deb328bfc21ac82316b20fab6ad894f223b239a76b53dab0ac1770d194c1760fcc40d4da91ec09959ba4fc8eadedb173936a
2020-04-22 16:40:32 +08:00