Commit graph

33029 commits

Author SHA1 Message Date
Sebastian Falbesoner
2b6dd4e75b test: use MiniWallet for mempool_package_onemore.py
This test can now be run even with the Bitcoin Core wallet disabled.
2022-03-22 18:44:27 +01:00
Sebastian Falbesoner
eb3c5c4ef2 test: MiniWallet: add helper methods {send,create}_self_transfer_multi 2022-03-22 18:43:51 +01:00
fanquake
44dbf918d3
Merge bitcoin/bitcoin#24627: test: Limit scope of id global which is shared between subtests
fa9086d085 test: Limit scope of id global which is shared between subtests (MarcoFalke)

Pull request description:

  Globals aren't too nice when testing, as leak state between subtests run in the same process. For example, when checking peer ids in the tests, they might pass/fail depending on other tests run in the same process.

  Fix this by making `id` not a global.

ACKs for top commit:
  promag:
    Code review ACK fa9086d085.

Tree-SHA512: 0a53dde428570086f4557b23112e6460d6413bedf6ef487bd56e88f83cd5f4526f44effa8076cdeaf4761ecc062c346948e0bff434808bbf9b558eabd81328e3
2022-03-22 09:02:34 +00:00
MarcoFalke
138d55e6a0
Merge bitcoin/bitcoin#24579: doc: Fix getblockchaininfo/getdeploymentinfo RPC docs
facd5d92e1 doc: Fix getblockchaininfo/getdeploymentinfo RPC docs (MarcoFalke)

Pull request description:

  Also, fix whitespace to be `4` spaces. Can be reviewed with `--ignore-all-space --word-diff-regex=.`.

  Found by https://github.com/bitcoin/bitcoin/pull/23083

ACKs for top commit:
  luke-jr:
    crACK facd5d92e1

Tree-SHA512: 113228a6b140009cecd9068fb634d352148670589f647350e41c02a35e0ca306b4a2d3f2588cd9ef14a2ab7d1f23d0d2f83b5ebb00b60f17a1d16a8d71386fd2
2022-03-22 09:16:24 +01:00
MarcoFalke
b8f498f80d
Merge bitcoin/bitcoin#24535: test: Fix generate calls and comments in feature_segwit
fa8593f898 test: Fix generate calls and comments in feature_segwit (MarcoFalke)

Pull request description:

  There are currently a few incorrect comments: Block `432` is mined "twice" (The second one is actually 433).

  There isn't any need to mine this many blocks anyway, so remove a few calls.

ACKs for top commit:
  theStack:
    Tested ACK fa8593f898

Tree-SHA512: b034077b85e6c978a80aa4de493797b4ae451d686cfb3e4fe40f37a38f41f7cb886f8e00a1c245a284be3502164b17414097fcb0bef66d155a1c1db5cfbe9e8f
2022-03-22 09:10:55 +01:00
MarcoFalke
e3206c9445
Merge bitcoin/bitcoin#24605: test: Use MiniWallet in feature_coinstatsindex
fa48ea3067 Use MiniWallet in feature_coinstatsindex (MarcoFalke)
fab61437f6 test: Refactor MiniWallet get_utxo helper (MarcoFalke)

Pull request description:

  Allows the test to be run even without a wallet compiled

ACKs for top commit:
  josibake:
    ACK fa48ea3067
  ayush933:
    tACK  fa48ea3 . The test runs successfully with the wallet disabled.
  willcl-ark:
    tACK fa48ea3067 both with and without wallet compiled in.

Tree-SHA512: e04e04ea0f236c062d6be68909ece2770130ce1d5343823893073d95aebc6eedb1ad1dc5bc41e5b0cb0bf2cd9018bb1d668f0e7f5f1101ed4e0b007ed6b00f69
2022-03-22 07:56:29 +01:00
Andrew Chow
e66630cc87
Merge bitcoin/bitcoin#13226: Optimize SelectCoinsBnB by tracking the selection by index rather than by position
9d2005285c doc: Revise comments and whitespace to clarify (Ben Woosley)
def43a4d88 refactor: Rename i to curr_try in SelectCoinsBnB (Ben Woosley)
1dd0923677 refactor: Track BnB selection by index (Ben Woosley)

Pull request description:

  This is prompted by #13167 and presented as a friendly alternative to it.

  IMO you can improve code readability and performance by about 20% by tracking the selected utxos by index, rather than by position. This reduces the storage access complexity from roughly O(utxo_size) to O(selection_size).

  On my machine (median of 5 trials):
  ```
  BnBExhaustion, 5, 650, 2.2564, 0.000672999, 0.000711565, 0.000693112 - master
  BnBExhaustion, 5, 650, 1.76232, 0.000528563, 0.000568806, 0.000539147 - this PR
  ```

ACKs for top commit:
  achow101:
    reACK 9d2005285c
  glozow:
    code review ACK 9d2005285c
  Xekyo:
    reACK 9d2005285c

Tree-SHA512: 453ea11ad58c48928dc76956e3e98916f6924e95510eb02fe89a899ff102fe9cc08a04d557f381ad0218a210275e5383101d971c1ffad38b06b1c57d81144315
2022-03-21 17:44:54 -04:00
MarcoFalke
fa9086d085
test: Limit scope of id global which is shared between subtests
This is needed to use ASSERT_DEBUG_LOG, which may include a fixed node
number
2022-03-21 16:27:44 +01:00
fanquake
91d12344b1
Merge bitcoin/bitcoin#24613: build: remove unused QMAKE_* VARs
3a463992b9 build: remove unused QMAKE_* VARs (fanquake)

