Commit graph

34222 commits

Author SHA1 Message Date
laanwj
ad9e5eaf77
Merge bitcoin/bitcoin#24424: doc: release process chainparams updates
74743ad905 Clarify in release process how to update defaultAssumeValid/nMinimumChainWork (Jon Atack)
415345d547 Release process: use 4096 blocks and getbestblockhash for getchaintxstats (Jon Atack)
fe048f7f7c Specify in release process which chains need to be updated (Jon Atack)
584147682a Reorganize release process chainparams section to reduce repetition (Jon Atack)
e8f844888f Clarify release process overhead note to be more actionable (Jon Atack)
e538eada7c Release process: exclude huge files for mainnet m_assumed_blockchain_size (laanwj)
b4d2d74767 Release process: specify blockchain/chain_state units, reduce repetition (Jon Atack)
318655c395 Add missing references to signet in the release process (Jon Atack)

Pull request description:

  Release process updates, fixes and clarifications regarding updating the chainparams:

  - add missing references to signet
  - specify specify blockchain/chainstate units, reduce repetition
  - exclude huge files for m_assumed_blockchain_size on mainnet
  - rewrite overhead note to be more actionable
  - reorganize the chainparams section to reduce repetition
  - specify which chains need to be updated
  - use 4096 blocks and getbestblockhash for getchaintxstats
  - clarify how to update defaultAssumeValid and nMinimumChainWork

ACKs for top commit:
  laanwj:
    ACK 74743ad905
  brunoerg:
    re-ACK 74743ad905

Tree-SHA512: 7fc092be739f63c5d8404add2dcbcd0c570b680ff0ab36a9b5a774b2e930717beebaa6c867ab6db6795b3c234d9016ab1ae905a78d6ea6610140a59930c43029
2022-05-30 15:55:12 +02:00
Antoine Poinsot
f3a50c9dfe
miniscript: rename IsSane and IsSaneSubexpression to prevent misuse 2022-05-30 15:16:46 +02:00
Antoine Poinsot
c5fe5163dc
miniscript: nit: don't return after assert(false) 2022-05-30 15:16:45 +02:00
Antoine Poinsot
7bbaca9d8d
miniscript: explicit the threshold size computation in multi() 2022-05-30 15:16:45 +02:00
Antoine Poinsot
8323e4249d
miniscript: add an OpCode typedef for readability
Suggested-by: Vincenzo Palazzo
2022-05-30 15:16:44 +02:00
Antoine Poinsot
7a549c6c59
miniscript: mark nodes with duplicate keys as insane
As stated on the website, duplicate keys make it hard to reason about
malleability as a single signature may unlock multiple paths.

We use a custom KeyCompare function instead of operator< to be explicit
about the requirement.
2022-05-30 15:16:43 +02:00
MarcoFalke
fa243e9313
Remove no-op TIME_INIT on deser
Assigning TIME_INIT to nTime was needed to fully re-initialize a dirty
object where the deserialization might skip nTime.
See https://github.com/bitcoin/bitcoin/pull/19020/files#r427620111

Now that the without-nTime logic is removed in commit
dbcb5742c4 and commit
e08770bed1, the logic here can be removed
as well.

Also, remove confusing and redundant preprocessor code.

Also, remove no longer needed version.h include, which was needed for
INIT_PROTO_VERSION.
2022-05-30 13:55:39 +02:00
MacroFake
8779adbdda
Merge bitcoin/bitcoin#25233: compat: remove glibcxx sanity checks
cc61bc2e19 compat: remove glibcxx sanity checks (fanquake)

