Commit Graph

27024 Commits

Author SHA1 Message Date
MarcoFalke
fa957f8dc9
test: Add race:SendZmqMessage tsan suppression 2020-12-22 21:53:13 +01:00
Hennadii Stepanov
3e1571285f
Update TSan suppressions 2020-12-22 20:24:23 +02:00
John Newbery
176325a5a4 [net processing] Remove dropmessagestest
-dropmessagestest is a command line option that causes 1 in n received
messages to be dropped. The Bitcoin P2P protocol is stateful and in
general cannot handle messages being dropped. Dropped
version/verack/ping/pong messages will cause the connection to time out
and be torn down. Other dropped messages may also cause the peer to
believe that the peer has stalled and tear down the connection.

It seems difficult to uncover any actual issues with -dropmessagestest,
and any coverage that could be generated would probably be easier to
trigger with fuzz testing.
2020-12-22 17:48:31 +00:00
MarcoFalke
9286b1cbce
Merge #20745: qa: Correct epoll_ctl data race suppression
d71e29e3e8 qa: Correct epoll_ctl data race suppression (Hennadii Stepanov)

Pull request description:

  Fixup of #20218. Comments must start from the beginning of the line.

ACKs for top commit:
  MarcoFalke:
    review ACK d71e29e3e8

Tree-SHA512: 4d8663ab505c347bcb62c2f118656e3343d5179825be0d1b86761ffdfdae1e7462002bf226a54dfc94be5885ce7f2633abaf70421ea35bf06eddad8e99fb9683
2020-12-22 18:22:53 +01:00
Hennadii Stepanov
d71e29e3e8
qa: Correct epoll_ctl data race suppression
Fixup of #20218. Comments must start from the beginning of the line.
2020-12-22 17:34:29 +02:00
MarcoFalke
df127ecede
Merge #19829: net processing: Move block inventory state to net_processing
3002b4af2b [net processing] Guard m_continuation_block with m_block_inv_mutex (John Newbery)
184557e8e0 [net processing] Move hashContinue to net processing (John Newbery)
c853ef002e scripted-diff: rename vBlockHashesToAnnounce and vInventoryBlockToSend (John Newbery)
53b7ac1b7d [net processing] Move block inventory data to Peer (John Newbery)
78040f9168 [net processing] Rename nStartingHeight to m_starting_height (John Newbery)
77a2c2f8f9 [net processing] Move nStartingHeight to Peer (John Newbery)
717a374e74 [net processing] Improve documentation for Peer destruction/locking (John Newbery)

Pull request description:

  This continues the work of moving application layer data into net_processing, by moving all block inventory state into the new Peer object added in #19607.

  For motivation, see #19398.

ACKs for top commit:
  jonatack:
    re-ACK 3002b4af2b per `git diff 9aad3e4 3002b4a`
  Sjors:
    Code review re-ACK 3002b4af2b
  MarcoFalke:
    re-ACK 3002b4af2b 🌓

Tree-SHA512: eb2b474b73b025791ee3e6e41809926b332b48468763219f31638ca390f427632f05902dfc6a2c6bdc1ce47b215782f67874ddbf05b97d77d5897b7e2abfe4d9
2020-12-22 12:44:19 +01:00
MarcoFalke
209974d379
Merge #20740: fuzz: Update FuzzedDataProvider.h from upstream (LLVM)
e3d2ba7c70 fuzz: Update FuzzedDataProvider.h from upstream (LLVM) (practicalswift)

Pull request description:

  Update `FuzzedDataProvider.h` from upstream (LLVM).

  Upstream revision: 6d0488f75b/compiler-rt/include/fuzzer/FuzzedDataProvider.h

  Changes since last update:
  * [[compiler-rt] FuzzedDataProvider: add ConsumeData and method.](20a604d3f5)
  * [[compiler-rt] Fix a typo in a comment in FuzzedDataProvider.h.](5517d3b80b)
  * [[compiler-rt] Add ConsumeRandomLengthString() version without arguments.](2136d17d8d)
  * [[compiler-rt] Refactor FuzzedDataProvider for better readability.](1262db1b6a)
  * [[compiler-rt] FuzzedDataProvider: make linter happy.](1e65209e04)
  * [[compiler-rt] Mark FDP non-template methods inline to avoid ODR violations.](6d0488f75b)