Pull request description:

  As far as I can gather Qts build system doesn't respect either of these
  variables (there is a `QMAKE_LIBTOOL_LIBDIR`).

  Guix Build:
  ```bash
  bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  dd12aaea98cfaa85a7d4b2e0cd8c4c01766ad47cb2d41a516073b7e0304ccab1  guix-build-3a463992b981/output/aarch64-linux-gnu/SHA256SUMS.part
  7107fce198c238c6b88a58574be5cfd77ac2aa8176488738671c4873a21e1efe  guix-build-3a463992b981/output/aarch64-linux-gnu/bitcoin-3a463992b981-aarch64-linux-gnu-debug.tar.gz
  2fe573897994e9dbb4a5123045e86ed3fefbf3381eddb5f17f2034aecb5adb80  guix-build-3a463992b981/output/aarch64-linux-gnu/bitcoin-3a463992b981-aarch64-linux-gnu.tar.gz
  250246aef50a752d56a63a58978cd95555a4e4447b83577615e85cfee30003b6  guix-build-3a463992b981/output/arm-linux-gnueabihf/SHA256SUMS.part
  4e07018fcb47d0674b4dc598c23179f05124e9cf70e8dd229ef74542d3b106a3  guix-build-3a463992b981/output/arm-linux-gnueabihf/bitcoin-3a463992b981-arm-linux-gnueabihf-debug.tar.gz
  649115440ff109d427718aa8468ef65f50ac50edf5722c233dad2fb9e90d4af6  guix-build-3a463992b981/output/arm-linux-gnueabihf/bitcoin-3a463992b981-arm-linux-gnueabihf.tar.gz
  3f5dae095c718854ae2de1dcbc88a91b14cdb13adb9a7bd5e2a08bf006a1bca9  guix-build-3a463992b981/output/arm64-apple-darwin/SHA256SUMS.part
  e8f546db5bc14452a50041d46711160d4f4d4fd7b93092a20cdb96a3549f92d2  guix-build-3a463992b981/output/arm64-apple-darwin/bitcoin-3a463992b981-arm64-apple-darwin-unsigned.dmg
  5f1c9695d1ef286b8b779b8ae76af8dfe45d31ce9b081122d1d5594c21c73de2  guix-build-3a463992b981/output/arm64-apple-darwin/bitcoin-3a463992b981-arm64-apple-darwin-unsigned.tar.gz
  5eccb71d8c0c0b0806bf8858079d7a8b626d23446ba6b09920b0118debea6b88  guix-build-3a463992b981/output/arm64-apple-darwin/bitcoin-3a463992b981-arm64-apple-darwin.tar.gz
  59c52d0190ad6182ffb5ca7124d05e9a18df4472db2662fe4dada7636f0b93c4  guix-build-3a463992b981/output/dist-archive/bitcoin-3a463992b981.tar.gz
  bb5b090610c2200223fbb3ac18bd274f3ac5cbbf0b122b520645b1945f03e7f1  guix-build-3a463992b981/output/powerpc64-linux-gnu/SHA256SUMS.part
  4e76e3e933ac1cad56ef8a970c7dc617a57bbd46d1c13554455f6ed72114d7d3  guix-build-3a463992b981/output/powerpc64-linux-gnu/bitcoin-3a463992b981-powerpc64-linux-gnu-debug.tar.gz
  2039d619824f4678367e71ca1a09c2dcd01ba4fca0151193235e991fec927cf2  guix-build-3a463992b981/output/powerpc64-linux-gnu/bitcoin-3a463992b981-powerpc64-linux-gnu.tar.gz
  9023d223c41a82907b5cea5f011b16b9ac83155d7c152315576339dd78d2ed7b  guix-build-3a463992b981/output/powerpc64le-linux-gnu/SHA256SUMS.part
  35d374257124b4c8bc59f938dbc9428f4c45fd38a45e29f9afa4c31fb129c593  guix-build-3a463992b981/output/powerpc64le-linux-gnu/bitcoin-3a463992b981-powerpc64le-linux-gnu-debug.tar.gz
  aee514d913c905c153ec06a20521fa5698096e94e124f2262a16bba3bf7dc0fb  guix-build-3a463992b981/output/powerpc64le-linux-gnu/bitcoin-3a463992b981-powerpc64le-linux-gnu.tar.gz
  39ca1e06c8ef5086055242286e58c096965494ce050b7780171492fcbc6c78e1  guix-build-3a463992b981/output/riscv64-linux-gnu/SHA256SUMS.part
  f92412fdf3566518dc16a03a24eaa00e82550ad0f7f0ef14e2d4772f69ff8496  guix-build-3a463992b981/output/riscv64-linux-gnu/bitcoin-3a463992b981-riscv64-linux-gnu-debug.tar.gz
  11c0a55d760f422135c3a5c9e3b7acdec4a1e001dde47e4830f9a64e39cea13c  guix-build-3a463992b981/output/riscv64-linux-gnu/bitcoin-3a463992b981-riscv64-linux-gnu.tar.gz
  c0a4bfb7f3b62bbe9b3e0e8dc05395e72d31a151038a5278acf78c5f3abd1b30  guix-build-3a463992b981/output/x86_64-apple-darwin/SHA256SUMS.part
  3c6a8e2b91b66cbdbf811251e95ae2a68604fc0f442695211727b6f740e303f9  guix-build-3a463992b981/output/x86_64-apple-darwin/bitcoin-3a463992b981-x86_64-apple-darwin-unsigned.dmg
  2d0b0b0615d83ef4c876fd99628e2d21b57acef0f1dc2ee175d0c0c3786dc63c  guix-build-3a463992b981/output/x86_64-apple-darwin/bitcoin-3a463992b981-x86_64-apple-darwin-unsigned.tar.gz
  e4c123cc6c848d342154cf6f47518465ab0238e8779f5d253095cf429eb2cafb  guix-build-3a463992b981/output/x86_64-apple-darwin/bitcoin-3a463992b981-x86_64-apple-darwin.tar.gz
  4f6801b93e458f59611e40d725eb910720ef91cb6dc5052f8b314df2b892e5f8  guix-build-3a463992b981/output/x86_64-linux-gnu/SHA256SUMS.part
  5a60dab96f4db45facd0d0f126803f3af864eb0fe6bfdb338deb89a28d22c857  guix-build-3a463992b981/output/x86_64-linux-gnu/bitcoin-3a463992b981-x86_64-linux-gnu-debug.tar.gz
  949185ab779c0f7199a468fb384636de30e8f689173c797dec0ab51eb67e6120  guix-build-3a463992b981/output/x86_64-linux-gnu/bitcoin-3a463992b981-x86_64-linux-gnu.tar.gz
  ffc2e51b928c6f76ee678cbf8291c5dce00a221c5241d88fcd449dbdfc2b0861  guix-build-3a463992b981/output/x86_64-w64-mingw32/SHA256SUMS.part
  2ba59ab5a27249ab06a396401633ff9fb688b02fb364a39edad4d3120e3f02aa  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64-debug.zip
  17378a06f3ae08cd50f840bf8279b4a54ef587da69080ad59a5948799af47eda  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64-setup-unsigned.exe
  89e1929c669e9d62dae804f65a886eae8ff7fdf7fe8ba965c57ba9ebaf84e7ff  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64-unsigned.tar.gz
  7ec3021e84296632182261d3017a9e25c4573013d61fb2a13c9ec46ef35a1e59  guix-build-3a463992b981/output/x86_64-w64-mingw32/bitcoin-3a463992b981-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 3a463992b9

Tree-SHA512: 3b21129e2f30f9ddd977741216876b89dc151fe27a7ae0608bbd6d8f2cbf7f1e93967c34c0674cd01074abe07af6195b11e8b1d7bef2ede8573c5babadf774d4
2022-03-21 09:09:30 +00:00
MarcoFalke
6c72f3192a
Merge bitcoin/bitcoin#23880: p2p: Serialize cmpctblock at most once in NewPoWValidBlock
fa61dd44f9 p2p: Serialize cmpctblock at most once in NewPoWValidBlock (MarcoFalke)

Pull request description:

  Instead of serializing for each peer, serialize at most once and copy the raw data for each peer.

ACKs for top commit:
  shaavan:
    reACK fa61dd44f9
  theStack:
    Code-review ACK fa61dd44f9

Tree-SHA512: ed029aeaea67fdac8ddb865069f8166bc0dd8480418c405628e3e1a43b61161584a09a1814668bcd220602e8732e188be2bfed9242aa81bdbd92c64c702ed138
2022-03-21 10:00:40 +01:00
MarcoFalke
75e34ed718
Merge bitcoin/bitcoin#24601: ci: add ci/scratch dir to .gitignore
702759588d add ci/scratch dir to gitignore (josibake)

Pull request description:

  Not sure if I'm missing some context as to why this isn't already ignored?

ACKs for top commit:
  hebasto:
    re-ACK 702759588d, tested on Ubuntu 22.04.

Tree-SHA512: 1f13041cb27cd3687619105ac1bb3af4c31d000fcd98e5f84160c34649de532fcd8b98cb8a5bed0ba68e25b3bb344f669ea3567b9c9d86cf73386ddf276f292e
2022-03-21 09:04:45 +01:00
Hennadii Stepanov
ae005a647f
Merge bitcoin-core/gui#554: Add and improve translator comments and tooltips for peers tab address fields
4d2b503d6c gui: improve "Addresses Rate-Limited" translator comments and tooltip in peers tab (Jon Atack)
81ef1f7ef1 gui: improve "Addresses Processed" translator comments and tooltip in peers tab (Jon Atack)
77f24aac52 gui: improve "Address Relay" translator comments and tooltip in peers tab (Jon Atack)

Pull request description:

  Per translator feedback in this thread: https://github.com/bitcoin-core/gui/pull/526#discussion_r809237830

  *"The lack of string context in Transifex is a real problem for this project, as proper context (dev notes and/or screenshots) are essential to achieve quality translations."*

  This pull adds developer notes for transifex translators via `extracomment` tags, and it improves the existing ones and their tooltips with more context, clarity and completeness for the following peer tab fields as a follow-up to bitcoin-core/gui#526:

  - address relay
  - addresses processed
  - addressed rate-limited

  It looks like only six lines of diff, but they are loooong lines.

  If this is the right direction, the same can be done for other fields in follow-ups.

ACKs for top commit:
  jarolrod:
    re-ACK [4d2b503](4d2b503d6c)
  hebasto:
    ACK 4d2b503d6c, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: a185f46a66375a5fd6854640745b7d1d00740cf7be58db03256f44d71acc351e1770de137cb3bc9c1f0ea3cabd7cfa1cb1ccb87ec0df222680924ca3dab6c8bf
2022-03-20 09:38:41 +01:00
fanquake
2320d31aaa
Merge bitcoin/bitcoin#24608: doc: clarify that BDB is only required for the legacy wallet in build-unix.md
307215b6c5 doc: clarify that BDB is only required for the legacy wallet (fanquake)

Pull request description:

ACKs for top commit:
  gruve-p:
    ACK 307215b6c5
  darosior:
    ACK 307215b6c5

Tree-SHA512: d77d013831e3e76a596603fbea80958c1cf4d3e65591debd66cd4f5ff77300dae7e81df8e7d79f3f4d2e561bb3e8090434b704586e2568ca8e89ba8196de173c
2022-03-18 18:18:51 +00:00
MarcoFalke
fa8593f898
test: Fix generate calls and comments in feature_segwit 2022-03-18 16:23:43 +01:00
josibake
702759588d
add ci/scratch dir to gitignore 2022-03-18 14:47:17 +01:00
MarcoFalke
66e2d21ef2
Merge bitcoin/bitcoin#24578: test: Fix intermittent failure in feature_segwit
d6b24e14d2 test: Fix intermittent failure in feature_segwit (DrahtBot)

Pull request description:

  There are intermittent failures on current master (https://github.com/bitcoin/bitcoin/pull/24421#issuecomment-1067451667) as the witness txs occasionally make it into other node's mempools when they shouldn't.

  Fix this by removing the test as suggested earlier in https://github.com/bitcoin/bitcoin/pull/24421#discussion_r822933721.

  Fixes https://github.com/bitcoin/bitcoin/issues/24590

ACKs for top commit:
  aureleoules:
    tACK d6b24e14d2.
  jnewbery:
    Code review ACK d6b24e14d2

Tree-SHA512: ef7be52bdbde97b6921b44824e7fbc2dd92b77b8f076794867259f2b0bff08e0def06f4b2576f63a8ccb737a15cd8441fb7db20fa1f0d4fa9c7c76d5b83388ef
2022-03-18 14:14:06 +01:00
MarcoFalke
a7b3123fea
Merge bitcoin/bitcoin#24609: Clarify -maxtimeadjustment that only outbound peers influence timedata
1bba72d824 Clarify in -maxtimeadjustment that only outbound peers influence time data (Jon Atack)

Pull request description:

  #23631 changed our adjusted time to only take into account time from outbound peers.

  Update `-maxtimeadjustment` to clarify this for users.

ACKs for top commit:
  MarcoFalke:
    cr ACK 1bba72d824
  mzumsande:
    code Review ACK 1bba72d824
  brunoerg:
    crACK 1bba72d824

Tree-SHA512: ad610ab3038fb83134e21d31cca952ef9ac926e88992ff93023b7010f2499f9a4d952e8e98a0ec56f8949872d966e5ffdd01a81e6b6115768f1992bd81be7a56
2022-03-18 14:10:15 +01:00
Jon Atack
1bba72d824
Clarify in -maxtimeadjustment that only outbound peers influence time data 2022-03-18 12:32:34 +01:00
fanquake
3a463992b9
build: remove unused QMAKE_* VARs
As far as I can gather Qts build system doesn't respect either of these
variables (there is a QMAKE_LIBTOOL_LIBDIR).
2022-03-18 10:38:45 +00:00
fanquake
307215b6c5
doc: clarify that BDB is only required for the legacy wallet 2022-03-18 10:27:49 +00:00
fanquake
a17df4e876
Merge bitcoin/bitcoin#24603: macdeploy: remove unused detached-sig-apply.sh
979271a5d9 macdeploy: remove unused detached-sig-apply (fanquake)

Pull request description:

  Signature application is now done with signapple.

  8435d7f11a/contrib/guix/libexec/codesign.sh (L84-L85)

ACKs for top commit:
  laanwj:
    ACK 979271a5d9
  gruve-p:
    ACK 979271a5d9
  achow101:
    ACK 979271a5d9
  hebasto:
    ACK 979271a5d9, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: ab51a609d00cead4f33bcfc5b5ff1008ee02363ab1f4c4bf9544631069c237bfa92eac4dfa231bff8a1d702bda6cc92b4151361f74f58e77b595e0cb82a8391a
2022-03-18 09:53:48 +00:00
MarcoFalke
e09cf64c48
Merge bitcoin/bitcoin#24585: doc: mention that BDB is for the legacy wallet in build-osx.md
57f3f5cecf doc: s/Compiler/Dependency in dependencies.md (fanquake)
bf846779ca doc: cleanup wallet docs in build-osx.md (fanquake)

Pull request description:

  Re-order legacy and descriptor wallet section.
  Installing sqlite isn't required (the version pre-installed on macOS is just as good as what will be installed via `brew`).
  Remove prelude that pointlessly repeats the same info.

  Basically the macOS version of #23446.

  Includes a small fixup from #23565.

ACKs for top commit:
  RandyMcMillan:
    ACK 57f3f5c
  hebasto:
    ACK 57f3f5cecf, I have reviewed the changes and they look OK, I agree they can be merged.

Tree-SHA512: a1ca5f73aa4f4f56de747fd9669bce572c1d7d23925afb47b5d963314df1738762ea26428c040e9c706d288eb7e775227d2387a322cda065885b89c6a619314f
2022-03-17 21:13:39 +01:00
MarcoFalke
fa48ea3067
Use MiniWallet in feature_coinstatsindex 2022-03-17 20:49:10 +01:00
MarcoFalke
fab61437f6
test: Refactor MiniWallet get_utxo helper 2022-03-17 20:48:43 +01:00
fanquake
979271a5d9
macdeploy: remove unused detached-sig-apply
Signature application is now done with signapple.
2022-03-17 12:38:36 +00:00
fanquake
8435d7f11a
Merge bitcoin/bitcoin#24597: doc, guix: Include arm64-apple-darwin into codesigned archs
1f4801b6b1 doc, guix: Include arm64-apple-darwin into codesigned archs (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK 1f4801b6b1

Tree-SHA512: 6e0d5f463a97d3a87ce2c503a97762bd756ae44e1b8d343477de68fa4188f9be44752484a60ee08db389567ca456efb7789635ab921197b33eed974d0cee2f0b
2022-03-17 08:37:45 +00:00
Hennadii Stepanov
1f4801b6b1
doc, guix: Include arm64-apple-darwin into codesigned archs 2022-03-17 08:55:07 +01:00
MarcoFalke
bf2c0fb2a2
Merge bitcoin/bitcoin#24472: fuzz: execute each file in dir without fuzz engine
f59bee3fb2 fuzz: execute each file in dir without fuzz engine (Anthony Towns)

Pull request description:

  Phony fuzzing (phuzzing)! Run the fuzz testing code against known inputs to detect errors. Advantage is you can easily test using the existing qa-assets datasets without having to compile with fuzzing enabled; disadvantage is that it doesn't do any actual fuzzing.

  Example usage:

  ```
  $ for a in ${QA_ASSETS}/fuzz_seed_corpus/*; do echo ${a##*/}; done | xargs -P8 -I {} /bin/sh -c "FUZZ={} test/fuzz/fuzz ${QA_ASSETS}/fuzz_seed_corpus/{}"
  No fuzzer for address_deserialize.
  No fuzzer for addrdb.
  No fuzzer for banentry_deserialize.
  addition_overflow: succeeded against 848 files in 0s.
  asmap: succeeded against 981 files in 0s.
  checkqueue: succeeded against 211 files in 0s.
  ...
  ```

  (`-P8` says run 8 of the tasks in parallel)

  If there are failures, the first one will be reported and the program will abort with output like:

  ```
  fuzz: test/fuzz/versionbits.cpp:336: void (anonymous namespace)::versionbits_fuzz_target(FuzzBufferType): Assertion `exp_state != ThresholdState::FAILED' failed.
  Error processing seed "corpus/versionbits/35345ae8e722234095810b1117a29b63af7621af"
  ```

  Rebase of #22763, which was a rebase of #21496, but also reports the name of the fuzzer and the time taken.

  Fixes #21461