Pull request description:

  These checks were added in #4339, (see also #4081), to test
  our back-compat stubs, however, those stubs no-longer exist (#22930),
  meaning that these checks are now just testing some specific standard
  library behaviour, without a particular rationale, or reason, compared
  to any other standard library functionlity we use.

  There has also been some discussion about our sanity checks in the
  context of the libbitcoinkernel refactoring, see https://github.com/bitcoin/bitcoin/pull/25065#discussion_r880668218.
  Removing the checks removes the need to worry about atleast the
  glibcxx checks.

  Also remove the list of checks from the doc in `init.h`, because it is
  incomplete, and anyone who wants to know what checks are included can
  look at the function.

  Guix Build (arm64):
  ```bash
  e18a81e25b4707cbe113fb4d3ba2459013c1178e7cecfe446e4f14ee5ecd2ce8  guix-build-cc61bc2e19b1/output/arm-linux-gnueabihf/SHA256SUMS.part
  9928cc38b79f827018cba0bdde98666b31806afcc79dd95a00acb8e153c36eec  guix-build-cc61bc2e19b1/output/arm-linux-gnueabihf/bitcoin-cc61bc2e19b1-arm-linux-gnueabihf-debug.tar.gz
  ebf4635ba4688899ae62e4bb17ebb2afb25c538c4a8068ef515920fd4e43754e  guix-build-cc61bc2e19b1/output/arm-linux-gnueabihf/bitcoin-cc61bc2e19b1-arm-linux-gnueabihf.tar.gz
  74c7e35b47c6d101fda7205f144d37150329b4c360db09d37b8c1437f3390898  guix-build-cc61bc2e19b1/output/arm64-apple-darwin/SHA256SUMS.part
  6e12643b17be9326f1d873dfe51a52c082671540792877af624b42ca9f6e1791  guix-build-cc61bc2e19b1/output/arm64-apple-darwin/bitcoin-cc61bc2e19b1-arm64-apple-darwin-unsigned.dmg
  1d86d0416c7a50afd7bd8d850f416b7c7277464ccc95e4dae53b5b59415fc83d  guix-build-cc61bc2e19b1/output/arm64-apple-darwin/bitcoin-cc61bc2e19b1-arm64-apple-darwin-unsigned.tar.gz
  84070843f23839e7191ad3a667eb63c45f668eb95afbfb3fcdfb8363320f67d4  guix-build-cc61bc2e19b1/output/arm64-apple-darwin/bitcoin-cc61bc2e19b1-arm64-apple-darwin.tar.gz
  bf6ccd7b8c40476b1dc52b491757313ea3e96c43a01c8aabaf39f94dc1837329  guix-build-cc61bc2e19b1/output/dist-archive/bitcoin-cc61bc2e19b1.tar.gz
  25e7e1ff7d8de38632abf9926343c8ba556209f3d03109c92864ffe72813a05f  guix-build-cc61bc2e19b1/output/powerpc64-linux-gnu/SHA256SUMS.part
  d0398de83841607b1bf921d4553b30ad5e2d70d0570e96a2eaaf2762e1103c79  guix-build-cc61bc2e19b1/output/powerpc64-linux-gnu/bitcoin-cc61bc2e19b1-powerpc64-linux-gnu-debug.tar.gz
  f09cdc2ac2a2bb644f4749f3d74b5210ddb531594c33d127a907f0223e7793e5  guix-build-cc61bc2e19b1/output/powerpc64-linux-gnu/bitcoin-cc61bc2e19b1-powerpc64-linux-gnu.tar.gz
  ef36a68ef4e5ee9b311df40062cd2296f897e7b1550e39e0643601cd7d469010  guix-build-cc61bc2e19b1/output/powerpc64le-linux-gnu/SHA256SUMS.part
  937b600a2b86304ccc5b6c71a7eaf8aa5e2020592724cef6a933a1955995480b  guix-build-cc61bc2e19b1/output/powerpc64le-linux-gnu/bitcoin-cc61bc2e19b1-powerpc64le-linux-gnu-debug.tar.gz
  eca4eec41e71fdf7a7b0fa4065afa49c47d3b9541ed2cb4d083ad4a0de102e37  guix-build-cc61bc2e19b1/output/powerpc64le-linux-gnu/bitcoin-cc61bc2e19b1-powerpc64le-linux-gnu.tar.gz
  981c0968c19905925a599cff357ec259c1e806bdb7691c7b52039be450bdad7c  guix-build-cc61bc2e19b1/output/riscv64-linux-gnu/SHA256SUMS.part
  89c709967f9a157256281fbf682aad246f2eaad9c2f1797c2787253cbabe12f8  guix-build-cc61bc2e19b1/output/riscv64-linux-gnu/bitcoin-cc61bc2e19b1-riscv64-linux-gnu-debug.tar.gz
  454cd830dd382e176f5a23041fc33f93937668245481b0dd29fc04882d9528eb  guix-build-cc61bc2e19b1/output/riscv64-linux-gnu/bitcoin-cc61bc2e19b1-riscv64-linux-gnu.tar.gz
  e0812c2dc492e5c5f06e3685d19da8fb29ed38d3b32821d293ef01cb4fefbd79  guix-build-cc61bc2e19b1/output/x86_64-apple-darwin/SHA256SUMS.part
  0e7d4241d8ac882a8091fa00a7813db87a3e5afec59627e45b6c910cfdd4a7b0  guix-build-cc61bc2e19b1/output/x86_64-apple-darwin/bitcoin-cc61bc2e19b1-x86_64-apple-darwin-unsigned.dmg
  3faaca046cbb2642445a7dd1f389ed7bf94a65de8372441c36d5cb79c030ce31  guix-build-cc61bc2e19b1/output/x86_64-apple-darwin/bitcoin-cc61bc2e19b1-x86_64-apple-darwin-unsigned.tar.gz
  73080f032a42db679baf0d09619671ac5b9d85be84a68bdd6b6709eb0e6465bd  guix-build-cc61bc2e19b1/output/x86_64-apple-darwin/bitcoin-cc61bc2e19b1-x86_64-apple-darwin.tar.gz
  07b6e1b6291404bca1044df4a45b6958b882ffb88c143ba98f1959960a394897  guix-build-cc61bc2e19b1/output/x86_64-linux-gnu/SHA256SUMS.part
  16b455f62398f4aa0d3821abb1cceb8151e31c2664e3f974a764a5b8702b50f3  guix-build-cc61bc2e19b1/output/x86_64-linux-gnu/bitcoin-cc61bc2e19b1-x86_64-linux-gnu-debug.tar.gz
  3c1a3a6a343f17b83f3b3d47e9426eccd2d0bcc7f824cd958fcf2cf06cdc3276  guix-build-cc61bc2e19b1/output/x86_64-linux-gnu/bitcoin-cc61bc2e19b1-x86_64-linux-gnu.tar.gz
  f05afa688ea7211b0049555385fb2acc26986e24d8d00893389160e07037e693  guix-build-cc61bc2e19b1/output/x86_64-w64-mingw32/SHA256SUMS.part
  8bcbae67dd0746c42e1e7c7db67725a69289b08e9aa97b873d443d0aa355615d  guix-build-cc61bc2e19b1/output/x86_64-w64-mingw32/bitcoin-cc61bc2e19b1-win64-debug.zip
  efa45e3b76e5ae08a8392d58e741325df572d92c7dd69b65d876cdcda541d2fc  guix-build-cc61bc2e19b1/output/x86_64-w64-mingw32/bitcoin-cc61bc2e19b1-win64-setup-unsigned.exe
  3a8c2461ca826138c3017d06279a79b4c6bee2a507ad362aa6e424f76678596c  guix-build-cc61bc2e19b1/output/x86_64-w64-mingw32/bitcoin-cc61bc2e19b1-win64-unsigned.tar.gz
  e56ae4f609d4e6a3ca5917a4bb763c91012ece2d236d6b62a666358791e43525  guix-build-cc61bc2e19b1/output/x86_64-w64-mingw32/bitcoin-cc61bc2e19b1-win64.zip
  ```

ACKs for top commit:
  MarcoFalke:
    lgtm ACK cc61bc2e19
  laanwj:
    Concept and code review ACK cc61bc2e19

Tree-SHA512: 3da6aba44eef3f864fcbe897db1faa964923756e68c6a713e444b5d01c6d3542c3d7ca26678760e81a7a9e3cd40bd90622d0a7b697c27166817ba4f1023661ef
2022-05-30 10:39:47 +02:00
fanquake
e3b7f10b10
Merge bitcoin/bitcoin#25237: rpc: Capture UniValue by ref for rpcdoccheck
20ff4991e5 rpc: Capture potentially large UniValue by ref for rpcdoccheck (Martin Zumsande)

Pull request description:

  Capturing it by reference instead of value should save us from making a copy of a potentially large object. Saw this while having a look at #25229 although I couldn't reproduce an actual leak, so this is not a fix for that issue.

ACKs for top commit:
  MarcoFalke:
    review ACK 20ff4991e5
  theStack:
    Code-review ACK 20ff4991e5
  furszy:
    Code ACK 20ff4991

Tree-SHA512: faf7bb14e37f8324b93a39095b07693626329da47c4a1ac8929bf99385e2e0567008e959e7e8540bc7d454d08fa41cccd39f55253c9a839fa88362922058a93b
2022-05-30 09:16:09 +01:00
MacroFake
b6ab45ae5c
Merge bitcoin/bitcoin#25204: rpc: remove deprecated top-level fee fields from mempool entries
885694d794 doc: add release note about removal of `deprecatedrpc=fees` flag (Sebastian Falbesoner)
387ae8bc09 rpc: remove deprecated fee fields from mempool entries (Sebastian Falbesoner)

Pull request description:

  Deprecating the top-level fee fields (`fee`, `modifiedfee`, `ancestorfees` and `descendantfees`) from the mempool entries and introducing `-deprecatedrpc=fees` was done in PR #22689 (released in v23.0). For the next release v24.0, this configuration option can be removed.

ACKs for top commit:
  fanquake:
    ACK 885694d794

Tree-SHA512: fec6b5be5c3f0cd55738a888b390ef9271e70b2dba913a14ce82427dac002e999f93df298bb3b494f3d1b850a23d2b5b3e010e901543b0d18db9be133579e1ec
2022-05-30 08:52:15 +02:00
fanquake
fb7437f66f
Merge bitcoin/bitcoin#25231: ci: Install documented packages for "Win64" CI task
3ffc190321 ci: Install documented packages for "Win64" CI task (Hennadii Stepanov)

Pull request description:

  This minor change has the following benefits:
  - it follows the [documented](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#building-for-64-bit-windows) way for modern Ubuntu distros (this CI task uses jammy)
  - it makes package installation time shorter as no need to install the `g++-mingw-w64-x86-64-win32` package
  - (not directly related to this repo) in https://github.com/bitcoin-core/gui-qml Qt 5.15.3 (but not 5.15.2) build system goes [wild](https://cirrus-ci.com/task/6231535933194240) otherwise

ACKs for top commit:
  fanquake:
    ACK 3ffc190321
  jarolrod:
    ACK 3ffc190321

Tree-SHA512: 41fd6deedb3febc90cc4f2037dfbf840d82ef5b1dd950a0ff458cae6c1b1024559b21c8e1135c2d37780e80dd3f9f9751d638120443d0d60c22ac160cf693e2a
2022-05-29 22:00:54 +01:00
furszy
57fb37c275
wallet: CommitTransaction, remove extra wtx lookup and add exception for a possible db write error.
1) `Wallet::AddToWallet` is already returning the pointer to the inserted `CWalletTx`, so there is no need to look it up in the map again.

2) `Wallet::AddToWallet` can only return a nullptr if the db `writeTx` call failed. Which should be treated as an error.
2022-05-29 14:02:08 -03:00
Hennadii Stepanov
151009cf76
qt, wallet, refactor: Drop unused WalletModel::PaymentRequestExpired
Also dead code has been removed.
2022-05-29 18:04:44 +02:00
Hennadii Stepanov
1f653dc262
qt, wallet, refactor: Make WalletModel::sendCoins() return void
Currently, the `WalletModel::sendCoins()` function always returns the
same value.

