Commit graph

36212 commits

Author SHA1 Message Date
S3RK
3282fad599
wallet: add assert to SelectionResult::Merge for safety 2022-12-02 12:39:15 -03:00
furszy
c4e3b7d6a1
wallet: SelectCoins, return early if wallet's UTXOs cannot cover the target
The CoinsResult class will now count the raw total amount and the effective
total amount internally (inside the 'CoinsResult::Add' and 'CoinsResult::Erase'
methods).
So there is no discrepancy between what we add/erase and the total values.
(which is what was happening on the coinselector_test because the 'CoinsResult'
object is manually created there, and we were not keeping the total amount
in sync with the outputs being added/removed).
2022-12-02 12:39:15 -03:00
furszy
cac2725fd0
test: bugfix, coinselector_test, use 'CoinsResult::Erase/Add' instead of direct member access
Aside from the cleanup, this solves a bug in the following-up commit. Because, in these
tests, we are manually adding/erasing outputs from the CoinsResult object but never
updating the internal total amount field.
2022-12-02 12:39:15 -03:00
furszy
cf79384697
test: Coin Selection, duplicated preset inputs selection
This exercises the bug inside CoinsResult::Erase that
ends up on (1) a wallet crash or (2) a created and
broadcasted tx that contains a reduced recipient's amount.

This is covered by making the wallet selects the preset
inputs twice during the coin selection process.

Making the wallet think that the selection process result covers
the entire tx target when it does not. It's actually creating
a tx that sends more coins than what inputs are covering for.

Which, combined with the SFFO option, makes the wallet
incorrectly reduce the recipient's amount by the difference
between the original target and the wrongly counted inputs.
Which means, a created and relayed tx sending less coins to
the destination than what the user inputted.
2022-12-02 12:39:15 -03:00
furszy
341ba7ffd8
test: wallet, coverage for CoinsResult::Erase function 2022-12-02 12:39:15 -03:00
fanquake
78aee0fe2c
Merge bitcoin/bitcoin#26569: p2p: Ensure transaction announcements are only queued for fully connected peers
8f2dac5409 [test] Add p2p_tx_privacy.py (dergoegge)
ce63fca13e [net processing] Assume that TxRelay::m_tx_inventory_to_send is empty pre-verack (dergoegge)
845e3a34c4 [net processing] Ensure transaction announcements are only queued for fully connected peers (dergoegge)

Pull request description:

  `TxRelay::m_next_inv_send_time` is initialized to 0, which means that any txids in `TxRelay::m_tx_inventory_to_send` will be announced on the first call to `PeerManagerImpl::SendMessages` for a fully connected peer (i.e. it completed the version handshake).

  Prior to #21160, `TxRelay::m_tx_inventory_to_send` was guaranteed to be empty on the first `SendMessages` call, as transaction announcements were only queued for fully connected peers. #21160 replaced a `CConnman::ForEachNode` call with a loop over `PeerManagerImpl::m_peer_map`, in which the txid for a transaction to be relayed is added to `TxRelay::m_tx_inventory_to_send` for all peers. Even for those peers that have not completed the version handshake. Prior to the PR this was not the case as `ForEachNode` has a "fully connected check" before calling a function for each node.

ACKs for top commit:
  MarcoFalke:
    ACK 8f2dac5409 🔝
  jnewbery:
    utACK 8f2dac5409

Tree-SHA512: e9eaccf7e00633ee0806fff1068b0e413a69a5e389d96c9659f68079915a6381ad5040c61f716cfcde77931d1b563b1049da97a232a95c6cd8355bd3d13404b9
2022-12-02 15:13:31 +00:00
Aurèle Oulès
cb44c5923a
test: Add sendall test for min-fee setting 2022-12-02 13:30:40 +01:00
Hennadii Stepanov
1984db1d50
refactor: Rename local variable to distinguish it from type alias
The `txiter` type alias is declared in the `txmempool.h`.
2022-12-02 11:25:35 +00:00
MarcoFalke
9e59d21fbe
Merge bitcoin/bitcoin#26592: ci: only run USDT interface tests on CirrusCI
2811f40f30 ci: only run USDT interface tests on CirrusCI (0xb10c)