Top commit has no ACKs.

Tree-SHA512: d8d046d4a309652eb13de42116276bf992480bc887ad3535a8ff18b354cb24826bc562b06af63802ec945c637f046563b6a5601d6321b46a5543127daafea09b
2022-03-17 08:26:57 +01:00
MarcoFalke
601bfc417d
Merge bitcoin/bitcoin#24515: Only load BlockMan in BlockMan member functions
f865cf8ded Add and use BlockManager::GetAllBlockIndices (Carl Dong)
28ba0313ea Add and use CBlockIndexHeightOnlyComparator (Carl Dong)
12eb05df63 move-only: Move CBlockIndexWorkComparator to blockstorage (Carl Dong)
c600ee3816 Only load BlockMan in BlockMan member functions (Carl Dong)
42e56d9b18 style-only: No need for std::pair for vSortedByHeight (Carl Dong)
3bbb6fea05 style-only: Various blockstorage.cpp cleanups (Carl Dong)
5be9ee3c54 refactor: more const annotations for uses of CBlockIndex* (Anthony Towns)

Pull request description:

  The only important commit is "Only load BlockMan in BlockMan member functions", everything else is all just small style changes.

  Here's the commit message, reproduced:
  ```
  This commit effectively splits the "load block index itself" logic from
  "derive Chainstate variables from loaded block index" logic.

  This means that BlockManager::LoadBlockIndex{,DB} will only load what's
  relevant to the BlockManager.
  ```

