7152 Commits

Author SHA1 Message Date
fanquake
75a185ea3d
test: add skip_if_running_under_valgrind()
Enable it in the USDT tests. The context (from 0xB10C):

> every time the tracepoint is reached a SIGTRAP is fired.
> No matter the tracepoint contents, even with an empty one.
> Valgrind intercepts SIGTRAP and aborts.

See discussion in #32374.
2025-05-14 10:55:26 +01:00
merge-script
bac43b957e
Merge bitcoin/bitcoin#32312: test: Fix feature_pruning test after nTime typo fix
2aa63d511affdcc9980b58fc4ff18b8ad10b0f8c test: Use uninvolved pruned node in feature_pruning undo test (enoch)
772ba7f9ce09e836a51636524a8a96a23946d658 test: Fix nTimes typo in feature_pruning test (enoch)

Pull request description:

  This PR contains two commits:

  1. Fixes a typo in feature_pruning.py where 'nTimes' was incorrectly
     used instead of 'nTime'. This typo caused the test to always reset
     mine_large_blocks.nTime to 0, rather than only on the first run.

  2. Fixes the test failure exposed by the typo fix. The
     test_pruneheight_undo_presence test was failing because it was using
     node 2, which is involved in reorg testing and could be on a
     different chain than other nodes. The solution switches to using
     node 5, which is also a pruned node but isn't involved in reorg
     testing.

  Testing:
  - Ran test/functional/feature_pruning.py multiple times to verify
    consistent passing
  - Verified that the test now passes with the correct nTime variable name
  - Confirmed the test behavior matches the intended functionality of
    verifying pruned block availability
  - Ran the full test suite to ensure the changes did not introduce any
    regressions or affect other tests

  Thanks to fjahr for his assistance in diagnosing the issue and
  suggesting the solution.

  This fixes the test failure reported in #32249

ACKs for top commit:
  fjahr:
    tACK 2aa63d511affdcc9980b58fc4ff18b8ad10b0f8c
  maflcko:
    lgtm ACK 2aa63d511affdcc9980b58fc4ff18b8ad10b0f8c
  naiyoma:
     tACK 2aa63d511affdcc9980b58fc4ff18b8ad10b0f8c
  stratospher:
    tested ACK 2aa63d5. verified that `nTime` is being incremented now.

Tree-SHA512: a543528fd4eeb30e978c0b43cfa109768252edaf1f94679dbbc7fe684122c00da34224e2cc1abd2a265af1b267eef1cd34246207946cf7d8e93d2c0f11aa56d8
2025-05-13 16:30:25 -04:00
Hennadii Stepanov
d847e17c96
doc: Fix typo
An ellipsis (…) is typically used in such cases.
2025-05-12 17:11:27 +01:00
Ava Chow
19b1e177d6
Merge bitcoin/bitcoin#32155: miner: timelock the coinbase to the mined block's height
a58cb3b1c12c8cb75a87375c50f94c4605bb805d qa: sanity check mined block have their coinbase timelocked to height (Antoine Poinsot)
8f2078af6a55448c003b3f7f3021955fbb351caa miner: timelock coinbase transactions (Antoine Poinsot)
788aeebf343526760fa8f3ed969ac3713212a5b6 qa: use prev height as nLockTime for coinbase txs created in unit tests (Antoine Poinsot)
c76dbe9b8b6f03b761a0ef97e1b8cd133b934714 qa: timelock coinbase transactions created in fuzz targets (Antoine Poinsot)
9c94069d8b6cf67a24eb03c51230a4f2b2bf2d64 contrib: timelock coinbase transactions in signet miner (Antoine Poinsot)
a5f52cfcc400ad0adb41a78c65b8abb971e0d622 qa: timelock coinbase transactions created in functional tests (Antoine Poinsot)

Pull request description:

  The Consensus Cleanup soft fork proposal includes enforcing that coinbase transactions set their
  nLockTime field to the block height minus 1, as well as their nSequence such as to not disable the
  timelock. If such a fork were to be activated by Bitcoin users, miners need to be ready to produce
  compliant blocks at the risk of losing substantial amounts mining would-be invalid blocks. As miners
  are unfamously slow to upgrade, it's good to make this change as early as possible.

  Although Bitcoin Core's GBT implementation does not provide the `coinbasetxn` field, and mining
  pool software crafts the coinbase on its own, updating the Bitcoin Core mining code is a first step
  toward convincing pools to update their (often closed source) code. A possible followup is also to
  introduce new fields to GBT. In addition, this first step also makes it possible to test future
  Consensus Cleanup changes.

  The commit making the change also updates a bunch of seemingly-unrelated tests. This is because those tests were asserting error messages based on the txid of transactions involved, and changing the coinbase transaction structure necessarily changes the txid of all tests' transactions.