Pull request description:

  As mentioned in #26571, the task running the USDT interface tests fail when run in docker. cc7335edc8 in #25528 added that the tests are run in a **VM** in Cirrus CI. Running them locally in docker containers might not work:

  - We use [bcc] as tracing toolkit which requires the kernel headers to compile the BPF bytecode. As docker containers use the hosts kernel and don't run their own, there is a potential for mismatches between kernel headers available in the container and the host kernel. This results in a failure loading the BPF byte code.
  - Privilges are required to load the BPF byte code into the kernel. Normally, the docker containers aren't run with these.
  - We currently use an untrusted third-party PPA to install the bpfcc-tools package on Ubuntu 22.04. Using this on a local dev system could be a security risk.

  To not hinder the ASan + LSan + UBSan part of the CI task, the USDT tests are disabled on non-CirrusCI runs.

  [bcc]: https://github.com/iovisor/bcc

Top commit has no ACKs.

Tree-SHA512: 7c159b59630b36d5ed927b501fa0ad6f54ff3d98d0902f975cc8122b4147a7f828175807d40a470a85f0f3b6eeb79307d3465a287dbd2f3d75b803769ad0b6e7
2022-12-02 10:52:52 +01:00
MarcoFalke
4037478114
Merge bitcoin/bitcoin#26610: test: Remove unused blocktools imports from wallet_bumpfee
fa15c671f7 test: Remove unused blocktools imports from wallet_bumpfee (MarcoFalke)

Pull request description:

  Seems bloaty and confusing to use "tools" when a single RPC can already achieve the same.

ACKs for top commit:
  theStack:
    ACK fa15c671f7

Tree-SHA512: 87f9c31bbb286fee5e479ae54a1f9131f4d4294d665a985df8b14a0cc837a2a2e145ccd3660612768d88cfa0827a3eef392f85519b6cb7df365ba9fadafb0a41
2022-12-02 09:43:26 +01:00
MarcoFalke
02515117dc
Merge bitcoin/bitcoin#26620: test: refactor: eliminate genesis block timestamp magic numbers
dbed28968a test: refactor: eliminate genesis block timestamp magic numbers (Sebastian Falbesoner)

Pull request description:

  This tiny PR replaces all occurences of the regtest/testnet genesis block timestamp (found via `git grep 1296688602`) with the constant `TIME_GENESIS_BLOCK` to increase the readability.

ACKs for top commit:
  aureleoules:
    ACK dbed28968a

Tree-SHA512: be39d5c2631ad20eb775c2a077b1b1f056a1a4930aa44e6fdec73b974fd4bdf8da0103a3a38e3514b68fcf6a6316e007a371c523da5076a315545c9bf3091aee
2022-12-01 18:37:59 +01:00
MarcoFalke
c6e7f224c1 util: Add StrFormatInternalBug and STR_INTERNAL_BUG 2022-12-01 12:22:47 -05:00
MarcoFalke
a04121bdf9
Merge bitcoin/bitcoin#26617: test: add extra_args to BitcoinTestFramework class
150340aeac test: remove unneeded extra_args code (josibake)
989a52e0a5 test: add extra_args to BTF class (josibake)

Pull request description:

  ## problem
  If you try to add `extra_args` when using `TestShell`, you will get the following error:

  ```python
  >>> import sys
  >>>
  >>> sys.path.insert(0, "/home/josibake/bitcoin/test/functional")
  >>>
  >>> from test_framework.test_shell import TestShell
  >>> test = TestShell().setup(num_nodes=2, extra_args=[[],['-fallbackfee=0.0002']])
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/josibake/bitcoin/test/functional/test_framework/test_shell.py", line 41, in setup
      raise KeyError(key + " not a valid parameter key!")
  KeyError: 'extra_args not a valid parameter key!'
  >>>
  ```

  ## solution

  add `self.extra_args = None` so that `extra_args` is recognized as a valid parameter to be passed to `BitcoinTestFramework`

  ```python
  >>> import sys
  >>>
  >>> sys.path.insert(0, "/home/josibake/bitcoin/test/functional")
  >>>
  >>> from test_framework.test_shell import TestShell
  >>> test = TestShell().setup(num_nodes=2, extra_args=[[],['-fallbackfee=0.0002']])
  2022-12-01T11:23:23.765000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_sbwthbb_
  ```