ACKs for top commit:
  ajtowns:
    ACK f865cf8ded ; code review only
  MarcoFalke:
    review ACK f865cf8ded 🗂

Tree-SHA512: 7b204d782834e06fd7329d022e2ae860181b4e8105c33bfb928539a4ec24161dc7438a9c4d4ee279dcad77de310c160b997bb8aa18923243d0fd55ccf4ad7c3a
2022-03-17 07:23:43 +01:00
Hennadii Stepanov
aece566249
Merge bitcoin-core/gui#555: Restore Send button when using external signer
2efdfb88aa gui: restore Send for external signer (Sjors Provoost)
4b5a6cd149 refactor: helper function signWithExternalSigner() (Sjors Provoost)
026b5b4523 move-only: helper function to present PSBT (Sjors Provoost)

Pull request description:

  Fixes #551

  For the simplest use case of a wallet with one external signer and "PSBT Controls" disabled in settings (the default), the send dialog will behave the same as when using a wallet with private keys. I.e. there's no "Create Unsigned" button.

  When PSBT controls are turned on, you can now actually make a PSBT with signing it; before this PR that button would trigger a sign event and would broadcast the transaction.

  In case a multisig, the Send button will sign on the device, and then fall back to presenting a PSBT (same behavior as before #441).

  This PR starts with two refactoring commits to move some stuff into a helper function for improved readability in general, and to make the main commit easier to review.

ACKs for top commit:
  jonatack:
    utACK 2efdfb88aa diff review since my last review, code re-review, rebased to current master, verified clean debug build of each commit
  luke-jr:
    utACK 2efdfb88aa

Tree-SHA512: e8731a0ef9e87564b2676c7b022b742d9621bba964c19dba9fd9f6961eb608737a9e1a22c0a3c8b2f2f6d583bba067606ee8392422e82082deefb20ea7b88c7c
2022-03-17 07:21:07 +01:00
MarcoFalke
74f8c551e9
Merge bitcoin/bitcoin#24553: contrib: fix signet miner (sighash mismatch)
12cc0201c2 contrib: fix signet miner (sighash mismatch) (Sebastian Falbesoner)

Pull request description:

  gruve-p reported that the signet miner doesn't work anymore (see https://github.com/bitcoin/bitcoin/issues/24501#issuecomment-1062088351), failing with the following error of the `walletprocesspsbt` RPC:

  ```
  error code: -22
  error message:
  Specified sighash value does not match value stored in PSBT
  .....
  subprocess.CalledProcessError: Command '['bitcoin-cli', '-signet', '-stdin', 'walletprocesspsbt']' returned non-zero exit status 22
  ```

  PSBT signing was changed to use SIGHASH_DEFAULT by default in #22514. The signet miner script sets the sighash type of the created PSBT to SIGHASH_ALL (3 is the per-input type PSBT_IN_SIGHASH_TYPE, following a little-endian 32 unsigned integer of the sighash type):

  e04720ec33/contrib/signet/miner (L169-L170)

  hence this leads to a sighash mismatch when the `walletprocesspsbt` RPC is called. Fix this by explicitly passing the correct sighash type. The same change was needed in one of our functional tests, see commit d3992669df.

  Note that instead of feeding the PSBT via `-stdin` it is directly passed as parameter, as I couldn't figure out a way to pass multiple parameters otherwise (separating by newline also didn't work).

