Commit graph

33029 commits

Author SHA1 Message Date
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
facd5d92e1
doc: Fix getblockchaininfo/getdeploymentinfo RPC docs 2022-03-16 09:17:35 +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
Ben Woosley
9d2005285c
doc: Revise comments and whitespace to clarify 2022-03-14 12:20:09 +00:00
Ben Woosley
def43a4d88
refactor: Rename i to curr_try in SelectCoinsBnB
Clarifies purpose and removes name collisions with other indicies.
2022-03-14 12:20:08 +00:00
Ben Woosley
1dd0923677
refactor: Track BnB selection by index
This is a performance optimization - rather than track all visited values
in a bool vector, track the selected index in a vector. This results in a
complexity reduction of O(utxo_size) to O(selection_size).
2022-03-14 12:19:51 +00: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
fanquake
23e8c702bc
Merge bitcoin/bitcoin#24421: miner: always assume we can build witness blocks
40e871d9b4 [miner] always assume we can create witness blocks (glozow)

Pull request description:

  Given the low possibility of a reorg reverting the segwit soft fork, there is no longer a need to check whether segwit is active to see if it's okay to add to the block template (see also #23512, #21009, etc). `TestBlockValidity()` is also run on the block template at the end of `CreateNewBlock()`, so any invalid block would be caught there.

ACKs for top commit:
  gruve-p:
    ACK 40e871d9b4
  jnewbery:
    utACK 40e871d9b4, although I disagree about changing the test for segwit transaction in mempool before activagtion, instead of just removing it: https://github.com/bitcoin/bitcoin/pull/24421#discussion_r822933721.
  achow101:
    ACK 40e871d9b4
  theStack:
    Code-review ACK 40e871d9b4

Tree-SHA512: bf4860bf2bed8339622d05228d11d60286edb0c32a9a3c434b8d154913c07ea56e50649f4af7009c2a1c6a58a81d2299ab43b41a6f16dee7d08cc89cc1603019
2022-03-11 15:00:38 +00:00
glozow
ec7d73628a [wallet] assert BnB internally calculated waste is the same as GetSelectionWaste()
These two implementations of waste calculation should never deviate.
Still keep the SelectCoinsBnB internal calculation because incremental
calculate-as-you-go is much more performant than calling
GetSelectionWaste() over and over again.
2022-03-11 12:22:34 +00:00
fanquake
bb0b39ce6f
Merge bitcoin/bitcoin#24524: doc: remove Boost LDFLAGS from netBSD build docs
8336a06dbd doc: remove Boost LDFLAGS from netBSD build docs (fanquake)

Pull request description:

  We no-longer link against any Boost libs, so we shouldn't need to use
  any Boost linker flags.

ACKs for top commit:
  hebasto:
    ACK 8336a06dbd, I have reviewed the code and it looks OK, I agree it can be merged. Also verified that there is no other usage of `BOOST_LDFLAGS` in our codebase or documentation.

Tree-SHA512: b7814d10cee789903cb3c613631e184a72f5766cda85261b5f99f9ac207348a2a49c92494c8c1d50163494f6b755c503cf51bf083b31f564dae1b0f493c54c2e
2022-03-11 11:25:58 +00:00
fanquake
ce1fabe545
Merge bitcoin/bitcoin#24509: doc: Add guix prefix for changes to reproducible builds
f1f994a122 doc: Add `guix` prefix for changes to reproducible builds (Hennadii Stepanov)

Pull request description:

  Most of contributors already use the `guix:` prefix for changes to `contrib/guix`. Also `guix` is shorter than `build`, and it is more focused/specific.

ACKs for top commit:
  fanquake:
    ACK f1f994a122

Tree-SHA512: 3f754e80802ec4e871b099ce1f0877e34ecc4816fbe9c49bfd2a7368ef79fed9edf6c65f38eedef2a87367fdc911dc548e0def422d80b66a91ce2e5f35826032
2022-03-11 10:27:05 +00:00
fanquake
f661da70b9
Merge bitcoin/bitcoin#24521: build: Fix Boost.Process detection on macOS arm64
1d4157a42b build: Fix Boost.Process detection on macOS arm64 (Hennadii Stepanov)

Pull request description:

  Could be tested as follows:
  ```
  % brew install boost@1.76
  % ./autogen.sh
  % ./configure --with-boost='/opt/homebrew/opt/boost@1.76'
  ```

ACKs for top commit:
  promag:
    Tested ACK on 1d4157a42b with boost 1.76 on macOS arm64. #24523 is required for boost 1.78.