ACKs for top commit:
  willcl-ark:
    re-ACK 150340aeac

Tree-SHA512: e6fa2a780a8f2d3472c322e8cdb00ec35cb220c3b4d6ca02291eb8b41c0d8676a635fbc79c6be80e3bb71d700a2501a4b73f762478f533ae453d492d449307bb
2022-12-01 17:50:46 +01:00
josibake
150340aeac
test: remove unneeded extra_args code 2022-12-01 16:55:43 +01:00
Sebastian Falbesoner
dbed28968a test: refactor: eliminate genesis block timestamp magic numbers 2022-12-01 12:59:59 +01:00
josibake
989a52e0a5
test: add extra_args to BTF class
this allows us to pass extra_args when using TestShell
2022-12-01 12:14:10 +01:00
fanquake
e334f7a545
Merge bitcoin/bitcoin#26594: wallet: Avoid a segfault in migratewallet failure cleanup
5e65a216d1 wallet: Explicitly say migratewallet on encrypted wallets is unsupported (Andrew Chow)
88afc73ae0 tests: Test for migrating encrypted wallets (Andrew Chow)
86ef7b3c7b wallet: Avoid null pointer deref when cleaning up migratewallet (Andrew Chow)

Pull request description:

  When `migratewallet` fails, we do an automatic cleanup in order to reset everything so that the user does not experience any interruptions. However, this apparently has a segfault in it, caused by the the pointers to the watchonly and solvables wallets being nullptr. If those wallets are not created (either not needed, or failed early on), we will accidentally attempt to dereference these nullptrs, which causes a segfault.

  This failure can be easily reached by trying to migrate an encrypted wallet. Currently, we can't migrate encrypted wallets because of how we unload wallets before migrating, and therefore forget the encryption key if the wallet was unlocked. So any encrypted wallets will fail, entering the cleanup, and because watchonly and solvables wallets don't exist yet, the segfault is reached.

  This PR fixes this by not putting those nullptrs in a place that we will end up dereferencing them later. It also adds a test that uses the encrypted wallet issue.

ACKs for top commit:
  S3RK:
    reACK 5e65a216d1
  stickies-v:
    ACK [5e65a21](5e65a216d1)
  furszy:
    diff ACK 5e65a21

Tree-SHA512: f75643797220d4232ad3ab8cb4b46d0f3667f00486e910ca748c9b6d174d446968f1ec4dd7f907da1be9566088849da7edcd8cd8f12de671c3241b513deb8e80
2022-12-01 10:17:09 +00:00
dergoegge
8f2dac5409 [test] Add p2p_tx_privacy.py 2022-11-30 16:36:16 +00:00
Andrew Chow
e2bfd41f83
Merge bitcoin/bitcoin#25942: test: add ismine test for descriptor ScriptPubKeyMan
1b77db2653 test: add `ismine` test for descriptor scriptpubkeyman (w0xlt)

Pull request description:

  Currently `src/wallet/test/ismine_tests.cpp` has tests for the legacy ScriptPubKeyMan only.
  This PR adds tests for the descriptor ScriptPubKeyMan.

ACKs for top commit:
  ishaanam:
    ACK 1b77db2653
  achow101:
    ACK 1b77db2653
  furszy:
    ACK 1b77db26 with a non-blocking comment.

Tree-SHA512: 977b5d1e71f9468331aeb4ebaf3708dd651f9f3018d4544a395b87ca6d7fb8bfa6d20acc1a4f6e096e240e81d30fb7a6e8add190e52536e7a3cb5a80f392883f
2022-11-30 11:28:32 -05:00
MarcoFalke
fa15c671f7
test: Remove unused blocktools imports from wallet_bumpfee 2022-11-30 16:59:21 +01:00
Andrew Chow
5e65a216d1 wallet: Explicitly say migratewallet on encrypted wallets is unsupported 2022-11-30 10:30:57 -05:00
dergoegge
ce63fca13e [net processing] Assume that TxRelay::m_tx_inventory_to_send is empty pre-verack
This commit documents our assumption about
TxRelay::m_tx_inventory_to_send being empty prior to version handshake
completion.