ACKs for top commit:
  kallewoof:
    ACK 12cc0201c2
  ajtowns:
    ACK 12cc0201c2 ; code review only

Tree-SHA512: 8509e768e96f85e28c0ca0dc2d35874aa29623febddc46bf90472ec38f38cb3a1b5407c563fd9101d07088775d0fdb18e9137cc38955e847885b83c16591c736
2022-03-17 07:10:27 +01:00
Anthony Towns
f59bee3fb2 fuzz: execute each file in dir without fuzz engine
Co-Authored-By: Anthony Ronning <anthonyronning@gmail.com>
2022-03-17 07:27:00 +10:00
fanquake
d6cb4e8ff0
Merge bitcoin/bitcoin#24549: guix: Use $HOST instead of generic osx{64} for macOS artifacts
53dd6165b8 guix: Use "win64" for Windows artifacts consistently (Hennadii Stepanov)
4b4b04a66d guix: Drop "-signed" suffix for signed macOS .dmg files (Hennadii Stepanov)
933a43018f guix: Use $HOST instead of generic osx{64} for macOS artifacts (Hennadii Stepanov)

Pull request description:

  On master (f94784f5bc) and 23.x branches some GUIX artifacts for `x86_64` and `arm64` macOS have indistinguishable names:
  ```
  d34646cbaf05e03195eb1e426f72fb471fe2d87ab18c9a656600089597703a38  bitcoin-23.0rc2-arm64-apple-darwin.tar.gz
  968767b39442e179e5976b948112a0904374eb4cfb9cba22863408a70a1d99f9  bitcoin-23.0rc2-osx-unsigned.dmg
  d8a7037d5bb845a214e45a52abcf9119bfbe72a76d6370e9560c18fda74a70db  bitcoin-23.0rc2-osx-unsigned.tar.gz
  71092f37985d556bdd25d33fb8571e13664eacadda90efcf21eaa1ba8a32eabd  bitcoin-23.0rc2-osx-unsigned.dmg
  cb10c49b486085b89393955a7a168c32e2f2a4911f2b8d44494bd8f2bd0acf2f  bitcoin-23.0rc2-osx-unsigned.tar.gz
  6d4c44726cd45711c4cb7257c6b46731be1446fc85e79ac86f2def19be45ced3  bitcoin-23.0rc2-osx64.tar.gz
  ```

  With this PR:
  ```
  $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  054c3765381b6d59c6ad8e5e3cbbdd23e330bd579f88b399f78f296d1a4536d0  guix-build-53dd6165b899/output/arm64-apple-darwin/SHA256SUMS.part
  18750c1ff71d014fe5f976da738bfa04a4cd02af6b0d575def8d83160552de2d  guix-build-53dd6165b899/output/arm64-apple-darwin/bitcoin-53dd6165b899-arm64-apple-darwin-unsigned.dmg
  fa2b16684060202d1918c658b446909ee10999a8b9a85018ca2f6a09eaa11c8e  guix-build-53dd6165b899/output/arm64-apple-darwin/bitcoin-53dd6165b899-arm64-apple-darwin-unsigned.tar.gz
  b865000eb4b291a51d1920eec63dcbc9b47dedb1cc7fda0af3ab9b321db36b82  guix-build-53dd6165b899/output/arm64-apple-darwin/bitcoin-53dd6165b899-arm64-apple-darwin.tar.gz
  dd88ce6660754987abf95fc2c4d09f6d2248f12ecee4ef2c03f4fa74bbd8e3ae  guix-build-53dd6165b899/output/dist-archive/bitcoin-53dd6165b899.tar.gz
  fb1871c134e079aa970c5317cad258540e2642cc7ff60a794c85651c85fc6fc4  guix-build-53dd6165b899/output/x86_64-apple-darwin/SHA256SUMS.part
  b1f4c04f7dbd85798ed7cd76fd7948299dfb5653c6c68df0b0839be1c1b295dd  guix-build-53dd6165b899/output/x86_64-apple-darwin/bitcoin-53dd6165b899-x86_64-apple-darwin-unsigned.dmg
  f1f8b2774ba3028d6cdde509076614067a6affc0fa176fdbb03829109ae47022  guix-build-53dd6165b899/output/x86_64-apple-darwin/bitcoin-53dd6165b899-x86_64-apple-darwin-unsigned.tar.gz
  20b9386a81e70f848db7c4f14bcb6cf2fbc1dc17aad1b9a2e6f04ac6fa86a4c9  guix-build-53dd6165b899/output/x86_64-apple-darwin/bitcoin-53dd6165b899-x86_64-apple-darwin.tar.gz
  6f764a8fe876359d3c377fd934eb6595cc06d746980e07320565566abe9409f9  guix-build-53dd6165b899/output/x86_64-w64-mingw32/SHA256SUMS.part
  446b24b2e01608d3dc09db29545db2cdb716c161b19356f4fae930d3ebb299f8  guix-build-53dd6165b899/output/x86_64-w64-mingw32/bitcoin-53dd6165b899-win64-debug.zip
  d1660e6839a1358ae2d164958b551b81338cca9b740b3dc314397a35b17ba2a6  guix-build-53dd6165b899/output/x86_64-w64-mingw32/bitcoin-53dd6165b899-win64-setup-unsigned.exe
  4ab0d948f3864f0d5d220c570b57a02e040f936a8f6b9dba3b4688c80667def9  guix-build-53dd6165b899/output/x86_64-w64-mingw32/bitcoin-53dd6165b899-win64-unsigned.tar.gz
  481177329998fcbb71ab1fc9542a6ffcea623cebddf567981cfa76a7320ec115  guix-build-53dd6165b899/output/x86_64-w64-mingw32/bitcoin-53dd6165b899-win64.zip
  ```

  Also naming of Windows artifacts has been improved.