ACKs for top commit:
  Sjors:
    Code review ACK a58cb3b1c12c8cb75a87375c50f94c4605bb805d
  achow101:
    ACK a58cb3b1c12c8cb75a87375c50f94c4605bb805d
  TheCharlatan:
    Re-ACK a58cb3b1c12c8cb75a87375c50f94c4605bb805d

Tree-SHA512: a2aae009a187eb760d34435f518a895ee76c6b02a667eb030ddf6bd584da6e8eae2737d974dbf81a928d60c07bcb4820f055adc067e18d8819640db0240bb513
2025-05-09 15:09:27 -07:00
MarcoFalke
fa061bfcdb
Remove create options from wallet tool
Just create descriptor wallets.
2025-05-09 15:07:04 +02:00
Ryan Ofsky
ad5cd129f3
Merge bitcoin/bitcoin#30660: qa: Verify clean shutdown on startup failure
10845cd7cc89fc83b4ee844dc577b391720bba9c qa: Add feature_framework_startup_failures.py (Hodlinator)
28e282ef9ae94ede4aace6b97ff18c66cb72a001 qa: assert_raises_message() - Stop assuming certain structure for exceptions (Hodlinator)
1f639efca5e71a0ff208415d94e408a74778d4db qa: Work around Python socket timeout issue (Hodlinator)
9b24a403fae4b896ff7705519bd48c877b4e621b qa: Only allow calling TestNode.stop() after connecting (Hodlinator)
6ad21b4c0114029d16d334bf8d437834708a295e qa: Include ignored errors in RPC connection timeout (Hodlinator)
879243e81fd55f54739fbdae4d5b8666f5acb9a9 qa refactor: wait_for_rpc_connection - Treat OSErrors the same (Hodlinator)

Pull request description:

  Improves handling of startup errors in functional tests and puts tests in place to ensure knock-on errors don't creep in.
  - `wait_for_rpc_connection()` now appends specific failures leading up to the `Unable to connect to bitcoind` error to that error message:
    `[node 0] Unable to connect to bitcoind after 60s (ignored errors: {'missing_credentials': 1, 'OSError.ECONNREFUSED': 239}, latest error: ConnectionRefusedError(111, 'Connection refused'))`
  - Fixes Windows Python issue where `socket.timeout` exceptions end up with unset `errno`-fields.
  - Also adds comments, refactors code, improves logging.

  The underlying purpose is to ensure developer efficiency in finding root causes of test failures.

  Prior iterations of the PR partially focused on fixing the same issue as #31620.
  Originally inspired by #30390.

  ### Testing

  Can be tested by reverting either faf2f2c654d9aa18b2f49a157956f9ab0fce302a or fae3bf6b870eb0f9cddd1adac82ba72890806ae3 from #31620, or the "qa: Avoid calling stop-RPC if not connected" from this PR, and running *feature_framework_startup_failures.py*.

ACKs for top commit:
  l0rinc:
    ACK 10845cd7cc89fc83b4ee844dc577b391720bba9c
  ryanofsky:
    Code review ACK 10845cd7cc89fc83b4ee844dc577b391720bba9c. Only changes since last review were adding a new commit tweaking assert_raises_message(), extending the new test to have a self-check, and to pass through all options to child tests instead of a hardcoded list of options. I left some cleanup suggestions below but they are not important.

Tree-SHA512: f0235c5cbb6d1bb85d8dc5de492a08a34f6edc83499cbf0a5f9a3824809ff84635888c62c9c01101e3cc9ef9f1cdee2c9ab6537fea6feeb005b29f428caf8b22
2025-05-08 16:57:46 -04:00
merge-script
6469752952
Merge bitcoin/bitcoin#32434: lint: Remove string exclusion from locale check
fa24fdcb7f474e6959ae4d8fe9759d365c6c021b lint: Remove string exclusion from locale check (MarcoFalke)