Tree-SHA512: 7abd39a78e970ecc051e53b5923dfc31d3f0576cf4ff7fcfb9c8708c857c46a7a595ec36238def83f41158970eeee209980da4b8b70f0ff68f940a38ac9a0471
2022-03-11 10:24:12 +00:00
Jon Atack
5d7c69b887
rpc: rename getdeploymentinfo status-next to status_next 2022-03-11 10:21:48 +01:00
Martin Zumsande
5ce3057c8e test: set segwit height back to 0 on regtest
This was changed in #22818 from 0 to 1. Since it changes
BLOCK_OPT_WIT of the genesis block, older versions of bitcoin
core would not read regtest directories created with newer versions
without a reindex.
2022-03-10 20:24:11 +01:00
fanquake
339b4a51f6
build: don't install deprecated libevent headers
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.
2022-03-10 15:52:26 +00:00
Hennadii Stepanov
93feabcb30
Merge bitcoin-core/gui#563: qt: Remove network detection based on address in BIP21
b7dbc83f23 qt: Remove network detection based on address in BIP21 (laanwj)

Pull request description:

  This is removes some ugly and brittle code that switches the global network to testnet based on a provided address. I think in practice it's very unlikely for testnet BIP21 payment URIs to be used, and if so it's for testing so it's easy enough to manually copy it. Or to specify `-testnet` explicitly.

  There is already no such case for `-regtest` or `-signet`.

  After this change it will only accept addresses for the explicitly selected network. Others will result in a "wrong network" popup.

  There is also a possibility for refactor after this as the initialization order of `PaymentServer::ipcParseCommandLine` isn't important anymore (well, it still has to be before `PaymentServer::ipcSendCommandLine`, maybe even merged with it), but I have not done so here.

ACKs for top commit:
  jonatack:
    ACK  b7dbc83f23
  achow101:
    ACK b7dbc83f23

Tree-SHA512: ebc77c0e5c98f53fe254bcd0f94c9d1c06937b794346e95b14158860d5c607515e71d73b782d2726674dce86d6d4001085d473c6d1bc11c5e6c25ff3fb3cfa22
2022-03-10 15:57:03 +01:00
fanquake
8336a06dbd
doc: remove Boost LDFLAGS from netBSD build docs
We no-longer link against any Boost libs, so we shouldn't need to use
any Boost linker flags.
2022-03-10 14:30:09 +00:00
MarcoFalke
597ee30b5e
Merge bitcoin/bitcoin#24522: ci: remove compiled-but-unused BDB from MSAN job
3566353c5e ci: remove compiled-but-unused BDB from MSAN job (fanquake)

Pull request description:

  Self-compiled BDB was added to this job as opposed to using depends BDB [due to linking issues](https://github.com/bitcoin/bitcoin/pull/18288#discussion_r433189350), however the compiled BDB is not actually used. Remove it for now, given we don't actually lose any coverage (note that BDB is also not currently used in the naitve MSAN fuzz job or for [OSS Fuzz](https://github.com/google/oss-fuzz/blob/master/projects/bitcoin-core/build.sh#L32) builds).

  In future, we can use depends BDB, however introducing it now will cause false positives, which can be fixed by upgrading the versions of Clang / LLVM we use, however upgrading to those newer versions causes other issues, which appear in standard library code, and require more involved suppressing, which can be solved in a follow up or another PR i.e #23008.

Top commit has no ACKs.

Tree-SHA512: 9e8fdd95246cafa27cda7bcf0641b428d4573f6748ecdf07cc6205a64351db22ba383ec943e88a69df3694ccb9f125d994b64345a4e44fb6fea4a014504760d1
2022-03-10 15:22:07 +01:00
fanquake
6c37eae0ad
Merge bitcoin/bitcoin#24404: refactor: Remove confusing P1008R1 violation in ATMPArgs
faa1aec26b Remove confusing P1008R1 violation in ATMPArgs (MarcoFalke)

Pull request description:

  The `= delete` doesn't achieve the stated goal and it is also redundant, since it is not possible to default construct the `ATMPArgs` type.

  This can be tested with:

  ```diff
  diff --git a/src/validation.cpp b/src/validation.cpp
  index 2813b62462..1c939c0b8a 100644
  --- a/src/validation.cpp
  +++ b/src/validation.cpp
  @@ -519,6 +519,7 @@ public:
           /** Parameters for child-with-unconfirmed-parents package validation. */
           static ATMPArgs PackageChildWithParents(const CChainParams& chainparams, int64_t accept_time,
                                                   std::vector<COutPoint>& coins_to_uncache) {
  +            ATMPArgs{};
               return ATMPArgs{/* m_chainparams */ chainparams,
                               /* m_accept_time */ accept_time,
                               /* m_bypass_limits */ false,
  ```

  Which fails on current master *and* this pull with the following error:

  ```
  validation.cpp:525:22: error: reference member of type 'const CChainParams &' uninitialized
              ATMPArgs{};
                      ~^
  validation.cpp:470:29: note: uninitialized reference member is here
          const CChainParams& m_chainparams;
                              ^
  1 error generated.
  ```

  Further reading (optional):
  * http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1008r1.pdf

ACKs for top commit:
  achow101:
    ACK faa1aec26b
  glozow:
    code review ACK faa1aec26b

Tree-SHA512: 16db2c9959a1996eafbfa533dc4d1483761b9d28295aed5a82b86abd7268da37c51c59ddc67c205165ecb415dbe637b12a0e1b3234d50ab0b3b79de66d7bd73e
2022-03-10 13:57:36 +00:00
fanquake
3566353c5e
ci: remove compiled-but-unused BDB from MSAN job
Self-compiled BDB was added to this job as opposed to using depends BDB
due to linking issues, however the compiled BDB is not actually used.
Remove it for now, given we don't actually lose any coverage (note that
BDB is also no used the MSAN fuzz job), and in future, we can use
depends BDB.
2022-03-10 12:48:21 +00:00
fanquake
4f5d3ce5a0
Merge bitcoin/bitcoin#24486: wallet: refactor: dedup sqlite blob binding
8ea6167099 wallet: refactor: dedup sqlite blob binding (Sebastian Falbesoner)