ACKs for top commit:
  gruve-p:
    ACK 53dd6165b8
  achow101:
    ACK 53dd6165b8

Tree-SHA512: 2a60d8b33608aa18b8bc4376eccca813e482571138524b9e3f8f7ab9a085df79faa1f05bc6e07bbfaf01ddd7a3d17172a6061162ab055fb51ea01e8ccf3e4422
2022-03-16 20:41:36 +00:00
fanquake
9b56b2e2a7
Merge bitcoin/bitcoin#24588: doc: Drop a note about Intel-based Macs
e359ba6b35 doc: Drop a note about Intel-based Macs (Hennadii Stepanov)

Pull request description:

  The work on building stuff during the recent months made the removed note obsolete.

ACKs for top commit:
  fanquake:
    ACK e359ba6b35

Tree-SHA512: 8cf851c8602ef004c9ca009a97345b828bacbb6ecf1eee803d3ce64870a9766c196849b8843237e7bc1be5697de928b759a6dfa0407022c144d23d0293322200
2022-03-16 20:39:07 +00:00
Andrew Chow
114754adf4
Merge bitcoin/bitcoin#24519: doc: update multisig-tutorial.md to descriptor wallet by default
5347c9732f doc: update multisig-tutorial.md to default wallet type (Jon Atack)