Pull request description:

  The exclusion isn't needed. In fact, it prevents detection of `"bla" + wrong()`.

  For example, the following is not detected:

  ```diff
  diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp
  index 1c2951deee..c1209013e5 100644
  --- a/src/wallet/rpc/addresses.cpp
  +++ b/src/wallet/rpc/addresses.cpp
  @@ -336,7 +336,8 @@ RPCHelpMan addmultisigaddress()
   RPCHelpMan keypoolrefill()
   {
       return RPCHelpMan{"keypoolrefill",
  -                "\nFills the keypool."+
  +                "\nRefills each descriptor keypool in the wallet up to the specified number of new keys.\n"
  +                "By default, descriptor wallets have 4 active ranged descriptors (\"legacy\", \"p2sh-segwit\", \"bech32\", and \"bech32m\"), each with " + std::to_string(DEFAULT_KEYPOOL_SIZE) + " entries.\n" +
           HELP_REQUIRING_PASSPHRASE,
                   {
                       {"newsize", RPCArg::Type::NUM, RPCArg::DefaultHint{strprintf("%u, or as set by -keypool", DEFAULT_KEYPOOL_SIZE)}, "The new keypool size"},
  ```

  Fix the script by detecting it.

ACKs for top commit:
  laanwj:
    Code review ACK fa24fdcb7f474e6959ae4d8fe9759d365c6c021b.
  rkrux:
    ACK fa24fdcb7f474e6959ae4d8fe9759d365c6c021b
  w0xlt:
    ACK fa24fdcb7f

Tree-SHA512: cb7e6ed9fec5d2089e94031329ebf26b83a1814ffbbbca94f7527c127bc759d13c0f4ea79b71ff7f5f009d071dcf01958c8921163d6dc5e1ae6256cc40b57eea
2025-05-08 10:42:30 +01:00
kevkevinpal
e08e6567f2
test: remove assert_dump since it is not used anymore 2025-05-07 14:18:12 -04:00
kevkevinpal
4b6dd9790b
test: remove bdb assert in tool_wallet.py 2025-05-07 13:02:54 -04:00
merge-script
efac285a0d
Merge bitcoin/bitcoin#28710: Remove the legacy wallet and BDB dependency
de054df6dc32cbd8b127c6761d9c65d95025e08f contrib: Remove legacy wallet RPCs from bash completions (Ava Chow)
5dff04a1bba887043616a24590a8df752620f1c3 legacy spkm: Make IsMine() and CanProvide() private and migration only (Ava Chow)
c0f3f3264ff7f17c39c00c4409a48580f98d4f57 wallet: Remove unused db functions (Ava Chow)
83af1a3cca7e8dabe724f1a3258860c40bc8216d wallet: Delete LegacySPKM (Ava Chow)
8ede6dea0c55bb4afefa790b83dd4da48a2f84da wallet, rpc: Remove legacy wallet only RPCs (Ava Chow)
4de3cec28dfb3186a2263f28ab2f6481820fd550 test: rpcs disabled for descriptor wallets will be removed (Ava Chow)
84f671b01df4e6ce81e2d6284371a4326a04d47e test: Run multisig script limit test (Ava Chow)
810476f31e42aa7ed36a684c45accf4d337b3b24 test: Remove unused options and variables, correct comments (Ava Chow)
04a7a7a28cdca46d977e474436f7447157a52208 build, wallet, doc: Remove BDB (Ava Chow)

Pull request description:

  The final step of #20160.

  A bare minimum of legacy wallet code is kept in order to perform wallet migration. Migration of legacy wallets uses the independent BDB parser and a minimal `LegacyDataSPKM` that allows the legacy data to be loaded so that the migration can be completed.

  BDB has been removed as a dependency and documentation have been updated to reflect that.

ACKs for top commit:
  Sjors:
    re-ACK de054df6dc32cbd8b127c6761d9c65d95025e08f
  maflcko:
    re-ACK de054df6dc32cbd8b127c6761d9c65d95025e08 🔗
  w0xlt:
    reACK de054df6dc
  rkrux:
    Concept ACK de054df6dc32cbd8b127c6761d9c65d95025e08f

Tree-SHA512: 16a6c265bc1ada5e7a5ef9b95f0ff65015672ca46d9a43b7e10d60e9e085052e9bbfe01ac3e494cc606afb652a1b476b10e434d13e9877b67d2cb0196a9bd190
2025-05-07 15:19:17 +01:00
MarcoFalke
fa24fdcb7f
lint: Remove string exclusion from locale check
The string exclusion would fail to detect `"bla" + wrong()`.

Also, remove /* */ comment exclusion, which would fail to detect stuff
like `/* bla */ wrong()`.