Also dead and noop code has been removed.
2022-05-29 17:49:55 +02:00
Martin Zumsande
20ff4991e5 rpc: Capture potentially large UniValue by ref for rpcdoccheck 2022-05-29 14:36:53 +02:00
Hennadii Stepanov
3ffc190321
ci: Install documented packages for "Win64" CI task 2022-05-28 11:34:11 +02:00
fanquake
cc61bc2e19
compat: remove glibcxx sanity checks
These checks were added in #4339, (see also #4081), to test
our back-compat stubs, however, those stubs no-longer exist (#22930),
meaning that these checks are now just testing some specific standard
library behaviour, without a particular rationale, or reason, compared
to any other standard library functions we use.

There has also been some discussion about the sanity checks in the
context of the libbitcoinkernel refactoring, see
https://github.com/bitcoin/bitcoin/pull/25065#discussion_r880668218.
Removing the checks removes the need to worry about atleast the glibcxx
checks.

Also remove the list of check from the doc in init.h, because it is
incomplete, and anyone who wants to know what checks are included can
look at the function.
2022-05-28 09:43:02 +01:00
fanquake
ba48fcf4a4
Merge bitcoin/bitcoin#25224: Get time less often in AddrManImpl::ResolveCollisions_()
fa27ee88ed Get time less often in AddrManImpl::ResolveCollisions_() (MarcoFalke)

Pull request description:

  First commit split out from https://github.com/bitcoin/bitcoin/pull/24697

ACKs for top commit:
  sipa:
    utACK fa27ee88ed
  fanquake:
    ACK fa27ee88ed

Tree-SHA512: 40c8594d2a5ce02a392ac5f9f120c24c6bcd495b0bcc901fd6064dde9f6123cd109504cee7b612a9555b70cfd7759cbd6cd496d007bb374c27610d01b464191c
2022-05-28 09:41:00 +01:00
James O'Beirne
6120e8e287 test: allow passing sequence through create_self_transfer_multi
And some little type annotation additions.
2022-05-27 13:40:06 -04:00
Sebastian Falbesoner
885694d794 doc: add release note about removal of deprecatedrpc=fees flag 2022-05-27 17:29:06 +02:00
Sebastian Falbesoner
387ae8bc09 rpc: remove deprecated fee fields from mempool entries 2022-05-27 17:29:04 +02:00
fanquake
345457b542
Merge bitcoin/bitcoin#25214: multiprocess build fix: ipc/capnp/init.capnp.h: No such file or directory
44904aa632 multiprocess build cleanup: comment on manual dependencies (Ryan Ofsky)
6e1c16c144 multiprocess build fix: ipc/capnp/init.capnp.h: No such file or directory (Ryan Ofsky)

Pull request description:

  Error was reported by SatoriHoshiAiko in https://github.com/bitcoin/bitcoin/issues/25207 and happens unpredictably because make doesn't always build dependencies in the same order.

  The source file `src/ipc/capnp/protocol.cpp` includes some generated headers so needs to have an explicit dependency specified in the makefile so the headers will be generated before the file is compiled. #19160 added the explicit dependency, but it was incorrect because it referred to an old file path from before the source file was renamed (`ipc.cpp` -> `protocol.cpp`)

ACKs for top commit:
  hebasto:
    re-ACK 44904aa632

Tree-SHA512: 578ef4ef35a97e9d8d4e6d4edf39e57a32674234bf145e8159268324cb6ba15b420517afc07f6f42bb11a562954ea74af686c3fb92ce178c1fc378421b352531
2022-05-27 14:43:34 +01:00
MacroFake
3ba6dd6f4b
Merge bitcoin/bitcoin#24408: rpc: add rpc to get mempool txs spending specific prevouts
4185570340 Add RPC to get mempool txs spending outputs (t-bast)

Pull request description:

  We add an RPC to fetch mempool transactions spending any of the given outpoints.

  Without this RPC, application developers need to first call `getrawmempool` which returns a long list of `txid`, then fetch each of these transactions individually (`getrawtransaction`) to check whether they spend the given outpoints, which wastes a lot of bandwidth (in the worst case we need to transfer the whole mempool).

  For example in lightning, when we discover that one of our channel funding transactions has been spent, we need to find the spending transaction to claim our outputs from it. We are currently forced to fetch the whole mempool to do the analysis ourselves, which is quite costly.

  I believe that this RPC is also generally useful when doing some introspection on your mempool after one of your transactions failed to broadcast, for example when you implement RBF at the application level. Fetching and analyzing the conflicting transaction gives you more information to successfully replace it.

ACKs for top commit:
  darosior:
    re-utACK 4185570340
  vincenzopalazzo:
    re-ACK 4185570340
  danielabrozzoni:
    re-tACK 4185570340
  w0xlt:
    reACK 4185570340

Tree-SHA512: 206687efb720308b7e0b6cf16dd0a994006c0b5a290c8eb386917a80130973a6356d0d5cae1c63a01bb29e066dd721594969db106cba7249214fcac90d2c3dbc
2022-05-27 15:16:00 +02:00
MacroFake
57bf12523c
Merge bitcoin/bitcoin#24934: refactor, miner: Delete call to UpdatePackagesForAdded at beginning of addPackageTxs
7036cf52aa Delete UpdatePackagesForAdded at beginning of addPackageTxs. (KevinMusgrave)

Pull request description:

  In `CreateNewBlock` (in miner.cpp), `inBlock` is cleared before `addPackageTxs`, so `inBlock` will be empty in the first call to `UpdatePackagesForAdded`. I saw this brought up in these [PR review club logs](https://bitcoincore.reviews/24538) and there didn't seem to be a definitive answer for why the call is necessary. There's also an [old PR](https://github.com/bitcoin/bitcoin/pull/10200) where this change was going to be applied, but it got closed.

  If `addPackageTxs` can be called when `inBlock` is not empty, then maybe a test should be added for that case. All the tests seem to pass with this deletion.

ACKs for top commit:
  glozow:
    utACK 7036cf52aa

Tree-SHA512: 9e757b71b9035f68a0c6fef229b8cd83f1bdbe23f05bb02cc1bab8c3c177805b388bceb2bb1f0bce354791ccb29f351a6c51979b96ffe4d9fc6c978f83e36afc
2022-05-27 15:11:51 +02:00
fanquake
66bb4df410
Merge bitcoin/bitcoin#25201: windeploy: Renewed windows code signing certificate
7e9fe6d800 windeploy: Renewed windows code signing certificate (Andrew Chow)

Pull request description:

  The current windows code signing certificate expires on May 26 23:59:59 2022 GMT. I have purchased a new code signing certificate which will expire on May 29 23:59:59 2024 GMT.

ACKs for top commit:
  laanwj:
    ACK 7e9fe6d800
  fanquake:
    ACK 7e9fe6d800 - tested above with OpenSSL 3 & faketime.

Tree-SHA512: 283eb863d4db0573c7e78fe9d8f1b855533fc45b0995cd2d66e40b5242eb9bc9317b01e1b151fe49d512cd4aa6c48e2390017070f79db46493813fdd0a0f568a
2022-05-27 10:59:32 +01:00
MacroFake
77e125c486
Merge bitcoin/bitcoin#25217: scripts and tools: update lint-logs.py to detect LogPrintLevel, mention WalletLogPrintf
75848ec2da scripts and tools: update lint-logs.py to detect LogPrintLevel() (Jon Atack)

Pull request description:

  Follow-up to #24464 that added the `LogPrintLevel()` macro.

  - update the `lint-logs.py` script to detect `LogPrintLevel()`
  - add `WalletLogPrintf()` (already detected but not mentioned) to the linter suggestion

  Example output:
  ```
  $ test/lint/lint-logs.py
  All calls to LogPrintf(), LogPrint(), LogPrintLevel(), and WalletLogPrintf() should be terminated with "\n".

  src/addrdb.cpp:147:        LogPrintf("banlist.dat ignored because it can only be read by " PACKAGE_NAME " version 22.x. Remove %s to silence this warning.", fs::quoted(fs::PathToString(m_banlist_dat)));
  src/addrman.cpp:388:        LogPrint(BCLog::ADDRMAN, "addrman lost %i new and %i tried addresses due to collisions or invalid addresses", nLostUnk, nLost);
  src/banman.cpp:41:        LogPrintf("Recreating the banlist database");
  src/banman.cpp:66:    LogPrint(BCLog::NET, "Flushed %d banned node addresses/subnets to disk  %dms", banmap.size(),
  src/banman.cpp:194:            LogPrint(BCLog::NET, "Removed banned node address/subnet: %s", sub_net.ToString());
  src/net.cpp:2092:                LogPrint(BCLog::NET, "Trying to make an anchor connection to %s", addrConnect.ToString());
  src/net.cpp:2408:        LogPrintLevel(BCLog::Level::Error, BCLog::NET, "%s", strError.original);
  src/net.cpp:2416:        LogPrintf("%s", strError.original);
  src/net.cpp:2432:            LogPrintf("%s", strError.original);
  src/net.cpp:2453:        LogPrintLevel(BCLog::Level::Error, BCLog::NET, "%s", strError.original);
  src/netbase.cpp:573:                LogPrintf("wait for connect to %s failed: %s",
  src/netbase.cpp:578:                LogPrint(BCLog::NET, "connection attempt to %s timed out", addrConnect.ToString());
  src/netbase.cpp:590:                LogPrintf("getsockopt() for %s failed: %s", addrConnect.ToString(), NetworkErrorString(WSAGetLastError()));
  src/wallet/wallet.cpp:186:    wallet->WalletLogPrintf("Releasing wallet");
  src/wallet/wallet.cpp:1809:        WalletLogPrintf("Rescan completed in %15dms", duration_milliseconds.count());
  ```

ACKs for top commit:
  laanwj:
    ACK 75848ec2da

Tree-SHA512: 78b3bc4428aaec2d198e1ff1c44b614fa2f2a228feb6303d97765136e4796171928d341c6e55a1d4e9e5a82ab099b14fee562b878dcf7bd2276f87bd9a8d323e
2022-05-27 10:04:49 +02:00
laanwj
c5e67be03b
Merge bitcoin/bitcoin#24032: Add defaults to vDeployments to avoid uninitialized variables
c4c5b9ca6e consensus/params: set default values for BIP9Deployment (Anthony Towns)

Pull request description:

  Adds default values for `vDeployments` in `consensus/params.h` so that undefined behaviour is avoided if a deployment is not initialized. Also adds a check in the unit tests to alert if this is happening, since even if it doesn't invoke undefined behaviour it's probably a mistake.

ACKs for top commit:
  laanwj:
    Code review ACK c4c5b9ca6e

Tree-SHA512: 22d7ff86a817d9e9e67c47301fc3b7e9d5821c13565d7706711f113dea220eea29b413a7c8d029691009159cebc85a108d77cb52418734091c196bafb2b12423
2022-05-26 20:06:10 +02:00
Andrew Chow
a0e8aff605
Merge bitcoin/bitcoin#25003: tracing: fix coin_selection:aps_create_tx_internal calling logic
6b636730f4 tracing: fix `coin_selection:aps_create_tx_internal` calling logic (Sebastian Falbesoner)

Pull request description:

  According to the documentation, the tracepoint `coin_selection:aps_create_tx_internal` "Is called when the second `CreateTransactionInternal` with Avoid Partial Spends enabled completes."

  Currently it is only called if the second call to `CreateTransactionInternal` succeeds, i.e. the third parameter is always `true` and we don't get notified in the case that it fails. This PR fixes this by moving the tracepoint call and the `use_aps` boolean variable outside the if body.

ACKs for top commit:
  achow101:
    ACK 6b636730f4
  furszy:
    re-ACK 6b636730

Tree-SHA512: 453825123aa10748642c7dd94324ced2d07df0f4fac478b0947a34820b515ae300f75721679a90a164f3127029739df55c4de035c4567e663893c3c6dbdef216
2022-05-26 13:49:52 -04:00
Ryan Ofsky
e47c6c7656 Reset settings.json when GUI options are reset
Clear settings.json file and save settings.json.bak file when "Reset Options"
GUI button is pressed or -resetguisettings command line option is used.
2022-05-26 11:05:10 -04:00
MacroFake
2642dee136
Merge bitcoin/bitcoin#15936: interfaces: Expose settings.json methods to GUI
f9fdcec7e9 settings: Add resetSettings() method (Ryan Ofsky)
77fabffef4 init: Remove Shutdown() node.args reset (Ryan Ofsky)
0e55bc6e7f settings: Add update/getPersistent/isIgnored methods (Ryan Ofsky)

Pull request description:

  Add `interfaces::Node` `updateSetting`, `forceSetting`, `resetSettings`, `isSettingIgnored`, and `getPersistentSetting` methods so GUI is able to manipulate `settings.json` file and use and modify node settings.

  (Originally this PR also contained GUI changes to unify bitcoin-qt and bitcoind persistent settings and call these methods, but the GUI commits have been dropped from this PR and moved to bitcoin-core/gui/pull/602)

ACKs for top commit:
  vasild:
    ACK f9fdcec7e9
  hebasto:
    re-ACK f9fdcec7e9, only a function renamed since my recent [review](https://github.com/bitcoin/bitcoin/pull/15936#pullrequestreview-979324357).

Tree-SHA512: 4cac853ee29be96d2ff38404165b9dfb7c622b2a9c99a15979596f3484ffde0da3d9c9c372677dff5119ca7cffa6383d81037fd9889a29cc9285882a8dc0c268
2022-05-26 17:05:10 +02:00
Ryan Ofsky
99ccc02b65 Add release notes about unified bitcoin-qt and bitcoind persistent settings
If a bitcoind setting like pruning, port mapping, or a network proxy is enabled
in the GUI, it will now be stored in the bitcoin persistent setting file and
shared with bitcoind, instead of being stored as Qt settings backed by the
windows registry or platform specific config files.
2022-05-26 11:05:10 -04:00
Ryan Ofsky
504b06b1de Migrate -lang setting from QSettings to settings.json 2022-05-26 11:05:10 -04:00
Ryan Ofsky
9a016a3c07 Migrate -prune setting from QSettings to settings.json 2022-05-26 11:05:10 -04:00
Ryan Ofsky
f067e19433 Migrate -proxy and -onion settings from QSettings to settings.json 2022-05-26 11:05:10 -04:00
Ryan Ofsky
a09e3b7cf2 Migrate -listen and -server settings from QSettings to settings.json 2022-05-26 11:05:10 -04:00
Ryan Ofsky
d2ada6e635 Migrate -upnp and -natpmp settings from QSettings to settings.json
This also effectively reverts 58e8364dcd from
#18077, applying upnp and natpmp settings from the optionsmodel class instead
of the optionsdialog class. This makes sense because model code, not view code
is responsible for applying all other settings, and because leaving these
settings half-applied in optionsmodel seems error prone and could lead to bugs.
(These things were discussed a little in
https://github.com/bitcoin/bitcoin/pull/18077#discussion_r560381734)
2022-05-26 11:05:10 -04:00
Ryan Ofsky
1dc4fc29c1 Migrate -spendzeroconfchange and -signer settings from QSettings to settings.json 2022-05-26 11:05:10 -04:00
Ryan Ofsky
a7ef6d5975 Migrate -par setting from QSettings to settings.json 2022-05-26 11:05:10 -04:00
Ryan Ofsky
284f339de6 Migrate -dbcache setting from QSettings to settings.json
This is just the first of multiple settings that will be stored in the bitcoin
persistent setting file and shared with bitcoind, instead of being stored as Qt
settings backed by the windows registry or platform specific config files which
are ignored by bitcoind.

Co-Authored-By: furszy <matiasfurszyfer@protonmail.com>
2022-05-26 11:05:10 -04:00
laanwj
48eec32347
Merge bitcoin/bitcoin#25216: Doc: Fix parameter in hwm example block
43ff37f60e Update zmq.md: Fix parameter in hwm example block (mutatrum)

Pull request description:

  Looks like a copy/paste error when `zmqpubsequence` was introduced.

ACKs for top commit:
  theStack:
    ACK 43ff37f60e

Tree-SHA512: 4d0abbba4e9fd0adc2824d0804891d677d56216d245ed0d3bffbaf76042c650edf68975d1ec4728328e69421c024fe6f8800c7e0a497934082206ea4f15cc517
2022-05-26 15:28:55 +02:00
laanwj
c324b07a54
Merge bitcoin/bitcoin#25210: doc: remove misleading AreInputsStandard() comment
be6d4315c1 doc: remove misleading AreInputsStandard() comment (James O'Beirne)

Pull request description:

  This check isn't any longer just about bad pay-to-script-hash inputs; it
  also excludes any kind of nonstandard input, unknown witness versions,
  coinbases, etc.

ACKs for top commit:
  laanwj:
    ACK be6d4315c1
  dunxen:
    ACK be6d431
  jonatack:
    ACK be6d4315c1

Tree-SHA512: 1c4befadff6a7b5789901ca2a2cc39adc35c688f7e3c093ab5292123f9193ce078731016b773b3d05f7004ff01ee62f23f8362ae8d05134d41dc097ba094a42b
2022-05-26 15:13:35 +02:00
laanwj
4901631dac
Merge bitcoin/bitcoin#25202: log: Use severity-based logging for leveldb/libevent messages, reverse LogPrintLevel order
c4e7717727 refactor: Change LogPrintLevel order to category, severity (laanwj)
ce920713bf leveldb: Log messages from leveldb with category and debug level (laanwj)
18ec120bb9 http: Use severity-based logging for messages from libevent (laanwj)
bd971bffb0 logging: Unconditionally log levels >= WARN (laanwj)

Pull request description:

  Log messages from leveldb and libevent libraries in the severity+level based log format introduced in bitcoin/bitcoin#24464.

  Example of messages before:
  ```
  2022-05-24T18:11:57Z [libevent] libevent: event_add: event: 0x55da963fcc10 (fd 10), EV_READ    call 0x7f1c7a254620
  2022-05-24T18:11:57Z [libevent] libevent: Epoll ADD(1) on fd 10 okay. Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none)
  2022-05-24T18:12:08Z leveldb: Generated table #609127@1: 6445 keys, 312916 bytes
  2022-05-24T18:12:08Z leveldb: Generated table #609128@1: 5607 keys, 268548 bytes
  2022-05-24T18:12:08Z leveldb: Generated table #609129@1: 189 keys, 9384 bytes
  2022-05-24T18:12:08Z leveldb: Generated table #609130@1: 293 keys, 13818 bytes
  ```

  Example of messages after:
  ```
  2022-05-24T17:59:52Z [libevent:debug] event_add: event: 0x5652f44dac10 (fd 10), EV_READ    call 0x7f210f2e6620
  2022-05-24T17:59:52Z [libevent:debug] Epoll ADD(1) on fd 10 okay. Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none)
  2022-05-24T17:59:53Z [leveldb:debug] Recovering log #1072
  2022-05-24T17:59:53Z [leveldb:debug] Level-0 table #1082: started
  2022-05-24T17:59:53Z [leveldb:debug] Level-0 table #1082: 193 bytes OK
  2022-05-24T17:59:53Z [leveldb:debug] Delete type=3 #1070
  2022-05-24T17:59:53Z [leveldb:debug] Delete type=0 #1072
  ```

  The first commit changes it so that messages with level Warning and Error are always logged independent of the `-debug` setting. I think this is useful to make sure warnings and errors, which tend to be important, are not lost. In the future this should be made more configurable.

  Last commit changes LogPrintLevel argument order to category, severity: This is more consistent with the other functions, as well as with the logging output itself. If we want to make this change, we should do it before it's all over the place.

ACKs for top commit:
  jonatack:
    Tested ACK c4e7717727

Tree-SHA512: ea48a1517f8c1b23760e59933bbd64ebf09c32eb947e31b8c2696b4630ac1f4303b126720183e2de052bcede3a17e475bbf3fbb6378a12b0fa8f3582d610930d
2022-05-26 15:04:07 +02:00
Jon Atack
75848ec2da scripts and tools: update lint-logs.py to detect LogPrintLevel()
and add WalletLogPrintf() (already detected) to the lint-logs.py suggestion

Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>
2022-05-26 14:59:29 +02:00
laanwj
cacbdbaa95
Merge bitcoin/bitcoin#25132: consensus: Add BIP-341 specified constraints in ComputeTaprootMerkleRoot
bd7c5e2f0a Add BIP-341 specified constraints to `ComputeTaprootMerkleRoot` (David Bakin)

Pull request description:

  [**N.B.:** This PR **_does not change the consensus_**.  It only adds `assert` statements according to the current consensus in consensus-sensitive code (`interpreter.cpp`). So that's why the bot added the "consensus" tag and I prefixed the PR title with "consensus".]

  BIP 341 specifies [constraints on the size of the control block _c_ used to compute the taproot merkle root](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#script-validation-rules).

  > The last stack element is called the control block _c_, and must have length _33 + 32m_, for a value of _m_ that is an integer between 0 and 128, inclusive. Fail if it does not have such a length.

  The actual merkle root is computed in `ComputeTaprootMerkleRoot` ([interpreter.cpp@1833](https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1833)) - this code does _not_ check these constraints.

  All the callers do check the constraints before calling `ComputeTaprootMerkleRoot`.  But in the future there may be more callers, and these checks may be inadvertently omitted at those future calls.  Also, code at/near the current call sites may also change and skip these checks.  Therefore _this PR adds those checks as `asserts` directly in `ComputeTaprootMerkleRoot`_ to help prevent that error.

  No unit tests provided: they'd have to be death tests as these are `assert` statements which raise `SIGABRT` and kill the program.  Boost Test has a way to implement death tests (see the in-progress draft PR #25097 at [this code (you may have to click to expand the diff)](https://github.com/bitcoin/bitcoin/pull/25097/files#diff-21483d0e032747850208f21325b29cde89e9c1f55f83a7a166a388cc5c27115aR1089) and could be added here if desired by reviewers.

  Current callers of `ComputeTaprootMerkleRoot`:
  - `InferTaprootTree` ([standard.cpp@1552](https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.cpp#L546))
  - `VerifyTaprootCommittment` ([interpreter.cpp@1859](https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1859)) does a partial check, but it is called from `VerifyWitnessProgram` ([interpreter.cpp@1922](https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1918)) where a full check is done

ACKs for top commit:
  sipa:
    ACK bd7c5e2f0a
  theStack:
    ACK bd7c5e2f0a

Tree-SHA512: cec5aebfdf9fc9d13011abdf8427c934edf1df1ffc32b3e7cc5580f12809f24cf83e64ab0c843fabfce3591873bfcfa248277b30820fd786684319a196e4e550
2022-05-26 14:34:04 +02:00
Andrew Chow
192d639a6b
Merge bitcoin/bitcoin#25213: fuzz: fix crash at coinselection, add missing fee rate.
c97e961d46 fuzz: coinselection, add missing fee rate. (furszy)

Pull request description:

  Fixing https://github.com/bitcoin/bitcoin/pull/25083#issuecomment-1136774756.

  Without the fee rate, 'GroupOutputs' will crash at group insertion time `OutputGroup::Insert` because now `output.GetEffectiveValue()` asserts that the value exists.

ACKs for top commit:
  achow101:
    ACK c97e961d46
  ishaanam:
    ACK c97e961d46
  Xekyo:
    ACK c97e961d46
  brunoerg:
    ACK c97e961d46

Tree-SHA512: f495886a5078842103e0f05a9018d7cb491967d8362f893dd7b21132b98e94321df860c50acb69e84d7232779f5915322ca6b5f99908e05e0480012580ee9d5d
2022-05-25 19:04:23 -04:00
Ryan Ofsky
44904aa632 multiprocess build cleanup: comment on manual dependencies
Also move manual dependency closer to actual build target
2022-05-25 18:01:22 -04:00
mutatrum
43ff37f60e
Update zmq.md: Fix parameter in hwm example block 2022-05-25 23:49:15 +02:00
David Bakin
bd7c5e2f0a Add BIP-341 specified constraints to ComputeTaprootMerkleRoot
BIP 341 specifies constraints on the size of the control block _c_ used
to compute the taproot merkle root.

> The last stack element is called the control block _c_, and must have
> length _33 + 32m_, for a value of m that is an integer between 0 and
> 128, inclusive. Fail if it does not have such a length.

(See BIP-341 "Script Validation Rules" here: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#script-validation-rules)
2022-05-25 12:51:01 -07:00
furszy
c97e961d46
fuzz: coinselection, add missing fee rate.
Otherwise, 'GroupOutputs' will crash at group insertion time (output.GetEffectiveValue() asserts that the value exists).
2022-05-25 14:07:33 -03:00
Ryan Ofsky
6e1c16c144 multiprocess build fix: ipc/capnp/init.capnp.h: No such file or directory
Error was reported by SatoriHoshiAiko in
https://github.com/bitcoin/bitcoin/issues/25207 and happens unpredictably
because make doesn't always build dependencies in the same order.

The source file src/ipc/capnp/protocol.cpp includes some generated headers so
needs to have an explicit dependency specified in the makefile so the headers
will be generated before the file is compiled. #19160 added the explicit
dependency, but it was incorrect because it referred to an old file path from
before the source file was renamed (ipc.cpp -> protocol.cpp)
2022-05-25 11:40:51 -04:00