Commit graph

32994 commits

Author SHA1 Message Date
josibake
702759588d
add ci/scratch dir to gitignore 2022-03-18 14:47:17 +01: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
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
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
MarcoFalke
310ba92494
Merge bitcoin/bitcoin#24537: rpc: Split mempool RPCs from blockchain.cpp
fad4c8934c Add RegisterMempoolRPCCommands helper (MarcoFalke)
fafd40b541 refactor: Avoid int64_t -> size_t -> int64_t conversion (MarcoFalke)
fa2a5f301a rpc: Move mempool RPCs to new file (MarcoFalke)

Pull request description:

  The `blockchain.cpp` file is quite large. This makes it harder to navigate and increases the memory required to compile.

  Improve on both issues by splitting up the mempool RPCs to a separate file.

ACKs for top commit:
  promag:
    Code review ACK fad4c8934c.
  theStack:
    Code-review ACK fad4c8934c 🏞️

Tree-SHA512: 7f13168ea2cbea51eaef05ca1604fddc919480a2128ec7fa6b1f9365ec5e4822c3df93eb408a19f038c627f2309fa282b9f7f7ec45e5e661fc728f6b33157f89
2022-03-16 09:26:19 +01:00
MarcoFalke
760651214c
Merge bitcoin/bitcoin#24572: ci: Temporarily use clang-13 to work around clang-14 TSan bug
fa43933e3b ci: Temporarily use clang-13 to work around clang-14 TSan bug (MarcoFalke)

Pull request description:

  There is an increase in intermittent issues in the TSan task. The increase correlates with Ubuntu Jammy's bump of `clang` from `clang-13` to `clang-14`.

  Temporarily work around that.

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

Tree-SHA512: adf7d385e1cddaeb2d06c3a3838f87070fb4ffdcc9a37da204b332ab28f40042bd34bd8b6d1d4710511865b4acafa7cf7303c4abf59862c5d29b168e2774da31
2022-03-16 08:21:57 +01:00
Hennadii Stepanov
4b4b04a66d
guix: Drop "-signed" suffix for signed macOS .dmg files
This change makes naming of the signed artifacts consistent across
different OSes, including Windows.
2022-03-16 07:37:35 +01:00
Carl Dong
f865cf8ded Add and use BlockManager::GetAllBlockIndices 2022-03-15 19:42:43 -04:00
Carl Dong
28ba0313ea Add and use CBlockIndexHeightOnlyComparator
...also use std::sort for clarity
2022-03-15 19:42:43 -04:00
Carl Dong
12eb05df63 move-only: Move CBlockIndexWorkComparator to blockstorage
...it's declared in blockstorage.h
2022-03-15 19:42:43 -04:00
Carl Dong
c600ee3816 Only load BlockMan in BlockMan member functions
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.

I strongly recommend reviewing with the following git-diff flags:
  --color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change
2022-03-15 19:42:41 -04:00
Carl Dong
42e56d9b18 style-only: No need for std::pair for vSortedByHeight
...since the height information in already in CBlockIndex* and we can
use an easy custom sorter.
2022-03-15 19:40:51 -04:00
MarcoFalke
fad4c8934c
Add RegisterMempoolRPCCommands helper 2022-03-15 19:29:59 +01:00
MarcoFalke
fa43933e3b
ci: Temporarily use clang-13 to work around clang-14 TSan bug 2022-03-15 18:24:16 +01:00
MarcoFalke
7b83c7d609
Merge bitcoin/bitcoin#24510: test: check for importprunedfunds RPC errors
7573789925 test: check for importprunedfunds RPC errors (Sebastian Falbesoner)

Pull request description:

  This PR adds missing test coverage for the following errors of the `importprunedfunds` RPC:
  7003b6ab24/src/wallet/rpc/backup.cpp (L320-L322)
  7003b6ab24/src/wallet/rpc/backup.cpp (L332-L334)
  7003b6ab24/src/wallet/rpc/backup.cpp (L338-L340)
  7003b6ab24/src/wallet/rpc/backup.cpp (L343-L345)

ACKs for top commit:
  MarcoFalke:
    review ACK 7573789925