ACKs for top commit:
  MarcoFalke:
    ACK e3d2ba7c70 🌛

Tree-SHA512: 62cb27906f08fd07983f4a8fbbd381c12ed185617a58f1ebc8564c87e638086f952417f4f6481fbd91b9a313aff00e944215393734566c219c074512991f8057
2020-12-22 12:12:12 +01:00
practicalswift
e3d2ba7c70 fuzz: Update FuzzedDataProvider.h from upstream (LLVM)
Upstream revision: 6d0488f75b/compiler-rt/include/fuzzer/FuzzedDataProvider.h

Changes:
* [compiler-rt] FuzzedDataProvider: add ConsumeData and method.
* [compiler-rt] Fix a typo in a comment in FuzzedDataProvider.h.
* [compiler-rt] Add ConsumeRandomLengthString() version without arguments.
* [compiler-rt] Refactor FuzzedDataProvider for better readability.
* [compiler-rt] FuzzedDataProvider: make linter happy.
* [compiler-rt] Mark FDP non-template methods inline to avoid ODR violations.
2020-12-21 23:19:33 +00:00
Wladimir J. van der Laan
f4ac48d30a
Merge #20735: script: Remove outdated extract-osx-sdk.sh
1fbb8b6fa3 script: Remove outdated extract-osx-sdk.sh (Hennadii Stepanov)