Pull request description:

  This refactoring PR deduplicates repeated SQLite blob binding to a statement with a newly introduced helper function `BindBlobToStatement`, abstracting away the calls to `sqlite3_bind_blob(...)`.
  This should be more readable and less error-prone, e.g. in case that the error handling has to be adapted. As a slight drawback, the function where the binding happens is not printed anymore (`__func__`), i.e. one could argue this is not strictly a refactoring, but IMHO the advantages of deduplication outweigh this; binding errors are purely internal logic errors (wrong use of the sqlite API) rather than something that is dependend on external data like DB content.

ACKs for top commit:
  laanwj:
    Code review ACK 8ea6167099
  achow101:
    ACK 8ea6167099
  klementtan:
    ACK 8ea6167099

Tree-SHA512: 1de0d214f836bc405a01e98a3a2d71f2deaddc7d23c31cad80219d1614bec92619c06d9a4a091dd563d3e95ffb879649c29745d8f89669b2a5330552c212af3f
2022-03-10 12:40:20 +00:00
Andrew Chow
61152183ab wallet: Add a deprecation warning for newly created legacy wallets 2022-03-10 07:32:02 -05:00
Hennadii Stepanov
1d4157a42b
build: Fix Boost.Process detection on macOS arm64
Could be tested as follows:
```
% brew install boost@1.76
% ./autogen.sh
% ./configure --with-boost='/opt/homebrew/opt/boost@1.76'
```
2022-03-10 13:07:42 +01:00
laanwj
b7dbc83f23 qt: Remove network detection based on address in BIP21
This is some very ugly and brittle code that switches the global network
based on a provided address, remove it. I think in practice it's very
unlikely for testnet BIP21 payment URIs to be used, and if so it's for
testing so it's easy enough to manually copy it. Or to specify
`-testnet` explicitly.

There is already no case for `-regtest` or `-signet`.
2022-03-10 12:56:19 +01:00
Jon Atack
5347c9732f
doc: update multisig-tutorial.md to default wallet type 2022-03-10 12:50:34 +01:00
MarcoFalke
76d44e832f
Merge bitcoin/bitcoin#24469: test: Correctly decode UTF-8 literal string paths
2f5fd3cf92 test: Correctly decode UTF-8 literal string paths (Ryan Ofsky)

Pull request description:

  Call `fs::u8path()` to convert some UTF-8 string literals to paths, instead of relying on the implicit conversion. Fake Macro pointed out in https://github.com/bitcoin/bitcoin/pull/24306#discussion_r818566106 that `fs_tests` are incorrectly decoding some literal UTF-8 paths using the current windows codepage, instead of treating them as UTF-8. This could cause test failures depending what environment windows tests are run under.

  The `fs::path` class exists to avoid problems like this, but because it is lenient with `const char*` conversions, under assumption that they are ["safe as long as the literals are ASCII"](727b0cb592/src/fs.h (L39)), bugs like this are still possible.

  If we think this is a concern, followup options to try to prevent this bug in the future are:

  0. Do nothing
  1. Improve the "safe as long as the literals are ASCII" comment. Make it clear that non-ASCII strings are invalid.
  2. Drop the implicit `const char*` conversion functions. This would be nice because it would simplifify the `fs::path` class a little, while making it safer. Drawback is that it would require some more verbosity from callers. For example, instead of `GetDataDirNet() / "mempool.dat"` they would have to write `GetDataDirNet() / fs::u8path("mempool.dat")`
  3. Keep the implicit `const char*` conversion functions, but make them call `fs::u8path()` internally. Change the "safe as long as the literals are *ASCII*" comment to "safe as long as the literals are *UTF-8*".

  I'd be happy with 0, 1, or 2. I'd be a little resistant to 3 even though it was would add more safety, because it would slightly increase complexity, and because I think it would encourage representing paths as strings, when I think there are so many footguns associated with paths as strings, that it's best to convert strings to paths at the earliest point possible, and convert paths to strings at the latest point possible.

ACKs for top commit:
  laanwj:
    Code review ACK 2f5fd3cf92
  w0xlt:
    crACK 2f5fd3c

Tree-SHA512: 9c56714744592094d873b79843b526d20f31ed05eff957d698368d66025764eae8bfd5305d5f7b6cc38803f0d85fa5552003e5c6cacf1e076ea6d313bcbc960c
2022-03-10 12:49:50 +01:00