Tree-SHA512: b054520d102e5940bdeed2456ca644e91afb187d169b751b1262ce34480e4e9fbe1616ab184a78777c184350dced23508c3d367ed5825cab78bb5ad687fd7dac
2022-03-15 16:04:17 +01:00
MarcoFalke
28bdaa3f76
Merge bitcoin/bitcoin#24080: policy: Remove unused locktime flags
fa8d4d9128 scripted-diff: Clarify CheckFinalTxAtTip name (MarcoFalke)
fa4e30b0f3 policy: Remove unused locktime flags (MarcoFalke)

Pull request description:

  The locktime flags have many issues:
  * They are passed in by a default argument, which is fragile. It has already lead to bugs like the one fixed in commit e30b6ea194.
  * They are negative (signed), which doesn't make sense for flags (unsigned in general). According to the review comments when the code was added: "The max on the flags is a fairly weird operation." (https://github.com/bitcoin/bitcoin/pull/6566#issuecomment-150310861)
  * No call site relies on the default argument and they all pass in a single compile-time constant, rendering most of the code dead and untested.
  * The dead code calls `GetAdjustedTime` (network adjusted time), which has its own issues. See https://github.com/bitcoin/bitcoin/issues/4521

  Fix all issues by removing them

ACKs for top commit:
  ajtowns:
    ACK  fa8d4d9128
  theStack:
    Code-review ACK fa8d4d9128
  glozow:
    ACK fa8d4d9128, agree the default arg `flags` is a massive footgun and just setting max flags is weird. Adding `AtTip` to the names makes sense to me, since they're both testing for *next* block and only ever used for {,re}addition to mempool.

Tree-SHA512: 79f4a52f34909eb598d88bbae7afe8abe5f85f45c128483d16aa83dacd0e5579e561b725d01b1e9a931d1821012a51ad2bc6fb2867f8d09ee541f9d234d696f8
2022-03-14 16:32:23 +01:00
Sebastian Falbesoner
12cc0201c2 contrib: fix signet miner (sighash mismatch)
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, hence this leads to a sighash mismatch when the
`walletprocesspsbt` RPC is called. Fix this by explicitly passing the
correct sighash type.

Note that the same change was needed in one of our functional tests,
see commit d3992669df.

Reported by gruve-p.
2022-03-14 11:54:50 +01:00
Andrew Chow
25d045a9ec
Merge bitcoin/bitcoin#24225: wallet: Add sanity checks to DiscourageFeeSniping
fa8e76bb90 wallet: Add sanity checks to AntiFeeSnipe (MarcoFalke)

Pull request description:

  I added those sanity checks as part of implementing BIP 326, but I think they make sense on their own. The checks require the transaction to be passed in to `DiscourageFeeSniping`. Also, replace `(int)locktime` cast with the equivalent `int(locktime)` cast.

ACKs for top commit:
  chris-belcher:
    ACK fa8e76bb90
  S3RK:
    Code review ACK fa8e76bb90
  achow101:
    ACK fa8e76bb90
  w0xlt:
    Code Review ACK fa8e76bb90

Tree-SHA512: 6fe37c85f074851ef09cae8addcb836257089290fecec515c129c3180e9ccb64740aaac76043af10ce7c213e5001568ca6b4b62ae9631f0994ed676b07118074
2022-03-14 10:31:25 +00:00
MarcoFalke
e0881aa5f0
Merge bitcoin/bitcoin#24505: wallet: Add a deprecation warning for newly created legacy wallets
61152183ab wallet: Add a deprecation warning for newly created legacy wallets (Andrew Chow)

Pull request description:

  As we slowly deprecate legacy wallets, we need to warn users that are making new legacy wallets that their wallet type is going to be unsupported in the future.

ACKs for top commit:
  jonatack:
    ACK 61152183ab
  S3RK:
    reACK 61152183ab
  theStack:
    ACK 61152183ab

Tree-SHA512: e89bfb8168869542498958f0c9a2ab302dfd43287f8a49e7d9e09f60438a567bb8b7219a4e569797ee819b30b624f532fcc0b70c6aa0edcb392a301b8ce8b541
2022-03-14 08:37:46 +01:00
Hennadii Stepanov
933a43018f
guix: Use $HOST instead of generic osx{64} for macOS artifacts 2022-03-13 11:04:52 +01:00
MarcoFalke
e04720ec33
Merge bitcoin/bitcoin#24528: rpc: rename getdeploymentinfo status-next to status_next
5d7c69b887 rpc: rename getdeploymentinfo status-next to status_next (Jon Atack)