The added Assume acts as testing oracle for our fuzzing tests to
potentially detect if the assumption is violated.
2022-11-30 12:22:05 +00:00
fanquake
bcee94d107
Merge bitcoin/bitcoin#26359: p2p: Erlay support signaling follow-ups
46339d29b1 test, refactor: Reorder sendtxrcncl tests for better readability (Gleb Naumenko)
14263c13f1 p2p, refactor: Extend logs for unexpected sendtxrcncl (Gleb Naumenko)
87493e112e p2p, test, refactor: Minor code improvements (Gleb Naumenko)
00c5dec818 p2p: Clarify sendtxrcncl policies (Gleb Naumenko)
ac6ee5ba21 test: Expand unit and functional tests for txreconciliation (Gleb Naumenko)
bc84e24a4f p2p, refactor: Switch to enum class for ReconciliationRegisterResult (Gleb Naumenko)
a60f729e29 p2p: Drop roles from sendtxrcncl (Gleb Naumenko)
6772cbf69c tests: stabilize sendtxrcncl test (Gleb Naumenko)

Pull request description:

  Non-trivial changes include:
  - Getting rid of roles in `sendtxrcncl` message (summarized in the [BIP PR](https://github.com/bitcoin/bips/pull/1376));
  - Disconnect the peer if it send `sendtxrcncl` although we are in `blocksonly` and notified the peer with `fRelay=0`;
  - Don't send `sendtxrcncl` to feeler connections.

ACKs for top commit:
  vasild:
    ACK 46339d29b1
  ariard:
    ACK 46339d2
  mzumsande:
    Code Review ACK 46339d29b1

Tree-SHA512: b5cc6934b4670c12b7dbb3189e739ef747ee542ec56678bf4e4355bfb481b746d32363c173635685b71969b3fe4bd52b1c8ebd3ea3b35c82044bba69220f6417
2022-11-30 10:52:44 +00:00
Hennadii Stepanov
38941a703e
refactor: Move txmempool_entry.h --> kernel/mempool_entry.h 2022-11-30 10:37:57 +00:00
MarcoFalke
3be21060d6
Merge bitcoin/bitcoin#26600: test: Set wallet type in test_runner when only one type is allowed
fadb8696dd test: Set wallet type in test_runner when only one type is allowed (MarcoFalke)

Pull request description:

  Currently devs are free to set or not set the wallet type in the test_runner when only one type is allowed to be set.

  This is inconsistent and causes review comments such as:

  * https://github.com/bitcoin/bitcoin/pull/24865#discussion_r1009752111

ACKs for top commit:
  achow101:
    ACK fadb8696dd

Tree-SHA512: 1ca0946df07b5bf6778fea957d74393757781c324d554fec2f7d03bf1915033e644d9a4c3d77e0b24090ab593d7ed3cb3c9169666bc39fff423706fceaa1af80
2022-11-30 10:23:05 +01:00
Andrew Chow
88afc73ae0 tests: Test for migrating encrypted wallets
Due to an oversight, we cannot currently migrate encrypted wallets,
regardless of whether they are unlocked. Migrating such wallets will
trigger an error, and result in the cleanup being run. This conveniently
allows us to check some parts of the cleanup code.
2022-11-29 19:31:27 -05:00
Andrew Chow
86ef7b3c7b wallet: Avoid null pointer deref when cleaning up migratewallet
If migratewallet fails, we do a cleanup which removes the watchonly and
solvables wallets if they were created. However, if they were not, their
pointers are nullptr and we don't check for that, which causes a
segfault during the cleanup. So check that they aren't nullptr before
cleaning them up.
2022-11-29 19:31:27 -05:00
Andrew Chow
5690848dfb
Merge bitcoin/bitcoin#26532: wallet: bugfix, invalid crypted key "checksum_valid" set
13d9760829 test: load wallet, coverage for crypted keys (furszy)
373c99633e refactor: move DuplicateMockDatabase to wallet/test/util.h (furszy)
ee7a984f85 refactor: unify test/util/wallet.h with wallet/test/util.h (furszy)
cc5a5e8121 wallet: bugfix, invalid crypted key "checksum_valid" set (furszy)

Pull request description:

  At wallet load time, the crypted key "checksum_valid" variable is always set to false. Which, on every wallet decryption call, forces the process to re-write all the ckeys to db when it's not needed.

  Note:
  The first commit fixes the issue, the two commits in the middle are cleanups so `DuplicateMockDatabase`
  can be used without duplicating code. And, the last one is pure test coverage for the crypted keys loading
  process.

  Includes test coverage for the following scenarios:

  1) "All ckeys checksums valid" test:
  Loads an encrypted wallet with all the crypted keys with a valid checksum and
  verifies that 'CWallet::Unlock' doesn't force an entire crypted keys re-write.

      (we force a complete ckeys re-write if we find any missing crypted key checksum
  during the wallet loading process)

  2) "Missing checksum in one ckey" test:
  Verifies that loading up a wallet with, at least one, 'ckey' with no checksum
  triggers a complete re-write of the crypted keys.

  3) "Invalid ckey checksum error" test:
  Verifies that loading up a ckey with an invalid checksum stops the wallet loading
  process with a corruption error.

  4) "Invalid ckey pubkey error" test:
  Verifies that loading up a ckey with an invalid pubkey stops the wallet loading
  process with a corruption error.