Pull request description:

  Follow-up to #24281 and https://github.com/bitcoin/bitcoin/pull/24281#issuecomment-1033996386. The default wallet type was changed to descriptor wallets in #23002.

ACKs for top commit:
  laanwj:
    ACK 5347c9732f
  michaelfolkson:
    ACK 5347c9732f
  achow101:
    ACK 5347c9732f
  theStack:
    Concept and code-review ACK 5347c9732f

Tree-SHA512: 8074a33ad253ecb7d3f78645a00c808c7c224996cc1748067928aa59ef31a58f24fcfc75169494b26a19c7fbbf23bbd78516ab4102bc52fa92f08f1f49b18b63
2022-03-16 16:25:57 -04:00
Andrew Chow
b8992f2d4a
Merge bitcoin/bitcoin#24592: doc: Delete old line of code that was commented out
9a5b4d7892 doc: Delete old line of code that was commented out (Michael Folkson)

Pull request description:

  In #23288 MarcoFalke [highlighted](https://github.com/bitcoin/bitcoin/pull/23288/files#r739817055) an old BOOST_CHECK that was commented out and replaced by a different BOOST_CHECK. I think this can be deleted and wasn't deliberately left in by achow101.

ACKs for top commit:
  achow101:
    ACK 9a5b4d7892
  jonatack:
    ACK 9a5b4d7892

Tree-SHA512: 69aa71d362bb190c75d617766f6af945a43211ddb315ccfef5ebab2beefe020032d99f0d0d4b312aa349e605ba712a8bc91d7f0a22427681e08c95f8a6ea7e64
2022-03-16 16:19:02 -04:00
Michael Folkson
9a5b4d7892 doc: Delete old line of code that was commented out 2022-03-16 19:33:52 +00:00
DrahtBot
d6b24e14d2 test: Fix intermittent failure in feature_segwit 2022-03-16 19:56:31 +01:00
Hennadii Stepanov
e359ba6b35
doc: Drop a note about Intel-based Macs 2022-03-16 18:09:06 +01:00
MarcoFalke
3617d22562
Merge bitcoin/bitcoin#14752: tests: Unit tests for IsPayToWitnessScriptHash and IsWitnessProgram
bce9aaf31e Unit tests for IsWitnessProgram and IsP2WSH. (Daniel Kraft)