Pull request description:

  Rename the `status-next` field to `status_next` in getdeploymentinfo before the RPC is released in v23.

  Before
  ```
  Result:
  {                                       (json object)
    "hash" : "str",                       (string) requested block hash (or tip)
    "height" : n,                         (numeric) requested block height (or tip)
    "deployments" : {                     (json object)
      "xxxx" : {                          (json object) name of the deployment
        "type" : "str",                   (string) one of "buried", "bip9"
        "height" : n,                     (numeric, optional) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
        "active" : true|false,            (boolean) true if the rules are enforced for the mempool and the next block
        "bip9" : {                        (json object, optional) status of bip9 softforks (only for "bip9" type)
          "bit" : n,                      (numeric, optional) the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
          "start_time" : xxx,             (numeric) the minimum median time past of a block at which the bit gains its meaning
          "timeout" : xxx,                (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
          "min_activation_height" : n,    (numeric) minimum height of blocks for which the rules may be enforced
          "status" : "str",               (string) status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed")
          "since" : n,                    (numeric) height of the first block to which the status applies
          "status-next" : "str",          (string) status of deployment at the next block
          "statistics" : {                (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
            "period" : n,                 (numeric) the length in blocks of the signalling period
            "threshold" : n,              (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
            "elapsed" : n,                (numeric) the number of blocks elapsed since the beginning of the current period
            "count" : n,                  (numeric) the number of blocks with the version bit set in the current period
            "possible" : true|false       (boolean, optional) returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
          },
          "signalling" : "str"            (string) indicates blocks that signalled with a # and blocks that did not with a -
        }
      }
    }
  }
  ```
  After
  ```
  Result:
  {                                       (json object)
    "hash" : "str",                       (string) requested block hash (or tip)
    "height" : n,                         (numeric) requested block height (or tip)
    "deployments" : {                     (json object)
      "xxxx" : {                          (json object) name of the deployment
        "type" : "str",                   (string) one of "buried", "bip9"
        "height" : n,                     (numeric, optional) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
        "active" : true|false,            (boolean) true if the rules are enforced for the mempool and the next block
        "bip9" : {                        (json object, optional) status of bip9 softforks (only for "bip9" type)
          "bit" : n,                      (numeric, optional) the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
          "start_time" : xxx,             (numeric) the minimum median time past of a block at which the bit gains its meaning
          "timeout" : xxx,                (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
          "min_activation_height" : n,    (numeric) minimum height of blocks for which the rules may be enforced
          "status" : "str",               (string) status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed")
          "since" : n,                    (numeric) height of the first block to which the status applies
          "status_next" : "str",          (string) status of deployment at the next block
          "statistics" : {                (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
            "period" : n,                 (numeric) the length in blocks of the signalling period
            "threshold" : n,              (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
            "elapsed" : n,                (numeric) the number of blocks elapsed since the beginning of the current period
            "count" : n,                  (numeric) the number of blocks with the version bit set in the current period
            "possible" : true|false       (boolean, optional) returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
          },
          "signalling" : "str"            (string) indicates blocks that signalled with a # and blocks that did not with a -
        }
      }
    }
  }
  ```

Top commit has no ACKs.

Tree-SHA512: 4facfd7af3cfb7b6f5495758c4387602802f5e39d9270b162d17350a7f954eab0b74d895f17f0d8dfbc7814d36db7cff56d08c42728432885ea6f4e37aea4aa8
2022-03-13 10:23:20 +01:00
MarcoFalke
2860a91df0
Merge bitcoin/bitcoin#24527: test: set segwit height back to 0 on regtest
5ce3057c8e test: set segwit height back to 0 on regtest (Martin Zumsande)

Pull request description:

  The change of `consensus.SegwitHeight` from 0 to 1 for regtest in #22818 had the effect that if I create a regtest enviroment with  current master (or 23.x), and then try to load this chain with an older version (22.x), I get an InitError
  `Witness data for blocks after height 0 requires validation. Please restart with -reindex`
  and have to reindex because `BLOCK_OPT_WITNESS` is no longer set for the Genesis block and `NeedsRedownload()` in validation returns `true` with an older version.
  That might be a bit annoying for tests that use a shared regtest dir with different versions.

  If people think this is enough of an issue to be worth fixing, I think it should also make it into 23.x