ACKs for top commit:
  achow101:
    ACK 13d9760829
  aureleoules:
    ACK 13d9760829

Tree-SHA512: 9ea630ee4a355282fbeee61ca04737294382577bb4b2631f50e732568fdab8f72491930807fbda58206446c4f26200cdc34d8afa14dbe1241aec713887d06a0b
2022-11-29 18:54:57 -05:00
Andrew Chow
a63192afb8
Merge bitcoin/bitcoin#19762: rpc: Allow named and positional arguments to be used together
d8b12a75db rpc: Allow named and positional arguments to be used together (Ryan Ofsky)

Pull request description:

  It's nice to be able to use named options and positional arguments together.

  Most shell tools accept both, and python functions combine options and arguments allowing them to be passed with even more flexibility. This change adds support for python's approach so as a motivating example:

  ```sh
  bitcoin-cli -named createwallet wallet_name=mywallet load_on_startup=1
  ```

  Can be shortened to:

  ```sh
  bitcoin-cli -named createwallet mywallet load_on_startup=1
  ```

  JSON-RPC standard doesn't have a convention for passing named and positional parameters together, so this implementation makes one up and interprets any unused `"args"` named parameter as a positional parameter array.

  This change is backwards compatible. It doesn't change the interpretation of any previously valid calls, just treats some previously invalid calls as valid.

  Another use case even if you only occasionally use named arguments is that you can define an alias:

  ```
  alias bcli='bitcoin-cli -named'
  ```

  And now use both named named and unnamed arguments from the same alias without having to manually add `-named` option for named arguments or see annoying error "No '=' in named argument... this needs to be present for every argument (even if it is empty)`" for unnamed arguments

ACKs for top commit:
  achow101:
    ACK d8b12a75db
  stickies-v:
    re-ACK d8b12a75d
  aureleoules:
    re-ACK d8b12a75db

Tree-SHA512: 0cff8b50f584bcbbd376624adccf40536566ed8d1bcd6c88ad565dbc208f19d5e7a48c994efd6329d42b560149340d330397278f08a2912af5f3418d8c8837a9
2022-11-29 18:37:55 -05:00
stickies-v
f537127271
doc: fix: prevHeights entries are set to 0, not removed 2022-11-29 17:58:36 +00:00
furszy
f930aefff9
wallet: bugfix, 'CoinsResult::Erase' is erasing only one output of the set
The loop break shouldn't have being there.
2022-11-29 12:30:31 -03:00
dergoegge
845e3a34c4 [net processing] Ensure transaction announcements are only queued for fully connected peers 2022-11-29 13:54:50 +00:00
MarcoFalke
fadb8696dd
test: Set wallet type in test_runner when only one type is allowed 2022-11-29 14:26:55 +01:00
Ryan Ofsky
b19c4124b3 refactor: Rename ambiguous interfaces::MakeHandler functions 2022-11-29 08:12:24 -04:00
fanquake
a035b6a0c4
Merge bitcoin/bitcoin#26565: contrib/builder-keys/keys.txt: remove unavailable key
dddfa028ff contrib/builder-keys/keys.txt: remove unavailable key (@RandyMcMillan)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK dddfa028ff