Pull request description:

  This adds basic unit tests for `CScript::IsPayToWitnessScriptHash` and `CScript::IsWitnessProgram`, similar to the existing tests for `CScript::IsPayToScriptHash`.  These tests are probably not super important given the other existing tests for segwit related code, but may be useful in catching some errors early.

  This implements #14737.

ACKs for top commit:
  aureleoules:
    tACK bce9aaf31e (`make check)`.

Tree-SHA512: 3cff5efc4ac53079289c72bfba8b1937bc103baadd32bb1fba41e78017f65f9cca17678c3202ad0711eae42b351d4132d9ed9b4e2dc07d138298691a09c4e822
2022-03-16 17:47:56 +01:00
fanquake
4bdc990daf
Merge bitcoin/bitcoin#24573: Update signapple for platform identifier fix
3c74f775ac Update signapple for platform identifier fix (Andrew Chow)

Pull request description:

  Apparently #23134 is caused by the platform identifier field being set to the incorrect value in our code signatures. The problem has been resolved in signapple, and so guix should point to the latest commit containing the fix.

  I suppose guix does not strictly need to have this; only the macOS code signer will need to have the fix.

  Fixes #23134

ACKs for top commit:
  gruve-p:
    ACK 3c74f775ac
  hebasto:
    re-ACK 3c74f775ac
  fanquake:
    ACK 3c74f775ac

Tree-SHA512: 7df844793fa77be4ddc4ef02f26980d6368b50421b7bd9a15f7d6a0c3b5c5f4f0cc0889e065689956583a2173875d33406dbe3a52a72c75a7f23a33c733c2378
2022-03-16 16:44:47 +00:00
fanquake
57f3f5cecf
doc: s/Compiler/Dependency in dependencies.md 2022-03-16 16:30:05 +00:00
fanquake
bf846779ca
doc: cleanup wallet docs in build-osx.md
Re-order legacy and descriptor wallet section.
Installing sqlite isn't required.
Remove prelude that pointlessly reqpeats the same info.
2022-03-16 16:28:28 +00:00
MarcoFalke
e4d61d9759
Merge bitcoin/bitcoin#18815: bench: Add logging benchmark
fafe06c379 bench: Sort bench_bench_bitcoin_SOURCES (MarcoFalke)
fa31dc9b71 bench: Add logging benchmark (MarcoFalke)

Pull request description:

  Might make finding performance bottlenecks or regressions (https://github.com/bitcoin/bitcoin/pull/17218) easier.

  For example, fuzzing relies on disabled logging to be as fast as possible.

ACKs for top commit:
  dergoegge:
    ACK fafe06c379

Tree-SHA512: dd858f3234a4dfb00bd7dec4398eb076370a4b9746aa24eecee7da86f6882398a2d086e5ab0b7c9f7321abcb135e7ffc54cc78e60d18b90379c6dba6d613b3f7
2022-03-16 16:56:29 +01:00
fanquake
ee4780028d
Merge bitcoin/bitcoin#23565: doc: rewrite dependencies.md
893e18059f doc: rework dependencies.md (fanquake)

Pull request description:

  This PR rewrites dependencies.md. The current list is hard to parse, includes information that is either incorrect and/or misleading, and duplicates info in other documentation. The list of dependencies is much smaller, because it's now just the actual dependencies of Bitcoin Core, not random Qt things, or the dependencies of other tooling. We don't need _another_ section on configure flag usage, or, to have duplicated lists of dependencies in other build docs, as that somewhat defeats the point of having dependencies.md, and just means more effort keeping things in sync.

ACKs for top commit:
  MarcoFalke:
    cr ACK 893e18059f
  hebasto:
    ACK 893e18059f, I have reviewed the code and it looks OK, I agree it can be merged.
  jarolrod:
    crACK 893e18059f

Tree-SHA512: 6750eaf70d5ebc9c364ade1d4b5b689e3094020eeb444a3de93b33d9a57a1577949a461f8209442d3954ccb22ab038c7e8cf6dfff5623e4f2713606b6798c37e
2022-03-16 15:45:47 +00:00
Andrew Chow
3c74f775ac Update signapple for platform identifier fix 2022-03-16 09:10:50 -04:00
Hennadii Stepanov
53dd6165b8
guix: Use "win64" for Windows artifacts consistently 2022-03-16 12:03:22 +01:00
fanquake
893e18059f
doc: rework dependencies.md 2022-03-16 10:18:47 +00:00
Sjors Provoost
2efdfb88aa
gui: restore Send for external signer
Before this change the send confirmation dialog would keep the Send option disabled. The Create Unsigned choice would actually send. This is potentially confusing.

With this change the Create Unsigned button will not attempt to sign and always produce a PSBT. The Send button will attempt to sign, and only return a PSBT if more signatures are needed.

When using an external signer, the Create Unsigned option only appears when PSBT controls are enabled in the wallet settings.

This commit maintains the pre-existing behavior of filling the PSBT (without signing) even when not using an external signer.

Closes #551

Co-authored-by: Jon Atack <jon@atack.com>
2022-03-16 10:28:39 +01:00
Sjors Provoost
4b5a6cd149
refactor: helper function signWithExternalSigner()
Does not change behavior.

Review hint:
git show --color-moved --color-moved-ws=allow-indentation-change
2022-03-16 10:28:37 +01:00