ACKs for top commit:
  theStack:
    Concept and code-review ACK 5ce3057c8e

Tree-SHA512: b0e89ff7fc953bc0ae929d2da44cde7149321d987fb4763934f6c9635d00d807129a50b459cc5e69e86bb1819e4b063b969486e8016a1cb8db8f905fa315653d
2022-03-13 10:20:15 +01:00
MarcoFalke
f94784f5bc
Merge bitcoin/bitcoin#24533: test: use MiniWallet for feature_maxuploadtarget.py
aab552fa30 test: use MiniWallet for feature_maxuploadtarget.py (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (feature_maxuploadtarget.py) to be run even with the Bitcoin Core wallet disabled by using the MiniWallet instead, as proposed in https://github.com/bitcoin/bitcoin/issues/20078. Note that the adapted helper function `mine_large_block` is currently only is used in this test, i.e. there was no need to change any others.

ACKs for top commit:
  brunoerg:
    crACK aab552fa30

Tree-SHA512: 82fb962ae40e3717419b063af295fc03ac5d5dfe4266dee8ba7f6c86800ede1d32f8fa632c189c30e982badf0c6083fcf6eca4798221f6e284c5e01a8b1a1ed9
2022-03-13 09:46:14 +01:00
laanwj
deb847b757
Merge bitcoin/bitcoin#24491: contrib: fix implicit function decleration in win symbol check
e4e9dd3a28 contrib: fix implicit function decleration in win symbol check (fanquake)

Pull request description:

  ```bash
  test3.c: In function 'main':
  test3.c:6:21: warning: implicit declaration of function 'CoFreeUnusedLibrariesEx' [-Wimplicit-function-declaration]
      6 |                     CoFreeUnusedLibrariesEx(0,0);
  ```

  ```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
  1907745369f13b0b01583795e395b7e8ecda174a8a3b6309184b14609bfdcb20  guix-build-e4e9dd3a287f/output/dist-archive/bitcoin-e4e9dd3a287f.tar.gz
  6973025bd46acdbc327118541f26d36885434305d20a7fa33e0db61f66f8b930  guix-build-e4e9dd3a287f/output/x86_64-w64-mingw32/SHA256SUMS.part
  4cdc4efc0d27b3fcfb8f36244dfd956d19ae5df0414dcc23e733c88188f1f93a  guix-build-e4e9dd3a287f/output/x86_64-w64-mingw32/bitcoin-e4e9dd3a287f-win-unsigned.tar.gz
  022e9743b13f5366cd0f4b52ff8350b42d8c6a506c98363071501a6c4ac735f1  guix-build-e4e9dd3a287f/output/x86_64-w64-mingw32/bitcoin-e4e9dd3a287f-win64-debug.zip
  62e65f04fdcacb3d3fbcffbea5204f723f2b27a5f9a62a77abaf0b7ee7de3744  guix-build-e4e9dd3a287f/output/x86_64-w64-mingw32/bitcoin-e4e9dd3a287f-win64-setup-unsigned.exe
  d773f5ba6afe456b7b5286f0cf98bcb711da8087b96a31f2e38f9c43af44fe96  guix-build-e4e9dd3a287f/output/x86_64-w64-mingw32/bitcoin-e4e9dd3a287f-win64.zip
  ```

ACKs for top commit:
  laanwj:
    Code review ACK e4e9dd3a28
  hebasto:
    ACK e4e9dd3a28, tested on Ubuntu 22.04.

Tree-SHA512: e075b052f848a654ed11fb8bc29e2a7b015ab2b44878535d84ac61ecec507410d68e866526c5e0acd1b1b99e65c9d738231208cbb676c8d3f73691317c94c9e0
2022-03-13 09:23:50 +01:00
fanquake
fd381d86b1
Merge bitcoin/bitcoin#24526: build: don't install deprecated libevent headers
339b4a51f6 build: don't install deprecated libevent headers (fanquake)

Pull request description:

  We don't use the deprecated headers now, and never should do in the
  future, so there is no need for them to exist in depends.

  The headers themselves are just full of includes for the newer headers.

ACKs for top commit:
  hebasto:
    ACK 339b4a51f6

Tree-SHA512: 736fd9e3b22212da462cc05203dd253806dc59f973090357b705f2742ed4a3b8c3cc44b3173d706527f60ad93e95cf4143ec6b7db4233a489890a98f8e5c8f07
2022-03-12 20:16:49 +00:00
MarcoFalke
e7db4e245a
Merge bitcoin/bitcoin#24164: build: Bump minimum required clang/libc++ to 8.0
fae20e6b50 Revert "Avoid the use of P0083R3 std::set::merge" (MarcoFalke)
fab53b5fd4 ci/doc: Set minimum required clang/libc++ version to 8.0 (MarcoFalke)

Pull request description:

  This is not for 23.0, but for 24.0. It comes with the following benefits:

  * Can use C++17 P0083R3 std::set::merge from libc++ 8.0
  * No longer need to provide support for clang-7, which already fails to compile on some architectures (https://github.com/bitcoin/bitcoin/issues/21294#issuecomment-998098483)

  This should be fine, given that all supported operating systems ship with at least clang-10:

  * CentOS 8: clang-12
  * Stretch: https://packages.debian.org/stretch/clang-11
  * Buster: https://packages.debian.org/buster-backports/clang-11
  * Bionic: https://packages.ubuntu.com/bionic-updates/clang-10
  * Focal: https://packages.ubuntu.com/focal/clang-10

ACKs for top commit:
  fanquake:
    ACK fae20e6b50 - I think this is fine to do. I would be surprised if in another 6 months time someone was stuck on a system we supported, needing to compile Core, and only had access to Clang 7 or older. As mentioned in the PR description, all systems we currently support, already support multiple newer versions of Clang.
  hebasto:
    ACK fae20e6b50, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 3b4c6c130ff40dd7e84934af076863415e5dd661d823c72e3e3832566c65be6e877a7ef9164bbcf394bcea4b897fc29a48db0f231c22ace0e2c9b5638659a628
2022-03-12 10:37:05 +01:00
MarcoFalke
fafd40b541
refactor: Avoid int64_t -> size_t -> int64_t conversion 2022-03-11 17:52:48 +01:00
MarcoFalke
fa2a5f301a
rpc: Move mempool RPCs to new file
Can be reviewed with:
--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
2022-03-11 17:46:58 +01:00
Andrew Chow
c109e7d51c
Merge bitcoin/bitcoin#24530: wallet: assert BnB's internally calculated waste is the same as GetSelectionWaste
ec7d73628a [wallet] assert BnB internally calculated waste is the same as GetSelectionWaste() (glozow)

Pull request description:

  #22009 introduced a `GetSelectionWaste()` function to determine how much "waste" a coin selection solution has, and is a mirror of the waste calculated inside of `SelectCoinsBnB()`. It would be bad for these two waste metrics to deviate, since it could negatively affect how often we select the BnB solution. Add an assertion to help tests catch a potential accidental change.

ACKs for top commit:
  achow101:
    ACK ec7d73628a
  Xekyo:
    ACK ec7d73628a

Tree-SHA512: 3ab7ad45ae92e7ce3f21824fb975105b6be8382edf47c252df5d13d973a3abdcb675132d223b42fcbb669cca879672c904b8a58d0676e12bf381a9219f4db37c
2022-03-11 16:40:17 +00:00
Sebastian Falbesoner
aab552fa30 test: use MiniWallet for feature_maxuploadtarget.py
This test can now be run even with the Bitcoin Core wallet disabled.
2022-03-11 16:14:48 +01:00
MarcoFalke
a81717443f
Merge bitcoin/bitcoin#24453: Bugfix: doc: Correct change_address/changeAddress in wallet RPC help
e8272024ab doc: Use human-friendly DefaultHint for change_address/changeAddress in wallet RPC help (Luke Dashjr)
9d5e693c9d Bugfix: doc: Correct type of change_address/changeAddress in wallet RPC help (STR, not STR_HEX) (Luke Dashjr)

Pull request description:

ACKs for top commit:
  achow101:
    ACK e8272024ab

Tree-SHA512: da4db2b241160c93ea66f8c572c69d4688f52a5fd8c32b66b1192925fcb360baf91be9771eaca178f5b08e1920559174260ed57caddcffade48156ec0c83c0bc
2022-03-11 16:11:17 +01:00