Commit Graph

36340 Commits

Author SHA1 Message Date
MarcoFalke
fa448c27d2
test: Return fee from MiniWallet 2023-01-17 10:33:22 +01:00
MarcoFalke
faec09f240
test: Return chain of MiniWallet txs from MiniWallet chain method 2023-01-17 10:32:36 +01:00
MarcoFalke
faa12d4ccd
test: Refactor MiniWallet sign_tx
To make the code less verbose and easier to read.
2023-01-17 10:32:23 +01:00
MarcoFalke
fa2d82103f
test: Return wtxid from create_self_transfer_multi
This is not used right now, but may be in the future. Also, it
simplifies the create_self_transfer return logic
2023-01-17 10:30:00 +01:00
MarcoFalke
8339f3cea8
Merge bitcoin/bitcoin#26886: test: add rescan utxos inside MiniWallet's initialization
6bd098a838 test: simplify tests by using the pre-mined chain (kouloumos)
42029a7fd4 test: remove redundant blocks generation logic (kouloumos)
0377d6bb42 test: add `rescan_utxos` in MiniWallet's initialization (kouloumos)

Pull request description:

  When a pre-mined blockchain is used (default behavior), it [contains coinbase outputs in blocks 76-10](07c54de550/test/functional/test_framework/test_framework.py (L809-L813)) to [the MiniWallet's default address](07c54de550/test/functional/test_framework/wallet.py (L99-L101)). That's why we always* `rescan_utxos()` after initializing the MiniWallet, in order for the MiniWallet to account for those mature UTXOs.

  > The tests following this usage pattern can be seen with:
  > ```git grep -n "MiniWallet(" $(git grep -le "rescan_utxos()" $(git grep -Le "self.setup_clean_chain = True"))```

  **This PR adds `rescan_utxos()` inside MiniWallet's initialization to simplify usage when the MiniWallet is used with a pre-mined chain.**

  ### secondary changes

  - *There are a few tests that use the pre-mined blockchain but do not `rescan_utxos()`, they instead generate new blocks to create mature UTXOs.

    > Those were written before the `rescan_utxos()` method was introduced with https://github.com/bitcoin/bitcoin/pull/22955 (fac66d0a39) and can be seen with:
    > `git grep -n "MiniWallet(" $(git grep -Le "rescan_utxos()" $(git grep -Le "self.setup_clean_chain = True"))`
    >

    After including `rescan_utxos()` inside MiniWallets initilization, this blocks generation logic is not needed as the MiniWallet already accounts for enough mature UTXOs to perform the tests. **Therefore the now redundant blocks generation logic is removed from those tests with the second commit.**

  - The rest of the MiniWallet tests use a clean chain (`self.setup_clean_chain = True`)  and can be seen with
    `git grep -n "MiniWallet(" $(git grep -le "self.setup_clean_chain = True")`

    From those, there are a few that start from a clean chain and then create enough mature UTXOs for the MiniWallet with this kind of logic:
   07c54de550/test/functional/mempool_expiry.py (L36-L40)

    **Those tests are simplified in the third commit to instead utilize the mature UTXOs of the pre-mined chain.**

ACKs for top commit:
  MarcoFalke:
    ACK 6bd098a838 🕷
  theStack:
    re-ACK 6bd098a838

Tree-SHA512: 7f9361e36910e4000c33a32efdde4449f4a8a763bb42df96de826fcde469f9362f701b8c99e2a2c482d2d5a42a83ae5ae3844fdbed187ed0ff231f386c222493
2023-01-17 09:38:32 +01:00
Andrew Chow
04e54fd21f
Merge bitcoin/bitcoin#26325: rpc: Return accurate results for scanblocks
5ca7a7be76 rpc: Return accurate results for scanblocks (Aurèle Oulès)

Pull request description:

  Implements #26322.
  Adds a `filter_false_positives` mode to `scanblocks` to accurately verify results from blockfilters.

  If the option is enabled, pre-results given by blockfilters will be filtered out again by checking vouts and vins of all transactions of the relevant blocks against the given descriptors.

  ### Master
  ```bash
  ./src/bitcoin-cli -testnet -named scanblocks action=start scanobjects='["addr(tb1qcxf2gv93c26s6mqz7y6etpqdf70zmn67dualgr)"]'
  {
    "from_height": 0,
    "to_height": 2376055,
    "relevant_blocks": [
      "000000000001bc35077dec4104e0ab1f667ae27059bd907f9a8fac55c802ae36",
      "00000000000120a9c50542d73248fb7c37640c252850f0cf273134ad9febaf61",
      "0000000000000082f7af3835da8b6146b0bfb243b8842f09c495fa1e74d454ed",
      "0000000000000094c32651728193bfbe91f6789683b8d6ac6ae2d22ebd3cb5d3"
    ]
  }
  ```

  ### PR (without `filter_false_positives` mode)
  Same as master
  ```bash
  ./src/bitcoin-cli -testnet -named scanblocks action=start scanobjects='["addr(tb1qcxf2gv93c26s6mqz7y6etpqdf70zmn67dualgr)"]' filter_false_positives=false
  {
    "from_height": 0,
    "to_height": 2376055,
    "relevant_blocks": [
      "000000000001bc35077dec4104e0ab1f667ae27059bd907f9a8fac55c802ae36",
      "00000000000120a9c50542d73248fb7c37640c252850f0cf273134ad9febaf61",
      "0000000000000082f7af3835da8b6146b0bfb243b8842f09c495fa1e74d454ed",
      "0000000000000094c32651728193bfbe91f6789683b8d6ac6ae2d22ebd3cb5d3"
    ]
  }
  ```

  ### PR (with `filter_false_positives` mode)
  ```bash
  ./src/bitcoin-cli -testnet -named scanblocks action=start scanobjects='["addr(tb1qcxf2gv93c26s6mqz7y6etpqdf70zmn67dualgr)"]' filter_false_positives=true
  {
    "from_height": 0,
    "to_height": 2376058,
    "relevant_blocks": [
      "0000000000000082f7af3835da8b6146b0bfb243b8842f09c495fa1e74d454ed",
      "0000000000000094c32651728193bfbe91f6789683b8d6ac6ae2d22ebd3cb5d3"
    ]
  }
  ```

  Also adds a test to check that the blockhash of a transaction will be included in the `relevant_blocks` whether the `filter_false_positives` mode is enabled or not.

ACKs for top commit:
  achow101:
    ACK 5ca7a7be76
  theStack:
    re-ACK 5ca7a7be76
  furszy:
    Code review ACK 5ca7a7be

Tree-SHA512: e8f3cceddddd66f59509717b6314d89e2fef241e13cee81b18fd95e8362cbb95cc40f884342ce6cf892a86febd9e2d434afce05d51892240e67f72ae991852e7
2023-01-16 17:39:51 -05:00
Andrew Chow
b55b11f92a
Merge bitcoin/bitcoin#25375: rpc: add minconf/maxconf options to sendall and fund transaction calls
cfe5aebc79 rpc: add minconf and maxconf options to sendall (ishaanam)
a07a413466 Wallet/RPC: Allow specifying min & max chain depth for inputs used by fund calls (Juan Pablo Civile)

Pull request description:

  This PR adds a "minconf" option to `fundrawtransaction`, `walletcreatefundedpsbt`,  and `sendall`.
  Alternative implementation of #14641
  Fixes #14542

  Edit: This PR now also adds this option to `send`

ACKs for top commit:
  achow101:
    ACK cfe5aebc79
  Xekyo:
    ACK cfe5aebc79
  furszy:
    diff ACK cfe5aebc, only a non-blocking nit.

Tree-SHA512: 836e610926eec3a62308fba88ddbd6a13d8f4dac37352d0309599f893cde9c1df5e9c298fda6e076493068e4d213e4afa7290a9e3bdb5a95a5d507da3f7b59e8
2023-01-16 17:23:51 -05:00
kouloumos
6bd098a838 test: simplify tests by using the pre-mined chain 2023-01-16 19:14:21 +02:00
kouloumos
42029a7fd4 test: remove redundant blocks generation logic
those tests already have enough mature utxos from the pre-mined chain.
2023-01-16 19:14:11 +02:00
kouloumos
0377d6bb42 test: add rescan_utxos in MiniWallet's initialization
this simplifies usage when MiniWallet is used with a pre-mined chain.
2023-01-16 19:01:09 +02:00
MarcoFalke
599e941c19
Merge bitcoin/bitcoin#26657: test: Run feature_bip68_sequence.py with MiniWallet
4159ccd031 test: Run feature_bip68_sequence.py with MiniWallet (Miles Liu)
fc0caaf4aa test: Add "include mempool" flag to MiniWallet rescan_utxos (Miles Liu)
d0a909ae54 test: Add "include immature coinbase" flag to MiniWallet get_utxos (Miles Liu)
e5b9127d9e test: Add signs P2TR and RAWSCRIPT to MiniWallet sign_tx (Miles Liu)

Pull request description:

  This PR enables one more of the non-wallet functional tests (feature_bip68_sequence.py) to be run even when no wallet is compiled in by using the MiniWallet instead, as proposed in #20078.

ACKs for top commit:
  achow101:
    ACK 4159ccd031
  MarcoFalke:
    review ACK 4159ccd031 🤸

Tree-SHA512: e891b189381e961c840b45fc30d058363707fd54c1c4bdc3d29623b03309981f1d3ebfac27e6aecf621bdbcd7e31754a3ef7c53f86346f7dd241c137e64c92bd
2023-01-16 16:26:12 +01:00
MarcoFalke
6b7ccb98a5
Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h
282019cd3d refactor: add kernel/cs_main.* (fanquake)

Pull request description:

  One place to find / include `cs_main`.
  No more:
  > // Actually declared in validation.cpp; can't include because of circular dependency.
  > extern RecursiveMutex cs_main;

  Ultimately, no more need to include `validation.h` (which also includes (heavy/boost filled) `txmempool.h`) everywhere for `cs_main`. See #26087 for another example of why that is useful.

ACKs for top commit:
  ajtowns:
    ACK 282019cd3d

Tree-SHA512: 142835b794873e7a09c3246d6101843ae81ec0c6295e6873130c98a2abfa5f7282748d0f1a37237a779cc71c3bc0a75d03b20313ef5398c83d4814215cbc8287
2023-01-16 13:44:56 +01:00
MarcoFalke
2182149dc5
Merge bitcoin/bitcoin#26631: test: add coverage for dust mempool policy (-dustrelayfee setting)
d6fc1d6a33 test: add coverage for dust mempool policy (`-dustrelayfee` setting) (Sebastian Falbesoner)
8a5dbe2879 test: add `CScript` method for checking for witness program (Sebastian Falbesoner)

Pull request description:

  This PR adds missing test coverage for the `-dustrelayfee` setting, which specifies the fee-rate used to define dust. Output scripts for all common types that are treated as standard by default (P2PK, P2(W)PKH, P2(W)SH, P2TR, bare multisig, null data, unknown witness versions v2+) are created and then checked for dust-mempool-policy each via the `testmempoolaccept` RPC: a tx with an output's nValue equal to the dust threshold should be accepted, one with an nValue of just one 1 satoshi below that should be rejected with reason `dust`. This is repeatedly done for a fixed (but obviously somewhat arbitrary) list of different `-dustrelayfee` settings on a single node, including the default and zero (i.e. no dust limit) settings.

  Note that the first commit introduces a necessary `CScript` helper method `IsWitnessProgram` (using PascalCase in Python is likely controversial; in this case the style for the already existing method `GetSigOpCount` was followed, which also refers to a method in the core `CScript` class).

  Some historical information about dust, contributed by pablomartin4btc:
  "The concept of dust was first introduced in https://github.com/bitcoin/bitcoin/pull/2577. This [commit](eb30d1a5b2) from https://github.com/bitcoin/bitcoin/pull/9380 introduced the -dustrelayfee option. Previous to that PR, the dust feerate was whatever -minrelaytxfee was set to."

ACKs for top commit:
  LarryRuane:
    ACK d6fc1d6a33
  glozow:
    ACK d6fc1d6a33
  kouloumos:
    ACK d6fc1d6a33

Tree-SHA512: 35ea2b2497dfb466395af5665bb217f7250aa7cab9dc43539a5658ab69a454e3623ff58fce7489fcc1105b37f8cb4840a93cec658c5df1de611732bc6439ccad
2023-01-16 11:36:13 +01:00
MarcoFalke
08d2a3ab4b
Merge bitcoin/bitcoin#26891: ci: Update "Win64 native" task
46c31eea8c ci: Bump `ccache` version to the latest 4.7.4 in "Win64 native" task (Hennadii Stepanov)
1039ed44fb ci: Bump vcpkg to the latest version 2023.01.09 (Hennadii Stepanov)

Pull request description:

  This PR bumps `vcpkg` and `ccache` versions.

  Dependency changes in `vcpkg` ([2022.09.27](https://github.com/microsoft/vcpkg/releases/tag/2022.09.27) - [2023.01.09](https://github.com/microsoft/vcpkg/releases/tag/2023.01.09)):
   - boost 1.80.0#0 -> 1.81.0#0
   - libevent 2.1.12#6 -> libevent 2.1.12#7
   - sqlite3 3.39.2#0 -> 3.40.0#1

  Also see https://github.com/bitcoin/bitcoin/pull/26866#issuecomment-1378591258.

Top commit has no ACKs.

Tree-SHA512: 9f8fda9192f76526201098c0300261c37deb8f17be19f4bfec52c5d8c78f348a11df76dc6f2d23f556cfb30e7ae5ff750ef824f2b3e133d892fe24642b802033
2023-01-16 11:13:38 +01:00
MarcoFalke
ac4c79a267
Merge bitcoin/bitcoin#26892: test: refactor: simplify p2p_permissions.py by using MiniWallet
8cbd926a2c test: refactor: simplify p2p_permissions.py by using MiniWallet (Sebastian Falbesoner)

Pull request description:

  This PR simplies the functional test p2p_permissions.py by using MiniWallet in order to avoid manual low-level tx creation. Also, rather than mining 100 blocks manually, the pre-mined chain of the test framework is used, which speeds up the test a little (~2-3 seconds faster on my machine).

ACKs for top commit:
  MarcoFalke:
    ACK 8cbd926a2c

Tree-SHA512: 36cbc2a0f6fb0251c8696cd017163ed30529690736bafd36e80b53007bd02b9030b68fe93b90dc50323526c8b7d8e0abd8f20890d46ff6015d5c632b64a08535
2023-01-16 10:37:14 +01:00
MarcoFalke
53ae1022ea
Merge bitcoin/bitcoin#26894: test: Remove redundant key_to_p2pkh call
61360e0cf9 test: Remove redundant function call (Kolby ML)

Pull request description:

  Removed unnecessary function call and assignment `get_generate_key()` already calls `key_to_p2pkh()` and stores it in the object as p2pkh_addr.

  key.p2pkh_addr is already used for most testcases as well, so it is just a redundant call

ACKs for top commit:
  MarcoFalke:
    ACK 61360e0cf9

Tree-SHA512: d39117310d6630bad7a78c051e683dbfc77b27f6182014557fb900c1adaf5f1e12039c5a6c0ea50e908d4a8688da05f2deae701f12e06086d17dde86ae275ec5
2023-01-16 10:23:50 +01:00
Kolby ML
61360e0cf9 test: Remove redundant function call 2023-01-15 18:34:01 -07:00
Hennadii Stepanov
3dd2762cf8
Merge bitcoin-core/gui#690: Catch invalid networks combination crash
f4a11d7baf gui: bugfix, catch invalid networks combination crash (furszy)

Pull request description:

  The app currently crashes if a network is set inside bitcoin.conf and
  another one is provided as param.
  The reason is an uncaught runtime_error.

ACKs for top commit:
  jarolrod:
    tACK f4a11d7baf
  johnny9:
    tACK f4a11d7baf
  john-moffett:
    ACK f4a11d7baf
  pablomartin4btc:
    Tested ACK f4a11d7baf.
  hebasto:
    ACK f4a11d7baf, tested on Ubuntu 22.04 (Qt 5.15.3).

Tree-SHA512: fc5e26ae0a361e37d53d904cc122d07f064f261b309629c6386cb046ab1b3d2c805cbfe0db8ed3e934af52c6cf0ebb0bef9df9117b4330d9b0ea40c76f9270f9
2023-01-15 18:55:59 +00:00
Sebastian Falbesoner
8cbd926a2c test: refactor: simplify p2p_permissions.py by using MiniWallet
Also, use the pre-mined chain of the test framework rather than mining
100 blocks manually on each run.
2023-01-15 01:11:15 +01:00
fanquake
0c2a1288a2
Merge bitcoin/bitcoin#26835: contrib: add PE Canary check to security-check
6ba17d4955 scripts: add PE Canary check to security-check (fanquake)

Pull request description:

  We should be checking this, same as ELF & MACHO.

  Guix Build:
  ```bash
  6334c001b276ca5f0278092be68bf6d49d9b755bcac893bbd4aa58df57356e40  guix-build-6ba17d4955b7/output/dist-archive/bitcoin-6ba17d4955b7.tar.gz
  e27ad7fffb377bc6264477933859ab47c7283a68fbf86124d3801bc4c8b790dd  guix-build-6ba17d4955b7/output/x86_64-w64-mingw32/SHA256SUMS.part
  ef7b61bd854f0d3c39f356ef85ac18d37c5740874111f5ce46f7ce3381e714ca  guix-build-6ba17d4955b7/output/x86_64-w64-mingw32/bitcoin-6ba17d4955b7-win64-debug.zip
  c419324597487f248143a076d6eb2a56b0dbf5ce690ca89afaaee5c6b352e1a1  guix-build-6ba17d4955b7/output/x86_64-w64-mingw32/bitcoin-6ba17d4955b7-win64-setup-unsigned.exe
  a18ff1e3026cd9fc08dd7b500c06a343462aef4a37538608d940d1845bcdb94a  guix-build-6ba17d4955b7/output/x86_64-w64-mingw32/bitcoin-6ba17d4955b7-win64-unsigned.tar.gz
  7e4ee0669940f4b8c1a12dab836898511a60f06a62057ac03beaca8bb693bfb4  guix-build-6ba17d4955b7/output/x86_64-w64-mingw32/bitcoin-6ba17d4955b7-win64.zip
  ```

ACKs for top commit:
  sipsorcery:
    ACK 6ba17d4955.

Tree-SHA512: 1acc24c0cb36dbc30311f4eee64e3d4737c828b97039be0f72cfe061bcb8c4d5c830d7792f503e711e219a62d85b7e07cdff3510cbd4f8d46895a7cb66b88219
2023-01-14 12:38:01 +00:00
Hennadii Stepanov
46c31eea8c
ci: Bump ccache version to the latest 4.7.4 in "Win64 native" task 2023-01-13 20:50:38 +00:00
Hennadii Stepanov
1039ed44fb
ci: Bump vcpkg to the latest version 2023.01.09
Dependency changes (2022.09.27 - 2023.01.09):
 - boost 1.80.0#0 -> 1.81.0#0
 - libevent 2.1.12#6 -> libevent 2.1.12#7
 - sqlite3 3.39.2#0 -> 3.40.0#1
2023-01-13 20:50:15 +00:00
fanquake
8915e4d9f5
Merge bitcoin/bitcoin#26824: build: fix configuring with only bitcoin-util
0f883df7a5 build: fix configuring with only bitcoin-util (fanquake)

Pull request description:

  Fixes the issue presented in #25037 in a single (easily backportable) diff, with no additional refactoring/changes.

  Can be tested with:
  ```bash
  ./configure \
    --disable-tests \
    --disable-bench \
    --without-libs \
    --without-daemon \
    --without-gui \
    --disable-fuzz-binary \
    --without-utils \
    --enable-util-util
  ```

ACKs for top commit:
  TheCharlatan:
    tACK 0f883df7a5
  hebasto:
    ACK 0f883df7a5, tested on Ubuntu 22.04.

Tree-SHA512: 3682712405c360852c4edd90c171e21302154bf8789252c64083974a5c873cf04d97e8721c7916d5b2dafa6acd2b8dc32deecf550e90e03bcbbabbbbf75ce959
2023-01-13 15:56:16 +00:00
MarcoFalke
32834034a3
Merge bitcoin/bitcoin#26882: test: skip sqlite3 tests if it isn't available
eea73d465e test: skip sqlite3 tests if it isn't available (fanquake)

Pull request description:

  Fixes #26819. Related too #26873, which adds the missing documentation.

ACKs for top commit:
  brunoerg:
    ACK eea73d465e

Tree-SHA512: 9bcf5c642695c39a58d56ef8bf4d62601ab0acd4ad71c9400b9d8a2a336a1cd55b69408a02c583d9a67c5de0286364c9f38debd03ec8316725ad69450d980f0d
2023-01-13 13:52:08 +01:00
fanquake
07c54de550
Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0
2022917223 Add secp256k1_selftest call (Pieter Wuille)
3bfca788b0 Remove explicit enabling of default modules (Pieter Wuille)
4462cb0498 Adapt to libsecp256k1 API changes (Pieter Wuille)
9d47e7b71b Squashed 'src/secp256k1/' changes from 44c2452fd3..21ffe4b22a (Pieter Wuille)

Pull request description:

  Now that libsecp256k1 has a release (https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-December/021271.html), update the subtree to match it.

  The changes themselves are not very impactful for Bitcoin Core, but include:
  * It's no longer needed to specify whether contexts are for signing or verification or both (all contexts support everything), so make use of that in this PR.
  * Verification operations can use the static context now, removing the need for some infrastructure in pubkey.cpp to make sure a context exists.
  * Most modules are now enabled by default, so we can drop explicit enabling for them.
  * CI improvements (in particular, MSVC and more recent MacOS)
  * Introduction of an internal int128 type, which has no effect for GCC/Clang builds, but enables 128-bit multiplication in MSVC, giving a ~20% speedup there (but still slower than GCC/Clang).
  * Release process changes (process documentation, changelog, ...).

ACKs for top commit:
  Sjors:
    ACK 2022917223, but 4462cb0498 could use more eyes on it.
  achow101:
    ACK 2022917223
  jonasnick:
    utACK 2022917223

Tree-SHA512: 8a9fe28852abe74abd6f96fef16a94d5a427b1d99bff4caab1699014d24698aab9b966a5364a46ed1001c07a7c1d825154ed4e6557c7decce952b77330a8616b
2023-01-13 09:40:57 +00:00
MarcoFalke
dcae3c19b8
Merge bitcoin/bitcoin#26867: doc: Mention restoring wallet via GUI
dc9bad5192 Change dots to an ellipsis and fix capitalization (John Moffett)
9b158ae73f Update to mention restoring wallet via GUI (John Moffett)

Pull request description:

  f9783b0f07 Recently added the ability to restore wallets via the GUI, but the current wallet guide says backups must be restored via RPC.

ACKs for top commit:
  kouloumos:
    ACK dc9bad5192
  jarolrod:
    re-ACK dc9bad5
  hebasto:
    re-ACK dc9bad5192

Tree-SHA512: 325a0023ef10c75073b0288f69c99f01b029b0b7b64ae91e7ef72d4ab1fa4da60fe4cd1b4528c1c0d34617122d9aee3cd9cb32aef05a25493fc01e9ec2e6cc10
2023-01-13 09:42:08 +01:00
MarcoFalke
f4ef856375
Merge bitcoin/bitcoin#26850: ci: Stop and remove CI container
fa0584eb82 ci: Stop and remove CI container (MarcoFalke)
fa5dccba32 scripted-diff: ci: Rework docker naming (MarcoFalke)

Pull request description:

  This should not affect CI runs that have `DANGER_RUN_CI_ON_HOST=1` set, for example `.cirrus.yml`.

  However, when running CI locally with podman or docker, the container is stopped and thus deleted when all tests have passed. This feature was requested in https://github.com/bitcoin/bitcoin/pull/26843#issuecomment-1374445512 and can help to reduce used disk space when running several CI tasks subsequently.

ACKs for top commit:
  fanquake:
    ACK fa0584eb82
  hebasto:
    ACK fa0584eb82, tested on Ubuntu 22.04.

Tree-SHA512: 8bc1fabd15dad06d9ab3535d2743556137d512332b377b333ab13dbd7c5911b9295549511c6f3836b3acb7f8a39fb67e5f5249e45e1178d16ad4ed0593d05f04
2023-01-12 20:43:28 +01:00
John Moffett
dc9bad5192 Change dots to an ellipsis and fix capitalization
Matches ellipsis usage in the "Restore" section.
2023-01-12 11:15:02 -05:00
John Moffett
9b158ae73f Update to mention restoring wallet via GUI 2023-01-12 11:12:25 -05:00
MarcoFalke
fcd1a57be0
Merge bitcoin/bitcoin#26827: doc: use "std lib clock" over "C++11 clock"
672f7ad747 doc: remove usages of C++11 (fanquake)

Pull request description:

  These were new in C++11, and now they are just our standard library.

ACKs for top commit:
  jarolrod:
    re-ACK 672f7ad747
  hebasto:
    re-ACK 672f7ad747

Tree-SHA512: 7e3b8b0346ba29b19e6d8536700ca510e2b543cdeecd9e740bba71ea6d0133dd96cdaeaa00f371f8ef85913ff5aaabe12878255f393dac7d354a8b89b58d050a
2023-01-12 16:49:58 +01:00
fanquake
672f7ad747
doc: remove usages of C++11
Now it's just the standard library.
2023-01-12 13:42:44 +00:00
fanquake
eea73d465e
test: skip sqlite3 tests if it isn't available
Fixes #26819. Related too #26873.
2023-01-12 13:37:15 +00:00
MarcoFalke
edc3d1b296
Merge bitcoin/bitcoin#26854: test: Fix intermittent timeout in p2p_permissions.py
fa1bf4e705 test: Fix intermittent timeout in p2p_permissions.py (MarcoFalke)

Pull request description:

  The sync is based on `bytesrecv_per_msg["verack"]`. However, the bytes are counted before processing the message, so they are not sufficient to ensure the connection is fully up.

ACKs for top commit:
  mzumsande:
    ACK fa1bf4e705
  aureleoules:
    ACK fa1bf4e705

Tree-SHA512: eb1ed537032c76a449b1ed5e42ff062e9b8b3c7e11fde2a5b8183ae0d6fbe31dba39e2c758836160cd8157d9ac5cc1f5d1916415861b8d711b7370c88f5e9790
2023-01-12 12:51:34 +01:00
MarcoFalke
bd74004532
Merge bitcoin/bitcoin#26877: doc: move errant release note to doc/
c28d461834 doc: move errant release note to doc/ (fanquake)

Pull request description:

  Release note from #26646 should be in doc/.

Top commit has no ACKs.

Tree-SHA512: 741323c0bc526163d65e441c9e677ee3613ed0c55b1880b99fb63b0f3306aeca0cad83dadef05c23def8d0fc6a224956b27ae1bf4b1ff980a1be2d31feef7e3d
2023-01-12 10:56:38 +01:00
fanquake
535adce272
Merge bitcoin/bitcoin#26825: build: remove already tested headers from AC_CHECK_HEADERS
94d0c418c5 build: remove already tested headers from AC_CHECK_HEADERS (fanquake)

Pull request description:

  These headers are already included in a default set which are checked early during configure.

  We already use at least sys/types.h and unistd.h unconditionally in configure.

ACKs for top commit:
  TheCharlatan:
    Code review ACK 94d0c418c5

Tree-SHA512: d81ce01d46ef1c226b19a4b906e5b622baeee62f04d75eebd02094585ad4712a6c830314227d3a1c03a5f76be5c659b456bb065c175e3cf391e0ece37fd99ead
2023-01-12 09:42:09 +00:00
fanquake
c28d461834
doc: move errant release note to doc/ 2023-01-12 09:28:34 +00:00
Andrew Chow
fbe5e1220a
Merge bitcoin/bitcoin#26675: wallet: For feebump, ignore abandoned descendant spends
f9ce0eadf4 For feebump, ignore abandoned descendant spends (John Moffett)

Pull request description:

  Closes #26667

  To be eligible for fee-bumping, a transaction must not have any of its outputs (eg - change) spent in other unconfirmed transactions in the wallet. This behavior is currently [enforced](9e229a542f/src/wallet/feebumper.cpp (L25-L28)) and [tested](9e229a542f/test/functional/wallet_bumpfee.py (L270-L286)).

  However, this check shouldn't apply to spends in abandoned descendant transactions, as explained by #26667.

  `CWallet::IsSpent` already carves out an exception for abandoned transactions, so we can just use that.

  I've also added a new test to cover this case.

ACKs for top commit:
  Sjors:
    re-utACK f9ce0eadf4
  achow101:
    ACK f9ce0eadf4
  furszy:
    ACK f9ce0ead

Tree-SHA512: 19d957d1cf6747668bb114e27a305027bfca5a9bed2b1d9cc9e1b0bd4666486c7c4b60b045a7fe677eb9734d746f5de76390781fb1e9e0bceb4a46d20acd1749
2023-01-11 18:24:53 -05:00
Andrew Chow
2f6a8e5e02
Merge bitcoin/bitcoin#26695: bench: BlockAssembler on a mempool with packages
04528054fc [bench] BlockAssembler with mempool packages (glozow)
6ce265acf4 [test util] lock cs_main before pool.cs in PopulateMempool (glozow)
8791410662 [test util] randomize fee in PopulateMempool (glozow)
cba5934eb6 [miner] allow bypassing TestBlockValidity (glozow)
c058852308 [refactor] parameterize BlockAssembler::Options in PrepareBlock (glozow)
a2de971ba1 [refactor] add helper to apply ArgsManager to BlockAssembler::Options (glozow)

Pull request description:

  Performance of block template building matters as miners likely want to be able to start mining on a block with transactions asap after a block is found. We would want to know if a mempool PR accidentally caused, for example, a 100x slowdown. An `AssembleBlock()` bench exists, but it operates on a mempool with 101 transactions, each with 0 ancestors or descendants and with the same fee. Adding a bench with a more complex mempool is useful because (1) it's more realistic (2) updating packages can potentially cause the algorithm to take a long time.

ACKs for top commit:
  kevkevinpal:
    Tested ACK [0452805](04528054fc)
  achow101:
    ACK 04528054fc
  stickies-v:
    ACK 04528054f

Tree-SHA512: 38c138d6a75616651f9b1faf4e3a1cd833437a486f4e84308fbee958e8462bb570582c88f7ba7ab99d80191e97855ac2cf27c43cc21585d3e4b0e227effe2fb5
2023-01-11 18:11:11 -05:00
ishaanam
cfe5aebc79 rpc: add minconf and maxconf options to sendall 2023-01-11 17:08:35 -05:00
Juan Pablo Civile
a07a413466 Wallet/RPC: Allow specifying min & max chain depth for inputs used by fund calls
Enables users to craft BIP-125 replacements with changes to the output
list, ensuring that if additional funds are needed they will be added.
2023-01-11 17:08:23 -05:00
Andrew Chow
908212506d
Merge bitcoin/bitcoin#26821: refactor: Make ThreadHTTP return void
45553e11c9 refactor: Make `ThreadHTTP` return void (Hennadii Stepanov)

Pull request description:

  The `bool` return value was introduced in 755aa05174 (https://github.com/bitcoin/bitcoin/pull/8421).

  It has been not used since 8d3f46ec39 (https://github.com/bitcoin/bitcoin/pull/14670).

  No behavior change.

ACKs for top commit:
  achow101:
    ACK 45553e11c9
  brunoerg:
    crACK 45553e11c9
  w0xlt:
    ACK 45553e11c9
  stickies-v:
    ACK 45553e11c

Tree-SHA512: 1593a5740e729967fbe1363235cd5b77ecf431b29bc740a89a6c70fc838ad97a2e4a2cd7cd63aa482f7c50bc2ffabc8cd53e8f64d6032603cb3b662229bc3dc2
2023-01-11 16:46:45 -05:00
fanquake
329d7e379d
Merge bitcoin/bitcoin#26328: doc: fix -netinfo relaytxes help
0f5fc4f656 doc: fix up -netinfo relaytxes help (Jon Atack)

Pull request description:

  Addresses https://github.com/bitcoin/bitcoin/pull/26109#discussion_r995502563 by Marco Falke (thanks!)

ACKs for top commit:
  mzumsande:
    Code Review ACK 0f5fc4f656

Tree-SHA512: d7345d1a94b15c4ec1a2bb0be5c04c472411d90cefb4c16ed524933d2bfc36816bb7519c2e109b2e41ff451b039dd2ddaa6d5db917ad54745332f2a1d8b85570
2023-01-11 16:39:11 +00:00
MarcoFalke
9887fc7898
Merge bitcoin/bitcoin#26758: refactor: Add performance-no-automatic-move clang-tidy check
9567bfeab9 clang-tidy: Add `performance-no-automatic-move` check (Hennadii Stepanov)

Pull request description:

  Split from bitcoin/bitcoin#26642 as [requested](https://github.com/bitcoin/bitcoin/pull/26642#discussion_r1054673201).

  For the problem description see https://clang.llvm.org/extra/clang-tidy/checks/performance/no-automatic-move.html.

  The following types are affected:
  - `std::pair<CAddress, NodeSeconds>`
  - `std::vector<CAddress>`
  - `UniValue`, also see bitcoin/bitcoin#25429
  - `QColor`
  - `CBlock`
  - `MempoolAcceptResult`
  - `std::shared_ptr<CWallet>`
  - `std::optional<SelectionResult>`
  - `CTransactionRef`, which is `std::shared_ptr<const CTransaction>`

ACKs for top commit:
  andrewtoth:
    ACK 9567bfeab9
  aureleoules:
    ACK 9567bfeab9

Tree-SHA512: 9b6a5d539205b41d2c86402d384318ed2e1d89e66333ebd200a48fd7df3ce6f6c60a3e989eda5cc503fb34b8d82526f95e56776e1af51e63b49e3a1fef72dbcb
2023-01-11 16:18:34 +01:00
MarcoFalke
fa1bf4e705
test: Fix intermittent timeout in p2p_permissions.py 2023-01-11 15:20:17 +01:00
MarcoFalke
b168b71a5d
Merge bitcoin/bitcoin#26730: test: add coverage for purpose arg in listlabels
c467cfffce test: add coverage for `purpose` arg in `listlabels` (brunoerg)

Pull request description:

  This PR adds test coverage for `listlabels` command when specifying the `purpose` (send and receive).

  dcdfd72861/src/wallet/rpc/addresses.cpp (L698-L704)

ACKs for top commit:
  kristapsk:
    ACK c467cfffce

Tree-SHA512: 7e7143c1264692f7b22952e7c70dbe9ed3f5dcd2e3b69962a47be9f9c21b3f4a9089ca87962fbc8ff9116e7d2dbeb7f36d6a132c9ac13724a255cfe1b32373a8
2023-01-11 14:55:37 +01:00
glozow
26002570ab
Merge bitcoin/bitcoin#26646: validation, bugfix: provide more info in *MempoolAcceptResult
264f9ef17f [validation] return MempoolAcceptResult for every tx on PCKG_TX failure (glozow)
dae81e01e8 [refactor] rename variables in AcceptPackage for clarity (glozow)
da484bc738 [doc] release note effective-feerate and effective-includes RPC results (glozow)
5eab397b98 [validation] remove PackageMempoolAcceptResult::m_package_feerate (glozow)
601bac88cb [rpc] return effective-includes in testmempoolaccept and submitpackage (glozow)
1691eaa818 [rpc] return effective-feerate in testmempoolaccept and submitpackage (glozow)
d6c7b78ef2 [validation] return wtxids of other transactions whose fees were used (glozow)
1605886380 [validation] return effective feerate from mempool validation (glozow)
5d35b4a7de [test] package validation quits early due to non-policy, non-missing-inputs failure (glozow)
be2e4d94e5 [validation] when quitting early in AcceptPackage, set package_state and tx result (glozow)

Pull request description:

  This PR fixes a bug and improves the mempool accept interface to return information more predictably.

  Bug: In package validation, we first try the transactions individually (see doc/policy/packages.md for more explanation) and, if they all failed for missing inputs and policy-related (i.e. fee) reasons, we'll try package validation. Otherwise, we'll just "quit early" since, for example, if a transaction had an invalid signature, adding a child will not help make it valid. Currently, when we quit early, we're not setting the `package_state` to be invalid, so the caller might think it succeeded. Also, we're returning no results - it makes more sense to return the individual transaction failure. Thanks instagibbs for catching https://github.com/bitcoin/bitcoin/pull/25038#discussion_r1013293248!

  Also, make the package results interface generally more useful/predictable:
  - Always return the feerate at which a transaction was considered for `CheckFeeRate` in `MempoolAcceptResult::m_effective_feerate` when it was successful. This can replace the current `PackageMempoolAcceptResult::m_package_feerate`, which only sometimes exists.
  - Always provide an entry for every transaction in `PackageMempoolAcceptResult::m_tx_results` when the error is `PCKG_TX`.

ACKs for top commit:
  instagibbs:
    reACK 264f9ef17f
  achow101:
    ACK 264f9ef17f
  naumenkogs:
    reACK 264f9ef17f

Tree-SHA512: ce7fd9927a80030317cc6157822596e85a540feff5dbf5eea7c62da2eb50c917cdddc9da1e2ff62cc18b98b27d360151811546bd9d498859679a04bbee090837
2023-01-11 13:25:39 +00:00
MarcoFalke
dbca00ef76
Merge bitcoin/bitcoin#26838: doc: I2P documentation updates
3e1d2941e9 doc: remove recommended I2P router versions (jonatack)
295849abb5 doc: update/clarify/de-emphasize I2P transient address section (jonatack)
dffa319457 doc: update bandwidth section of I2P documentation (jonatack)
0ed9cc5892 doc: clarify -i2pacceptincoming help documentation (jonatack)

Pull request description:

  Address the documentation updates requested in issue #26754, clarify/simplify the -i2pacceptincoming help, and a few other fixups.

ACKs for top commit:
  willcl-ark:
    ACK 3e1d294
  1440000bytes:
    ACK 3e1d2941e9
  w0xlt:
    ACK 3e1d2941e9
  vasild:
    ACK 3e1d2941e9

Tree-SHA512: e647221884af34646b99150617f4d4cc8d5fce325a769294f49047b9d8c9c8ab2b365cfdd9f56b3bd0303da706233f03d24cececf6e161c53f04ed947751052a
2023-01-11 13:03:54 +01:00
MarcoFalke
fa0584eb82
ci: Stop and remove CI container 2023-01-11 10:49:39 +01:00
MarcoFalke
fa5dccba32
scripted-diff: ci: Rework docker naming
DOCKER in names is confusingly used as synonym for "image", "container",
and "ci". Fix the confusion by picking the term that fits the context.

-BEGIN VERIFY SCRIPT-
 ren() { sed -i "s:$1:$2:g" $( git grep -l "$1" ) ; }

 ren DOCKER_PACKAGES CI_BASE_PACKAGES
 # This better reflects that they are the common base for all CI
 # containers.

 ren DOCKER_ID CI_CONTAINER_ID
 # This is according to the documentation of "--detach , -d: Run
 # container in background and print container ID".

 ren DOCKER_NAME_TAG CI_IMAGE_NAME_TAG
 # This avoids confusing with CONTAINER_NAME and clarifies that it is an
 # image.

 ren DOCKER_ADMIN CI_CONTAINER_CAP
 # This clarifies that it is a capability added to the container.

 ren DOCKER_CI_CMD_PREFIX CI_EXEC_CMD_PREFIX
 # This brings it in line with the CI_EXEC naming.

-END VERIFY SCRIPT-
2023-01-11 10:49:18 +01:00
Andrew Chow
4586ae2da1
Merge bitcoin/bitcoin#26679: wallet: Skip rescanning if wallet is more recent than tip
3784009534 wallet: Skip rescanning if wallet is more recent than tip (Andrew Chow)

Pull request description:

  If a wallet has key birthdates that are more recent than the currrent chain tip, or a bestblock height higher than the current tip, we should not attempt to rescan as there is nothing to scan for.

  Fixes #26655

ACKs for top commit:
  ishaanam:
    re-utACK 3784009534
  w0xlt:
    utACK 3784009534
  furszy:
    Code review ACK 37840095

Tree-SHA512: f0d90b62940d97d50f21e1e01fa6dcb54409fad819cea4283612825c4d93d733df323cd92787fed43956b0a8e386a5bf88218f1f5749c913398667a5c8f54470
2023-01-10 19:56:32 -05:00