Instead, require the function to be called by adding \\( to the regex.

Finally, also remove the section in the dev notes, because:

* It was outdated and missing some functions such as std::to_string in
  the list.
* The maintenance overhead of having to update two places is fragile and
  questionable.
* Many other linters are also not mentioned in the dev notes, even
  though they are important.
* A dev (and CI) is more likely to run the linters than to read the dev
  notes.
* The dev notes are more than 1000 lines of dense information. It would
  be easier to digest if they focused on the important stuff that is not
  checked by automated tools.
2025-05-07 13:24:41 +02:00
merge-script
6d5edfcc58
Merge bitcoin/bitcoin#32388: fuzz: Remove unused TimeoutExpired catch in fuzz runner
fa4804009ceba96926edd7f55ea22442ebdc665d fuzz: Remove unused TimeoutExpired catch in fuzz runner (MarcoFalke)

Pull request description:

  Currently, the way to check for libFuzzer is to search the stderr of the fuzz executable when passed `-help=1` for the string `libFuzzer`. See also 14b8dfb2bd/contrib/devtools/deterministic-fuzz-coverage/src/main.rs (L90-L101)

  The python test runner additionally includes a timeout catch, which was needed before the plain `read_file` fallback was implemented, see 14b8dfb2bd/src/test/fuzz/fuzz.cpp (L251).

  However, it is no longer needed and the printed error message would be wrong, so remove it.

  (side-note: On Windows the fuzz executable seems to time out when an assert is hit in a debug build, see https://github.com/bitcoin/bitcoin/issues/32341#issuecomment-2842716175. However, no one is running fuzz debug on Windows. Also, the newly added debug logging is a preferable replacement in this case anyway.)

ACKs for top commit:
  kevkevinpal:
    crACK [fa48040](fa4804009c)
  Crypt-iQ:
    crACK fa4804009ceba96926edd7f55ea22442ebdc665d
  marcofleon:
    crACK fa4804009ceba96926edd7f55ea22442ebdc665d
  brunoerg:
    code review ACK fa4804009ceba96926edd7f55ea22442ebdc665d

Tree-SHA512: 64f5e3862fece9ab2b6592615b72b81e9c087dcd394b1d062a96df0d88d8b5999674f0faa1165a5998c05289c1874e29311d7b24d84fee9bc6c46d1662d29e4d
2025-05-07 11:52:09 +01:00
Ava Chow
83af1a3cca wallet: Delete LegacySPKM
Deletes LegacyScriptPubKeyMan and related tests

Best reviewed with `git diff --patience` or `git diff --histogram`
2025-05-06 16:53:16 -07:00
Ava Chow
4de3cec28d test: rpcs disabled for descriptor wallets will be removed 2025-05-06 12:33:16 -07:00
Ava Chow
84f671b01d test: Run multisig script limit test
This test was mistakenly disabled.
2025-05-06 12:33:16 -07:00
Ava Chow
810476f31e test: Remove unused options and variables, correct comments 2025-05-06 12:33:16 -07:00
Ava Chow
04a7a7a28c build, wallet, doc: Remove BDB 2025-05-06 12:21:32 -07:00
Sebastian Falbesoner
b5f580c580 scripted-diff: adapt script error constant names in feature_taproot.py
In order to remove potential confusion, this commit adapts all script
error constant names in the functional tests (currently only in
feature_taproot.py) to the ones used in our C++ codebase. This also
makes checking whether we have test coverage for a certain script error
easier.

-BEGIN VERIFY SCRIPT-

ren() { sed -i "s|$1|$2|g" $( git grep -l "$1" -- "./test" ) ; }

ren ERR_SIG_SIZE          ERR_SCHNORR_SIG_SIZE
ren ERR_SIG_HASHTYPE      ERR_SCHNORR_SIG_HASHTYPE
ren ERR_SIG_SCHNORR       ERR_SCHNORR_SIG
ren ERR_CONTROLBLOCK_SIZE ERR_TAPROOT_WRONG_CONTROL_SIZE
ren ERR_PUSH_LIMIT        ERR_PUSH_SIZE
ren ERR_MINIMALIF         ERR_TAPSCRIPT_MINIMALIF
ren ERR_UNKNOWN_PUBKEY    ERR_PUBKEYTYPE
ren ERR_STACK_EMPTY       ERR_INVALID_STACK_OPERATION
ren ERR_SIGOPS_RATIO      ERR_TAPSCRIPT_VALIDATION_WEIGHT
ren ERR_UNDECODABLE       ERR_BAD_OPCODE
ren ERR_NO_SUCCESS        ERR_EVAL_FALSE
ren ERR_EMPTY_WITNESS     ERR_WITNESS_PROGRAM_WITNESS_EMPTY

-END VERIFY SCRIPT-
2025-05-03 20:32:13 +02:00
MarcoFalke
fa4804009c
fuzz: Remove unused TimeoutExpired catch in fuzz runner
Can be reviewed with --ignore-all-space
2025-04-30 19:55:03 +02:00
Ava Chow
7db096121d
Merge bitcoin/bitcoin#29039: versionbits refactoring
e3014017bacff42d8d69f3061ce1ee621aaa450a test: add IsActiveAfter tests for versionbits (Anthony Towns)
60950f77c35e54e2884cfc14ab67623f3e325099 versionbits: docstrings for BIP9Info (Anthony Towns)
7565563bc7a5bb98ebf03a7d6881912a74d3f302 tests: refactor versionbits fuzz test (Anthony Towns)
2e4e9b9608c722aaf767638e9dba498d8dc3e772 tests: refactor versionbits unit test (Anthony Towns)
525c00f91bb27d0f2a1b2e5532aebec7fac97d3a versionbits: Expose VersionBitsConditionChecker via impl header (Anthony Towns)
e74a7049b477d1853191ded75fdf25024a6e233f versionbits: Expose StateName function (Anthony Towns)
d00d1ed52c8ee95eeed665d68d6715a694bd4c1f versionbits: Split out internal details into impl header (Anthony Towns)
37b9b67a39554465104c9cf1a74690f40019dbad versionbits: Simplify VersionBitsCache API (Anthony Towns)
1198e7d2fd665bf2bc49fd26773d4fd5fbc2b716 versionbits: Move BIP9 status logic for getblocktemplate to versionbits (Anthony Towns)
b1e967c3ec92738affb22d3b58483ebcdd8dfea2 versionbits: Move getdeploymentinfo logic to versionbits (Anthony Towns)
3bd32c20550e69688a4ff02409fb34b9a637b9c4 versionbits: Move WarningBits logic from validation to versionbits (Anthony Towns)
5da119e5d0e61f0b583f0fe21b9a00ee815a3e46 versionbits: Change BIP9Stats to uint32_t types (Anthony Towns)
a679040ec19ef17f3f03988a52207f1c03af701e consensus/params: Move version bits period/threshold to bip9 param (Anthony Towns)
e9d617095d4ce9525a4337d33624cac9d6b4abe6 versionbits: Remove params from AbstractThresholdConditionChecker (Anthony Towns)
9bc41f1b48b2e0cc6abf9714e860a29989d7809c versionbits: Use std::array instead of C-style arrays (Anthony Towns)

Pull request description:

  Increases the encapsulation/modularity of the versionbits code, moving more of the logic into the versionbits module rather than having it scattered across validation and rpc code. Updates unit/fuzz tests to test the actual code used rather than just a close approximation of it.

ACKs for top commit:
  achow101:
    ACK e3014017bacff42d8d69f3061ce1ee621aaa450a
  TheCharlatan:
    Re-ACK e3014017bacff42d8d69f3061ce1ee621aaa450a
  darosior:
    ACK e3014017bacff42d8d69f3061ce1ee621aaa450a

Tree-SHA512: 2978db5038354b56fa1dd6aafd511099e9c16504d6a88daeac2ff2702c87bcf3e55a32e2f0a7697e3de76963b68b9d5ede7976ee007e45862fa306911194496d
2025-04-29 14:06:45 -07:00
Ava Chow
32d55e28af test: Use the correct node for doubled keypath test 2025-04-28 14:44:17 -07:00
Ava Chow
65714c162c
Merge bitcoin/bitcoin#32327: test: Add missing check for empty stderr in util tester
fadf12a56c294696052c4cb6ee5284030ada7498 test: Add missing check for empty stderr in util tester (MarcoFalke)

Pull request description:

  Now that wine support was removed from the CI in 25b56fd9b469f8e5d36f0132c3b79a5214e3372a, it can probably be removed from the util tester as well.

  If someone really needs this, they can comment the new check out, or submit a patch to add an option/env var to silence the new check.

ACKs for top commit:
  achow101:
    ACK fadf12a56c294696052c4cb6ee5284030ada7498
  i-am-yuvi:
    tACK fadf12a56c294696052c4cb6ee5284030ada7498
  BrandonOdiwuor:
    Code Review ACK fadf12a56c294696052c4cb6ee5284030ada7498
  ismaelsadeeq:
    Tested ACK fadf12a56c294696052c4cb6ee5284030ada7498

Tree-SHA512: d9e4d7a7f724e114391070ea7f17b585a7e4c4f3221c3bf510eeb11df6ccd089b881ab5654adfef8d3a1f8fa7ec6bf5e3a3feeb0cdfe724a8f3e5a146c388e66
2025-04-28 14:43:32 -07:00
merge-script
a4eee6d50b
Merge bitcoin/bitcoin#29124: test: Test that migration automatically repairs corrupted metadata with doubled derivation path
c7e2b9e2644442b147880becb8a659f3d00092d9 tests: Test migration cleans up bad inactive chain derivation path (Ava Chow)

Pull request description:

  A bug in 0.21.x and 22.x resulted in some wallets having invalid derivation paths that are the concatenation of two derivation paths. These appear only when inactive hd chains are topped up.

  Since key metadata is a legacy wallet only record, migrating legacy wallets to descriptor wallets will fix this issue as all key metadata records are deleted. The derivation path information is derived on-the-fly from the descriptor that is produced for the inactive hd chain.

  Thus we only need a test to verify that the derivation paths are good, and that all key metadata records are deleted from the migrated wallet.

ACKs for top commit:
  murchandamus:
    re-ACK c7e2b9e2644442b147880becb8a659f3d00092d9 via range-diff:
  rkrux:
    re-ACK c7e2b9e2644442b147880becb8a659f3d00092d9
  furszy:
    utACK c7e2b9e2644442b147880becb8a659f3d00092d9

Tree-SHA512: 3117c4a43798972109fe2d3539341a8b69db70c6457fcabdd019e6044834dc4b17212abbc006d7b8008f560dce4b7856142b057981b9404f406d58fa0955cbd9
2025-04-28 17:13:42 -04:00
Ava Chow
af6cffa36d
Merge bitcoin/bitcoin#32350: test: Slim down previous releases bdb check
fa58f40b898ba6c57655bf38a241fb10107d4a3a test: Slim down previous releases bdb check (MarcoFalke)

Pull request description:

  The check iterates over several previous BDB-only releases to check that descriptor wallets are considered "corrupt" when loading. It is unclear why this needs to be done for more than one release.

  Avoid the confusion by removing the unused releases from the test and from the download script.

ACKs for top commit:
  achow101:
    ACK fa58f40b898ba6c57655bf38a241fb10107d4a3a
  rkrux:
    ACK fa58f40b898ba6c57655bf38a241fb10107d4a3a

Tree-SHA512: 8084392481bfe1fba9b80bb865ffbdfa454e9e6e14e02c39fa3f61c1a596b1def2c531c5da1c7566e5fddb77ac7e56f19feabaaf9b5af043fa6c230d9e2370b5
2025-04-28 12:56:22 -07:00
MarcoFalke
fa48be3ba4
test: Force named args for RPCOverloadWrapper optional args
This can avoid bugs and makes the test code easier to read, because the
order of positional args does not have to be known or assumed.
2025-04-28 15:15:05 +02:00
MarcoFalke
aaaa45399c
test: Remove unused createwallet_passthrough 2025-04-28 15:14:52 +02:00
MarcoFalke
cccc1f4e91
test: Remove unused RPCOverloadWrapper is_cli field 2025-04-28 10:18:59 +02:00
Hodlinator
10845cd7cc
qa: Add feature_framework_startup_failures.py 2025-04-26 23:30:26 +02:00
Antoine Poinsot
a58cb3b1c1 qa: sanity check mined block have their coinbase timelocked to height 2025-04-25 12:44:08 -04:00
Antoine Poinsot
8f2078af6a miner: timelock coinbase transactions
The Consensus Cleanup soft fork proposal includes enforcing that coinbase transactions set their
locktime field to the block height, minus 1 (as well as their nSequence such as to not disable the
timelock). If such a fork were to be activated by Bitcoin users, miners need to be ready to produce
compliant blocks at the risk of losing substantial amounts mining would-be invalid blocks. As miners
are unfamously slow to upgrade, it's good to make this change as early as possible.

Although Bitcoin Core's GBT implementation does not provide the "coinbasetxn" field, and mining
pool software crafts the coinbase on its own, updating the Bitcoin Core mining code is a first step
toward convincing pools to update their (often closed source) code. A possible followup is also to
introduce new fields to GBT. In addition, this first step also makes it possible to test future
Consensus Cleanup changes.

The changes to the seemingly-unrelated RBF tests is because these tests assert an error message
which may vary depending on the txid of the transactions used in the test. This commit changes the
coinbase transaction structure and therefore impact the txid of transactions in all tests.

The change to the "Bad snapshot" error message in the assumeutxo functional test is because this
specific test case reads into the txid of the next transaction in the snapshot and asserts the error
message based it gets on deserializing this txid as a coin for the previous transaction. As this
commit changes this txid it impacts the deserialization error raised.
2025-04-25 12:44:08 -04:00
Antoine Poinsot
a5f52cfcc4 qa: timelock coinbase transactions created in functional tests 2025-04-25 12:44:08 -04:00
Ava Chow
c7e2b9e264 tests: Test migration cleans up bad inactive chain derivation path
A bug in 0.21.x and 22.x resulted in some wallets having invalid
derivation paths that are the concatenation of two derivation paths.
These appear only when inactive hd chains are topped up.

Since key metadata is a legacy wallet only record, migrating legacy
wallets to descriptor wallets will fix this issue as all key metadata
records are deleted. The derivation path information is derived
on-the-fly from the descriptor that is produced for the inactive hd
chain.

Thus we only need a test to verify that the derivation paths are good,
and that all key metadata records are deleted from the migrated wallet.
2025-04-25 09:12:53 -07:00
MarcoFalke
fa58f40b89
test: Slim down previous releases bdb check 2025-04-25 16:04:07 +02:00
Hodlinator
28e282ef9a
qa: assert_raises_message() - Stop assuming certain structure for exceptions 2025-04-25 14:39:16 +02:00
merge-script
80e6ad9e30
Merge bitcoin/bitcoin#31250: wallet: Disable creating and loading legacy wallets
17bb63f9f9b08e6af60c089234fe878657dbc88e wallet: Disallow loading legacy wallets (Ava Chow)
9f04e02ffaee0fe64027dc56c7bea3885254321a wallet: Disallow creating legacy wallets (Ava Chow)
6b247279b72df17b1510241d75c970bc0514cbe2 wallet: Disallow legacy wallet creation from the wallet tool (Ava Chow)
5e93b1fd6c1e9e3aeaebcc688cdf667c61f9f305 bench: Remove WalletLoadingLegacy benchmark (Ava Chow)
56f959d829e90c8495968609eec4169502d6efc2 wallet: Remove wallettool salvage (Ava Chow)
7a41c939f05f2208c33e8f09eecbbfd579fb4023 wallet: Remove -format and bdb from wallet tool's createfromdump (Ava Chow)
c847dee1488a294c9a9632a00ba1134b21e41947 test: remove legacy wallet functional tests (Ava Chow)
20a9173717b1aa0d0706894f8bda47492e1d71a9 test: Remove legacy wallet tests from wallet_reindex.py (Ava Chow)
446d480cb22c6645ac75981dad180b579ef3283d test: Remove legacy wallet tests from wallet_backwards_compatibility.py (Ava Chow)
aff80298d05cfb26d142884c82538e9207938dae test: wallet_signer.py bdb will be removed (Ava Chow)
f94f9399ac476ae2996b2eb94a56e433a170a192 test: Remove legacy wallet unit tests (Ava Chow)
d9ac9dbd8ef57ad6e8e1716614025fdcfd098fb5 tests, gui: Use descriptors watchonly wallet for watchonly test (Ava Chow)

Pull request description:

  To prepare for the deletion of legacy wallet code, disable creating or loading new legacy wallets.

  Tests for the legacy wallet specifically are deleted.

  Split from https://github.com/bitcoin/bitcoin/pull/28710

ACKs for top commit:
  Sjors:
    re-ACK 17bb63f9f9b08e6af60c089234fe878657dbc88e
  pablomartin4btc:
    re-ACK 17bb63f9f9b08e6af60c089234fe878657dbc88e
  laanwj:
    re-ACK 17bb63f9f9b08e6af60c089234fe878657dbc88e

Tree-SHA512: d7a86df1f71f12451b335f22f7c3f0394166ac3f8f5b81f6bbf0321026e2e8ed621576656c371d70e202df1be4410b2b1c1acb5d5f0c341e7b67aaa0ac792e7c
2025-04-25 13:11:24 +01:00
MarcoFalke
facb9b327b
scripted-diff: Use bpf_cflags
-BEGIN VERIFY SCRIPT-

 ren() { sed --regexp-extended -i "s/$1/$2/g" $( git grep --extended-regexp -l "$1" ) ; }

 ren 'cflags=\["-Wno-error=implicit-function-declaration"\]' 'cflags=bpf_cflags()'

-END VERIFY SCRIPT-
2025-04-24 10:47:57 +02:00
MarcoFalke
fa0c1baaf8
test: Add imports for util bpf_cflags
This is required for the next commit.
2025-04-24 10:47:44 +02:00
Ava Chow
17bb63f9f9 wallet: Disallow loading legacy wallets
Legacy wallets do not have the descriptors flag set. Don't load wallets
without the descriptors flag.

At the same time, we will no longer load BDB databases since they are
only used for legacy wallets.
2025-04-23 12:11:56 -07:00
Ava Chow
9f04e02ffa wallet: Disallow creating legacy wallets
Remove the option to set descriptors=False when creating a wallet, and
enforce this in RPC and in CreateWallet
2025-04-23 12:11:56 -07:00
Ava Chow
6b247279b7 wallet: Disallow legacy wallet creation from the wallet tool 2025-04-23 12:10:30 -07:00
Ava Chow
7a41c939f0 wallet: Remove -format and bdb from wallet tool's createfromdump 2025-04-23 12:10:30 -07:00
Ava Chow
c847dee148 test: remove legacy wallet functional tests
Removes all legacy wallet specific functional tests.

Also removes the --descriptor and --legacy-wallet options as these are
no longer necessary with the legacy wallet removed.
2025-04-23 12:10:30 -07:00
Ava Chow
20a9173717 test: Remove legacy wallet tests from wallet_reindex.py 2025-04-23 12:10:30 -07:00
Ava Chow
446d480cb2 test: Remove legacy wallet tests from wallet_backwards_compatibility.py 2025-04-23 12:10:30 -07:00
Ava Chow
aff80298d0 test: wallet_signer.py bdb will be removed 2025-04-23 12:09:38 -07:00
MarcoFalke
fadf12a56c
test: Add missing check for empty stderr in util tester 2025-04-22 17:54:38 +02:00
Ava Chow
06439a14c8
Merge bitcoin/bitcoin#31953: rpc: Allow fullrbf fee bump in (psbt)bumpfee
fa86190e6ed2aeda7bcceaf96f52403816bcd751 rpc: Allow fullrbf fee bump (MarcoFalke)

Pull request description:

  The RPCs (psbt)bumpfee, and the GUI, reject fee bumps when BIP 125 signalling is absent in the transaction even when the mempool and other RPCs allow them. Fix the confusion by allowing the fee bump.

  This is done after fullrbf is always on (https://github.com/bitcoin/bitcoin/pull/30592)

ACKs for top commit:
  1440000bytes:
    reACK fa86190e6e
  achow101:
    ACK fa86190e6ed2aeda7bcceaf96f52403816bcd751
  w0xlt:
    ACK fa86190e6e
  rkrux:
    reACK fa86190e6ed2aeda7bcceaf96f52403816bcd751
  glozow:
    ACK fa86190e6ed2aeda7bcceaf96f52403816bcd751

Tree-SHA512: b2ffe8dcadbe71e9be767a16cf8aa0bf383c2de7aa1aee9438d125f444e24f3f7e4f02ddb28981bd3b8b645b6a24a407b4ad6bb0b21946ae637e78f6386e05bf
2025-04-21 13:25:52 -07:00
Hodlinator
1f639efca5
qa: Work around Python socket timeout issue
Observed on local machine running Windows / Python v3.13.1 when overriding rpc_timeout to small values (5- seconds). Next commit performs such overrides.
2025-04-21 20:35:22 +02:00
enoch
2aa63d511a test: Use uninvolved pruned node in feature_pruning undo test
After fixing the nTime variable name, the test_pruneheight_undo_presence
test began failing because node 2, which is involved in reorg testing,
could be on a different chain than other nodes. This caused failures
when trying to fetch blocks from other nodes that didn't recognize
node 2's chain.

Switch to using node 5 instead, which is also a pruned node but isn't
involved in reorg testing, ensuring it stays on the same chain as the
other nodes. This allows the block fetching to work as intended in the
test.
2025-04-21 16:04:25 +01:00
enoch
772ba7f9ce test: Fix nTimes typo in feature_pruning test
Fix incorrect variable name in comment (nTimes -> nTime) in
feature_pruning.py. This typo caused the test to always reset
mine_large_blocks.nTime to 0, rather than only on the first run
as intended.
2025-04-21 16:03:19 +01:00