Tree-SHA512: e7bd2d9d828b44c4343478c68d01530621677f5c66912a4181815e66ef1926dfc66e6a7652789677ae263684d30a39da038b8ca669ad24833c1f104244c2a2b1
2022-11-29 12:12:24 +00:00
fanquake
dd6e8bd71c build: remove BOOST_CPPFLAGS from libbitcoin_util 2022-11-29 20:12:24 +08:00
Ryan Ofsky
82e272a109 refactor: Move src/interfaces/*.cpp files to libbitcoin_common.a
These belong in libbitcoin_common.a, not libbitcoin_util.a, because they aren't
general-purpose utilities, they just contain common code that is used by both
the node and the wallet. Another reason to reason to not include these in
libbitcoin_util.a is to prevent them from being used by the kernel library.
2022-11-29 08:12:24 -04:00
willcl-ark
ccba4fe7e3
doc: Add completion subdir to contrib/README.md 2022-11-28 20:39:20 +00:00
willcl-ark
7075848f96
script: Add fish completions
Completions are dynamically generated from the respective binary help
pages.

Completions should be sourced into the shell or added to
$XDG_CONFIG/fish/completions.
2022-11-28 20:39:19 +00:00
0xb10c
2811f40f30
ci: only run USDT interface tests on CirrusCI
As mentioned in #26571, the task running the USDT interface tests
fail when run in docker. cc7335edc8
in #25528 added that the tests are run in a **VM** in Cirrus CI.
Running them locally in docker containers might not work:

- We use [bcc] as tracing toolkit which requires the kernel headers
  to compile the BPF bytecode. As docker containers use the hosts
  kernel and don't run their own, there is a potential for mismatches
  between kernel headers available in the container and the host
  kernel. This results in a failure loading the BPF byte code.
- Privilges are required to load the BPF byte code into the kernel.
  Normally, the docker containers aren't run with these.
- We currently use an untrusted third-party PPA to install the
  bpfcc-tools package on Ubuntu 22.04. Using this on a local dev
  system could be a security risk.

To not hinder the ASan + LSan + UBSan part of the CI task, the USDT
tests are disabled on non-CirrusCI runs.

[bcc]: https://github.com/iovisor/bcc
2022-11-28 21:26:26 +01:00
Martin Zumsande
6fefd49527 rpc: Require NodeStateStats object in getpeerinfo
There is no situation in which CNodeStateStats could be
missing for a legitimate reason - this can only happen if
there is a race condition between peer disconnection and
the getpeerinfo call, in which case the disconnected peer
doesn't need to be included in the response.
2022-11-28 13:45:26 -05:00
MarcoFalke
d415b7261c
Merge bitcoin/bitcoin#26588: ci: Skip COMMIT_RANGE if no CIRRUS_PR
fad1c55301 lint: Skip COMMIT_RANGE if no CIRRUS_PR (MarcoFalke)

Pull request description:

  It doesn't make sense to run this for non-PRs, because:

  * There are known whitespace "violations" in previous commits, so the lint may fail
  * Once the changes are merged, it is too late to fix them up (force pushes are illegal)
  * It isn't possible to determine which commits to run on if there is no reference branch (target branch of the pull request)

  Moreover, the test fails on non-master:

  * https://github.com/bitcoin/bitcoin/runs/8664441400

  Fix all issues by skipping it.

ACKs for top commit:
  hebasto:
    ACK fad1c55301, also tested in my personal Cirrus account.

Tree-SHA512: be15f00e2b2a9069583833545883e0e5968a33d2455dad59e6fb47c1102b4dd16ef932e9ba945e29e9d941e6c17bd531a02c66b0491097801be6bda476875537
2022-11-28 17:18:29 +01:00
Andrew Chow
8597260872
Merge bitcoin/bitcoin#26480: test: Remove wallet option from non-wallet tests
fa10f193b5 test: Set default in add_wallet_options if only one type can be chosen (MacroFake)
555519d082 test: Remove wallet option from non-wallet tests (MacroFake)
fac8d59d31 test: Set -disablewallet when no wallet has been compiled (MacroFake)
fa68937b89 test: Make requires_wallet private (MacroFake)

Pull request description:

  The tests have several issues:

  * Some tests that are wallet-type specific offer the option to run the test with the incompatible type

  For example, `wallet_dump.py` offers `--descriptors` and on current master fails with `JSONRPCException: Invalid public key`. After the changes here, it fails with a clear error: `unrecognized arguments: --descriptors`.

  * Tests that don't use the wallet at all offer the option to run it with a wallet type. This is confusing and wastes developers time if they are "tricked" into running the test for both wallet types, even though no wallet code is executed at all.

  For example, `feature_addrman.py` will happily accept and run with `--descriptors` or `--legacy-wallet`. After the changes here, it no longer silently ignores the flag, but reports a clear error: `unrecognized arguments`.

ACKs for top commit:
  achow101:
    ACK fa10f193b5

Tree-SHA512: a5784da7305f4ec58c0013f433289000d94fc3d434b00fc329ffa37b812e2cd1da0071e34c3462bf79d904808564f2ae6d3d582f6b86b26215f9b07391b58460
2022-11-28 11:16:49 -05:00
fanquake
5488dc1eb4
Merge bitcoin/bitcoin#26073: build: fix depends bdb compilation for BSDs
5b2529b269 build: fix depends bdb compilation for BSDs (fanquake)

Pull request description:

  Currently, building bdb for *BSD HOSTs in depends fails with:
  ```bash
  libtool: compile:  clang -m64 -c -I. -I../dist/./.. -I/home/ubuntu/bitcoin/depends/x86_64-unknown-freebsd/include -D_THREAD_SAFE -pipe -std=c11 -O2 -Wno-error=implicit-function-declaration -Wno-error=format-security ../dist/./../mutex/mut_tas.c  -fPIC -DPIC -o mut_tas.o
  In file included from ../dist/./../mutex/mut_tas.c:11:
  In file included from ./db_int.h:884:
  In file included from ../dist/./../dbinc/mutex.h:15:
  ../dist/./../dbinc/mutex_int.h:932:2: error: unknown type name 'pthread_rwlock_t'
          MUTEX_FIELDS                    /* Opaque thread mutex structures. */
          ^
  ../dist/./../dbinc/mutex_int.h:65:3: note: expanded from macro 'MUTEX_FIELDS'
                  pthread_rwlock_t rwlock;        /* Read/write lock */   \
                  ^
  1 error generated.
  ```

  Defining `_XOPEN_SOURCE` >=600 fixes access to the missing `pthread_rwlock_t` definitions.

ACKs for top commit:
  jarolrod:
    ACK 5b2529b269

Tree-SHA512: 76584bfef7a86c69a095eb722657aa681b95658a031ef2da79d91a616e5370da292a65e7d67cdf641711791422b8a407b647b630ad497ffb9908683479e6cfb6
2022-11-28 13:27:48 +00:00
MarcoFalke
5939794940
Merge bitcoin/bitcoin#26589: test: small fixups/improvements for get_previous_releases.py
9b5feb76bc script: small fixups/improvements for get_previous_releases.py (Sebastian Falbesoner)

Pull request description:

  This is a small follow-up to #25650 (commit 614d4682ba) with three fixes/improvements:

  - fix "Checksum did not match" detection, which was not adapted to the new `SHA256_SUMS` structure and hence never executed (the list of tarball names isn't directly in the dictionary's values anymore, but has to be extracted from the `'tarball'` field of each value)
  - make both help text and default tag download order deterministic by sorting default tags
  - `--tags` argument help text: add missing space between "for" and "backwards"

ACKs for top commit:
  Sjors:
    tACK 9b5feb76bc. Tested that if I change a checksum, or remove a release, it catches that.
  josibake:
    tested ACK 9b5feb76bc

Tree-SHA512: 791fa693477eebbda7fd41f3f5ec78fe7eab57df06979aa907ab258a6945534bdc3b931ddfce0fb440c9666b98c88ce5e1b6dc353ed39e129e87d3634855165c
2022-11-28 13:59:54 +01:00
glozow
00c323610a
Merge bitcoin/bitcoin#25986: test: refactor RPCPackagesTest to use MiniWallet
17cad44851 test: refactor `RPCPackagesTest` to use `MiniWallet` (w0xlt)

Pull request description:

  This PR refactors `RPCPackagesTest` to use `MiniWallet` and removes `create_child_with_parents`, `make_chain`, and `create_raw_chain` from `test_framework/wallet`, as requested in https://github.com/bitcoin/bitcoin/issues/25965.

  Close https://github.com/bitcoin/bitcoin/issues/25965.

ACKs for top commit:
  glozow:
    ACK 17cad44851
  pablomartin4btc:
    tested ACK 17cad44; went thru all changes and recommendations from @kouloumos & @glozow; also went up to #20833 to get a bit of background of the origin and purpose of these tests.
  kouloumos:
    ACK 17cad44851

Tree-SHA512: 9228c532afaecedd577019dbc56f8749046d66f904dd69eb23e7ca3d7806e2132d90af29be276c7635fefb37ef348ae781eb3b225cd6741b20300e6f381041c3
2022-11-28 11:54:52 +00:00
willcl-ark
a27a445b71
refactor: Sub-folder bash completions
Move bash completions to
contrib/completions/bash/*

Precursor to adding fish completions
2022-11-28 11:44:08 +00:00
glozow
a79b720092
Merge bitcoin/bitcoin#26295: Replace global g_cs_orphans lock with local
7082ce3e88 scripted-diff: rename and de-globalise g_cs_orphans (Anthony Towns)
733d85f79c Move all g_cs_orphans locking to txorphanage (Anthony Towns)
a936f41a5d txorphanage: make m_peer_work_set private (Anthony Towns)
3614819864 txorphange: move orphan workset to txorphanage (Anthony Towns)
6f8e442ba6 net_processing: Localise orphan_work_set handling to ProcessOrphanTx (Anthony Towns)
0027174b39 net_processing: move ProcessOrphanTx docs to declaration (Anthony Towns)
9910ed755c net_processing: Pass a Peer& to ProcessOrphanTx (Anthony Towns)
89e2e0da0b net_processing: move extra transactions to msgproc mutex (Anthony Towns)
ff8d44d196 Remove unnecessary includes of txorphange.h (Anthony Towns)

Pull request description:

  Moves extra transactions to be under the `m_msgproc_mutex` lock rather than `g_cs_orphans` and refactors orphan handling so that the lock can be internal to the `TxOrphange` class.

ACKs for top commit:
  dergoegge:
    Code review ACK 7082ce3e88
  glozow:
    ACK 7082ce3e88 via code review and some [basic testing](https://github.com/glozow/bitcoin/blob/review-26295/src/test/orphanage_tests.cpp#L150). I think putting txorphanage in charge of handling peer work sets is the right direction.

Tree-SHA512: 1ec454c3a69ebd45ff652770d6a55c6b183db71aba4d12639ed70f525f0035e069a81d06e9b65b66e87929c607080a1c5e5dcd2ca91eaa2cf202dc6c02aa6818
2022-11-28 10:59:02 +00:00
fanquake
9c2854cda4
Merge bitcoin/bitcoin#26578: doc: install binutils, not binutils-gold in depends
0953c622f9 doc: install binutils, not binutils-gold in depends (fanquake)

Pull request description:

  We don't use the gold linker.
  binutils-gold just installs binutils (and the gold linker) in any case.

ACKs for top commit:
  hebasto:
    ACK 0953c622f9.

Tree-SHA512: c6e44c8d2fe9ef184aeb3b8aec87bac9c49ed0c3ef67de630b12da2945552b3dc4b9b3e75203a7d24a94d9586d59bb638e98f712dbc477681c95a793ee2327d9
2022-11-28 10:29:19 +00:00
MarcoFalke
fad1c55301
lint: Skip COMMIT_RANGE if no CIRRUS_PR 2022-11-28 11:09:30 +01:00