Pull request description:

  The removed script was used to prepare `MacOSX10.11.sdk` which we do not use since 0.20 (7e2104433c from #16392).

  See https://github.com/bitcoin-core/docs/pull/68.

ACKs for top commit:
  laanwj:
    ACK 1fbb8b6fa3

Tree-SHA512: ab5128ec2c505a43b1a12e06abf38d8fa8f62a03efe760de2c842550e82f68ca512dee1b6c220a4f8af2465a9c35a429ca91cb179cc4ce016fcd87c61fbc8b07
2020-12-21 20:52:24 +01:00
Wladimir J. van der Laan
cc2a5ef9b2
Merge #20683: test: Fix restart node race
fab46b34f4 test: Fix restart node race (MarcoFalke)

Pull request description:

  It is not allowed to start a node before it has been fully stopped. Otherwise it could lead to intermittent issues due to access issues (e.g. cookie file https://cirrus-ci.com/task/6409665024098304?command=ci#L4793)

  Fix that by waiting for the node to fully stop.

ACKs for top commit:
  laanwj:
    code review ACK fab46b34f4

Tree-SHA512: 7605cac0573a7b04f05ff110d0131e8940d87f7baf6d698505ed16b363d4d15b1e552c5ffd1a187c8fe5639f7e265c3122734c85283275746e46bd789614fd21
2020-12-21 20:20:30 +01:00
MarcoFalke
2556a973ed
Merge #20731: rpc: Add missing description of vout in getrawtransaction help text
b23349b880 rpc: Add missing description of vout in getrawtransaction help text (Ben Carman)

Pull request description:

  In `getrawtransaction` the vout did not have a description. I gave it the same description as the one used in `decoderawtransaction`.

ACKs for top commit:
  MarcoFalke:
    ACK b23349b880 🏯

Tree-SHA512: 3833b97c82a46dfeb7ac825d4b2514b4b05ce54ac41f2144a8e2f2093b3411fe1d090c1e5b0c3d09200a2ea164c8d17ece12cdb43bbaeaeccc51a9da6dd7b7a3
2020-12-21 19:57:38 +01:00
MarcoFalke
1d7243d307
Merge #20737: test: Add missing assignment in mempool_resurrect.py
fada8b019a test: Add missing assignment in mempool_resurrect.py (MarcoFalke)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: f438d85cd14a91eabfc380d9ee120cc7a7f9103cf0cd1cf565f675f386f82d966901c0ad3f60b8c462642fbf0a3791dbbd774f9b07668d22b58eb575c8d702c1
2020-12-21 18:41:57 +01:00
Ben Carman
b23349b880
rpc: Add missing description of vout in getrawtransaction help text 2020-12-21 09:57:06 -06:00
MarcoFalke
fada8b019a
test: Add missing assignment in mempool_resurrect.py 2020-12-21 16:02:29 +01:00
MarcoFalke
1077c93a34
Merge #20692: test: run mempool_resurrect.py even with wallet disabled
11a32722f0 test: run mempool_resurrect.py even with wallet disabled (Michael Dietz)

Pull request description:

  Another functional test rewritten as proposed in #20078

  **Request for help:**
  `node.gettransaction(txid)` fails for transactions sent with `wallet.send_self_transfer`. Even though the `txid`s look correct, are added to the mempool correctly, and removed from the mempool when a block is mined - all as expected.

  However, `node.gettransaction(txid)` throws the error:
  ```sh
  Traceback (most recent call last):
    File "/Users/michaeldietz/Documents/bitcoin/test/functional/test_framework/test_framework.py", line 126, in main
      self.run_test()
    File "/Users/michaeldietz/Documents/bitcoin/test/functional/mempool_resurrect.py", line 43, in run_test
      assert_equal(len(list(filter(lambda txid: node.gettransaction(txid)["confirmations"] > 0, spends_ids))), len(spends_ids))
    File "/Users/michaeldietz/Documents/bitcoin/test/functional/mempool_resurrect.py", line 43, in <lambda>
      assert_equal(len(list(filter(lambda txid: node.gettransaction(txid)["confirmations"] > 0, spends_ids))), len(spends_ids))
    File "/Users/michaeldietz/Documents/bitcoin/test/functional/test_framework/coverage.py", line 47, in __call__
      return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    File "/Users/michaeldietz/Documents/bitcoin/test/functional/test_framework/authproxy.py", line 146, in __call__
      raise JSONRPCException(response['error'], status)
  test_framework.authproxy.JSONRPCException: Invalid or non-wallet transaction id (-5)
  ```

  Anyone know what's going wrong / can point me in the right direction if I'm making a mistake, or `MiniWallet` needs to be improved for this to work correctly?

ACKs for top commit:
  MarcoFalke:
    ACK 11a32722f0

Tree-SHA512: 13d83a13ec23920db716e99b68670e61329d1cc73b12063d85bc1679ee6425a9951da4d2e392ca1f27760be7be049ccdc6f504e192ed5cd24ed0ba003b66fab3
2020-12-21 15:23:57 +01:00
Hennadii Stepanov
1fbb8b6fa3
script: Remove outdated extract-osx-sdk.sh 2020-12-21 15:03:08 +02:00
Wladimir J. van der Laan
68c7acf6bb
Merge #20671: Replace boost::optional with std::optional
fa4435e22f Replace boost::optional with std::optional (MarcoFalke)
fa7e803f3e Remove unused MakeOptional (MarcoFalke)
fadd4029dc psbt: Assert that tx has a value in UpdatePSBTOutput (MarcoFalke)

Pull request description:

  Now that we can use std::optional from the vanilla standard library, drop the third-party boost dependency

ACKs for top commit:
  practicalswift:
    cr ACK fa4435e22f: patch looks correct!
  laanwj:
    code review ACK fa4435e22f
  hebasto:
    ACK fa4435e22f, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 50c5a1a130cac65e043e0177ba5b009fc2ba09343af4e23322ff2eb32184a55f8f2dea66e7a1b9d9acf56bc164eef4e47448750549a07f3b661199ac9bf9afef
2020-12-21 13:12:16 +01:00
MarcoFalke
f061da2887
Merge #20697: ci: Fix COMMIT_RANGE variable value for PRs
3c2478c385 ci: Print COMMIT_RANGE to the log as it was in Travis CI (Hennadii Stepanov)
c123892c2e ci: Drop Travis-specific workaround for shellcheck (Hennadii Stepanov)
10af252d97 ci: Drop Travis-specific way to set COMMIT_RANGE variable (Hennadii Stepanov)
93504da3a9 ci: Fix COMMIT_RANGE variable value for PRs (Hennadii Stepanov)

Pull request description:

  This PR:
  - is a #20658 and #20682  followup
  - set the `COMMIT_RANGE` variable correctly for PRs
  - cleans up Travis-specific code
  - prints COMMIT_RANGE value to the log for convenience as it was in Travis CI

ACKs for top commit:
  MarcoFalke:
    ACK 3c2478c385

Tree-SHA512: beb933352b10fd5eb3e66373ddb62439e4f3a03b50fb037ee89fa92c0706cec41d05f2d307f15bb18d1e634e6464f4e123b7e2f88703c8edfd145d8d6eff0b1a
2020-12-21 12:09:16 +01:00
Hennadii Stepanov
3c2478c385
ci: Print COMMIT_RANGE to the log as it was in Travis CI 2020-12-21 12:13:43 +02:00
Hennadii Stepanov
c123892c2e
ci: Drop Travis-specific workaround for shellcheck 2020-12-21 12:11:00 +02:00
Hennadii Stepanov
10af252d97
ci: Drop Travis-specific way to set COMMIT_RANGE variable 2020-12-21 12:10:59 +02:00
Hennadii Stepanov
93504da3a9
ci: Fix COMMIT_RANGE variable value for PRs 2020-12-21 12:10:43 +02:00
MarcoFalke
e9efb64a07
Merge #20733: inline non-member functions with body in fuzzing headers
d8b9cec25b inline non-member functions with body in fuzzing headers (Patrick Strateman)

Pull request description:

  Resolves the issue noted [here](https://github.com/bitcoin/bitcoin/pull/20560#issuecomment-748339644)

ACKs for top commit:
  MarcoFalke:
    ACK d8b9cec25b

Tree-SHA512: fb34707e2d2c5b664d4160e0e4b56e3df9fb2c9045da6ddea7139e0b4982262c4e085812a8543a6221febc9cd0815423b8287fec66baae3236e5f3339cc9df8c
2020-12-21 08:13:08 +01:00
Patrick Strateman
d8b9cec25b inline non-member functions with body in fuzzing headers 2020-12-20 18:19:43 -05:00
John Newbery
3002b4af2b [net processing] Guard m_continuation_block with m_block_inv_mutex 2020-12-20 10:06:14 +00:00
John Newbery
184557e8e0 [net processing] Move hashContinue to net processing
Also rename to m_continuation_block to better communicate meaning.
2020-12-20 10:03:38 +00:00
John Newbery
c853ef002e scripted-diff: rename vBlockHashesToAnnounce and vInventoryBlockToSend
-BEGIN VERIFY SCRIPT-
sed -i 's/vBlockHashesToAnnounce/m_blocks_for_headers_relay/g' src/net_processing.*
sed -i 's/vInventoryBlockToSend/m_blocks_for_inv_relay/g' src/net_processing.*
-END VERIFY SCRIPT-
2020-12-20 10:01:48 +00:00
John Newbery
53b7ac1b7d [net processing] Move block inventory data to Peer 2020-12-20 10:01:48 +00:00
John Newbery
78040f9168 [net processing] Rename nStartingHeight to m_starting_height
Not done as a scripted diff to avoid misnaming the local variable in
ProcessMessage().
2020-12-20 10:01:46 +00:00
John Newbery
77a2c2f8f9 [net processing] Move nStartingHeight to Peer 2020-12-20 10:01:26 +00:00
John Newbery
717a374e74 [net processing] Improve documentation for Peer destruction/locking
Suggested here:

- https://github.com/bitcoin/bitcoin/pull/19607#discussion_r467071878
- https://github.com/bitcoin/bitcoin/pull/19829#discussion_r546116786
2020-12-19 14:49:03 +00:00
MarcoFalke
fa4435e22f
Replace boost::optional with std::optional 2020-12-19 09:46:55 +01:00
MarcoFalke
fa7e803f3e
Remove unused MakeOptional
The only use was to work around a compiler warning in an ancient
compiler, which we no longer support.
2020-12-19 09:45:58 +01:00
MarcoFalke
fadd4029dc
psbt: Assert that tx has a value in UpdatePSBTOutput
This was previously done implicitly in boost::optional by BOOST_ASSERT.
Also, it was checked at runtime by valgrind if for some reason the
assert was disabled.

std::optional dereference won't assert, so add the Assert here
explicitly.

The explicit Assert also helps to document the code better.
2020-12-19 09:45:39 +01:00
Wladimir J. van der Laan
f1dbf92ff0
Merge #20434: contrib: Parse ELF directly for symbol and security checks
a0a771843f contrib: Changes to checks for PowerPC64 (Luke Dashjr)
634f6ec4eb contrib: Parse ELF directly for symbol and security checks (Wladimir J. van der Laan)

Pull request description:

  Instead of the ever-messier text parsing of the output of the readelf tool (which is clearly meant for human consumption not to be machine parseable), parse the ELF binaries directly.

  Add a small dependency-less ELF parser specific to the checks.

  This is slightly more secure, too, because it removes potential ambiguity due to misparsing and changes in the output format of `elfread`. It also allows for stricter and more specific ELF format checks in the future.

  This removes the build-time dependency for `readelf`.

  It passes the test-security-check for me locally, ~~though I haven't checked on all platforms~~. I've checked that this works on the cross-compile output for all ELF platforms supported by Bitcoin Core at the moment, as well as PPC64 LE and BE.

Top commit has no ACKs.

Tree-SHA512: 7f9241fec83ee512642fecf5afd90546964561efd8c8c0f99826dcf6660604a4db2b7255e1afb1e9bb0211fd06f5dbad18a6175dfc03e39761a40025118e7bfc
2020-12-18 12:16:40 +01:00
MarcoFalke
83e4670fd7
Merge #20690: Clean up logging of outbound connection type
6d1e85f475 Clean up logging of outbound connection type (Suhas Daftuar)

Pull request description:

  We have a function that converts `ConnectionType` enums to strings, so use it.

  Suggested by ajtowns in https://github.com/bitcoin/bitcoin/pull/19858#discussion_r540791588

ACKs for top commit:
  amitiuttarwar:
    ACK 6d1e85f475
  naumenkogs:
    ACK 6d1e85f

Tree-SHA512: f5084d8b5257380696d9fde86a8873e190cd4553feb07fa49df39bbd9510bf5832d190a3bca1571c48370d16a17c7a34900857b21b27bec0777bfa710211d7bb
2020-12-18 10:02:55 +01:00
MarcoFalke
20f4a9421b
Merge #20682: ci: Install missing lint packages
faeb40bee3 ci: Install missing lint packages (MarcoFalke)

Pull request description:

  The cirrus container is vanilla ubuntu, so we need to install the needed packages

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

Tree-SHA512: e56198108e26ea0ba2a344b1b74bc294652f34e9866cca053a25fb1b83bbd87ea40254c340e5e169fdfcbd4dcb39fdc2078b5157ca729a22a9a1792ec514a33e
2020-12-18 09:53:38 +01:00
MarcoFalke
3dd3f7c0af
Merge bitcoin-core/gui#155: Fix checkbox layout in Create Wallet dialog
e71b656f31 qt: Align layout of checkboxes (Hennadii Stepanov)

Pull request description:

  From https://github.com/bitcoin/bitcoin/issues/20555#issuecomment-747742627:
  > 0.21.0rc3 compiled from source, Ubuntu 20.04 + i3: tested mainnet, testnet, and signet. created a descriptor wallet in qt, tested torv3 with addnode, and checked if anchors.dat is created on shutdown and removed on startup.
  >
  > I've noticed the "Advanced options" label being cut-off in the wallet creation dialog.

  This PR should fix this issue.

ACKs for top commit:
  MarcoFalke:
    review ACK e71b656f31

Tree-SHA512: dcc997a440a96fc936296323afaf9f4040ac06cf5ad32724a88c2e2e16c726c35b1b2bacbb3e081839d8a69b5a6086b2570d6b2e98976f29b5427db2d434eee9
2020-12-18 08:53:38 +01:00
MarcoFalke
b27104dc52
Merge #20687: wallet: Add missing check for -descriptors wallet tool option
fae32f295c wallet: Add missing check for -descriptors wallet tool option (MarcoFalke)
faf8f61368 test: Add missing check for is_sqlite_compiled (MarcoFalke)
fa7dde1c41 wallet: Pass ArgsManager into ExecuteWalletToolFunc instead of using global (MarcoFalke)

Pull request description:

  Also, fix a test failure when compiled without sqlite

ACKs for top commit:
  ryanofsky:
    Code review ACK fae32f295c. Thanks for implementing the -descriptors check and dealing with the test failure!
  jonatack:
    Code review utACK fae32f295c

Tree-SHA512: 3d7710694085822739a8316e4abc6db270799ca6ff6b0f9e5563ae240da65ae6a9cab7ba2647feae6ba540dac40b55b38ed41c8f6ed0bf02a3d1536284448927
2020-12-18 07:56:15 +01:00
MarcoFalke
faeb40bee3
ci: Install missing lint packages
Also merge script into ci/lint_run_all.sh because env vars weren't
exported properly
2020-12-18 07:40:57 +01:00
MarcoFalke
9b28bd73a3
Merge #20691: ci, doc: Travis CI features and mentions cleanup
95487b0553 doc: Drop mentions of Travis CI as it is no longer used (Hennadii Stepanov)
09d105ef0f ci: Drop travis_fold feature as Travis CI is no longer used (Hennadii Stepanov)

Pull request description:

  As Travis CI is no longer used, this PR:
  - drops `travis_fold` feature
  - drops mentions of Travis CI in docs

ACKs for top commit:
  MarcoFalke:
    ACK 95487b0553

Tree-SHA512: 2e259bb8b1e37bcefc1251737bb2716f06ddb57c490010b373825c4e70f42ca38efae69a2f63f21f577d7cee3725b94097bdddbd313f8ebf499281cf97c53cef
2020-12-18 07:32:28 +01:00
Michael Dietz
11a32722f0
test: run mempool_resurrect.py even with wallet disabled 2020-12-17 21:37:07 -06:00
Hennadii Stepanov
e71b656f31
qt: Align layout of checkboxes 2020-12-18 01:36:21 +02:00
Hennadii Stepanov
95487b0553
doc: Drop mentions of Travis CI as it is no longer used 2020-12-18 01:15:53 +02:00
Wladimir J. van der Laan
816314ef0f
Merge #20644: Add patch to make codesign_allocate compatible with Apple's
a4118c6e20 Add patch to make codesign_allocate compatible with Apple's (Pieter Wuille)

Pull request description:

  This is an alternative to #20638.

  The problem is that Apple's codesign(_allocate) apparently rounds the "vmsize" attribute on the __LINKEDIT section to a multiple of 0x2000 on x86_64 rather than 0x1000 (as their published source code does). This divergence means that the binary signed by codesign is slightly different from the one recreated by our reattach-sig-to-gitian-output process, and the signature being invalid.

  This fixes it by patching our codesign_allocate source code to also use 0x2000. In tests, this appears to result in matching binaries.

ACKs for top commit:
  jonasschnelli:
    Tested ACK a4118c6e20 - removed the osx cache, built commit a4118c6e20 for osx in gitian (dependency where built, patch was applied), signed on my signing mac (detach-sig-create), ran gitian osx signer with the produces signature and the a4118c6e20 build (detach-sig-apply), signature then was successful verified on my Mac (codesign -v /Volumes/Bitcoin-Core/Bitcoin-Qt.app)
  MarcoFalke:
    Concept ACK a4118c6e20

Tree-SHA512: 07b8cdf8216249ddfe4bd38b39f2b48b2e190d4002b84d8981e62197bbbc9f25ac5c137bcc32057b23fbf38cbb2889ef95101ce008edfbf608cd170b88b3acbc
2020-12-17 21:34:35 +01:00
Hennadii Stepanov
09d105ef0f
ci: Drop travis_fold feature as Travis CI is no longer used 2020-12-17 22:02:12 +02:00
MarcoFalke
fae32f295c
wallet: Add missing check for -descriptors wallet tool option 2020-12-17 20:36:41 +01:00
MarcoFalke
faf8f61368
test: Add missing check for is_sqlite_compiled 2020-12-17 20:33:45 +01:00
Suhas Daftuar
6d1e85f475 Clean up logging of outbound connection type 2020-12-17 14:00:42 -05:00
Jon Atack
86c495223f
net: add CNode::IsInboundOnion() public getter and unit tests 2020-12-17 19:56:12 +01:00