Commit Graph

43359 Commits

Author SHA1 Message Date
fanquake
0d185bd99f
doc: update depends doc to prefer .cmake outputs 2024-11-14 11:32:46 +00:00
merge-script
e546b4e1a0
Merge bitcoin/bitcoin#31225: doc: Fix grammatical errors in multisig-tutorial.md
ac286e0d1b doc: Fix grammatical errors in multisig-tutorial.md (secp512k2)

Pull request description:

  This pull request fixes grammatical errors in the `multisig-tutorial.md` document.

ACKs for top commit:
  Abdulkbk:
    ACK ac286e0d1b

Tree-SHA512: 684fe16e802431109957b9cde441353edeb16ffffde4282310c1a6f104adffc53347d00a2cf3a5969a78803f3177d6056ca37d3b7e8be52c2ec43ec0b9fcf4d9
2024-11-14 10:25:58 +00:00
merge-script
f44e39c9d0
Merge bitcoin/bitcoin#31174: tinyformat: Add compile-time checking for literal format strings
fe39acf88f tinyformat: Add compile-time checking for literal format strings (Ryan Ofsky)
184f34f2d0 util: Support dynamic width & precision in ConstevalFormatString (Ryan Ofsky)

Pull request description:

  Add compile-time checking for literal format strings passed to `strprintf` and `tfm::format` to make sure the right number of format arguments are passed.

  There is still no compile-time checking if non-literal `std::string` or `bilingual_str` format strings are passed, but this is improved in other PRs:

  - [#31061](https://github.com/bitcoin/bitcoin/pull/31061) implements compile-time checking for translated strings
  - [#31072](https://github.com/bitcoin/bitcoin/pull/31072) increases compile-time checking by using literal strings as format strings, instead of `std::string` and `bilingual_str`
  - [#31149](https://github.com/bitcoin/bitcoin/pull/31149) may drop the `std::string`  overload for `strprintf` to [require](https://github.com/bitcoin/bitcoin/pull/31149#issuecomment-2444579999) compile-time checking

ACKs for top commit:
  maflcko:
    re-ACK fe39acf88f 🕐
  l0rinc:
    ACK fe39acf88f
  hodlinator:
    re-ACK fe39acf88f

Tree-SHA512: f1ddef0c96b9468c5ffe31b42dc19f1922583dd14f2e180b618d992c98614c5cc7db9f9cd917ef503f833bbc7dbec78e4489d0035416dce6840837e1d66d87cb
2024-11-14 10:18:44 +00:00
merge-script
69c0313444
Merge bitcoin/bitcoin#31269: validation: Remove RECENT_CONSENSUS_CHANGE validation result
e80e4c6ff9 validation: Remove RECENT_CONSENSUS_CHANGE validation result (TheCharlatan)

Pull request description:

  The *_RECENT_CONSENSUS_CHANGE variants in the validation result enumerations were always unused. They seem to have been kept around speculatively for a soft fork after segwit, however they were never used for taproot either. This points at them not having a clear purpose. Based on the original pull requests' comments their usage was never entirely clear:
  https://github.com/bitcoin/bitcoin/pull/11639#issuecomment-370234133 https://github.com/bitcoin/bitcoin/pull/15141#discussion_r271039747

  Since they are part of the validation interface and need to be exposed by the kernel library keeping them around may also be confusing to future users of the library.

ACKs for top commit:
  sipa:
    ACK e80e4c6ff9
  naumenkogs:
    ACK e80e4c6ff9
  dergoegge:
    ACK e80e4c6ff9
  ajtowns:
    ACK e80e4c6ff9

Tree-SHA512: 0af17c4435bb1b5a4f43600da30545cbbe95a7d642419cabdefabfb82b9335d92262c1c48be7ca2f2a024078ae9447161228b6f951d2f508a51159a31947fb54
2024-11-14 09:43:47 +00:00
Andre Alves
299e2220e9 gen-manpages: implement --skip-missing-binaries
With --skip-missing-binaries, instead of stopping the execution of
gen-manpages.py when a binary is not found, continue generating
manpages for the available binaries and skip the missing ones.
2024-11-14 01:15:00 -03:00
Ava Chow
4228259294
Merge bitcoin/bitcoin#31000: bench: add support for custom data directory
fa66e0887c bench: add support for custom data directory (furszy)
ad9c2cceda test, bench: specialize working directory name (furszy)

Pull request description:

  Expands the benchmark framework with the existing `-testdatadir` arg,
  enabling the ability to change the benchmark data directory.

  This is useful for running benchmarks on different storage devices, and
  not just under the OS `/tmp/` directory.

  A good use case is #28574, where we are benchmarking the wallet
  migration process on an HDD.

ACKs for top commit:
  maflcko:
    re-ACK fa66e0887c
  achow101:
    ACK fa66e0887c
  tdb3:
    re ACK fa66e0887c
  hodlinator:
    re-ACK fa66e0887c
  pablomartin4btc:
    re-ACK fa66e0887c

Tree-SHA512: 4e87206c07e26fe193c07074ae9eb0cc9c70a58aeea8cf27d18fb5425d77e4b00dbe0e6d6a75c17b427744e9066458b9a84e5ef7b0420f02a4fccb9c5ef4dacc
2024-11-13 19:14:23 -05:00
0xb10c
5736d1ddac tracing: pass if replaced by tx/pkg to tracepoint
The mempool:replaced tracepoint now reports either a txid or a
package hash (previously it always was a txid). To let users know
if a txid or package hash is passed, a boolean argument is added
the the tracepoint.

In the functional test, a ctypes.Structure class for MempoolReplaced
is introduced as Python warns the following when not explcitly
casting it to a ctype:

  Type: 'bool' not recognized. Please define the data with ctypes manually.
2024-11-13 13:27:01 -05:00
Suhas Daftuar
a4ec07f194 doc: add comments for CTxMemPool::ChangeSet 2024-11-13 13:27:01 -05:00
Suhas Daftuar
83f814b1d1 Remove m_all_conflicts from SubPackageState 2024-11-13 13:27:01 -05:00
Suhas Daftuar
d3c8e7dfb6 Ensure that we don't add duplicate transactions in rbf fuzz tests 2024-11-13 13:27:01 -05:00
Suhas Daftuar
d7dc9fd2f7 Move CalculateChunksForRBF() to the mempool changeset 2024-11-13 13:27:01 -05:00
Suhas Daftuar
284a1d33f1 Move prioritisation into changeset 2024-11-13 13:27:01 -05:00
Suhas Daftuar
446b08b599 Don't distinguish between direct conflicts and all conflicts when doing cluster-size-2-rbf checks 2024-11-13 13:27:01 -05:00
Suhas Daftuar
b53041021a Duplicate transactions are not permitted within a changeset 2024-11-13 13:27:01 -05:00
Suhas Daftuar
b447416fdd Public mempool removal methods Assume() no changeset is outstanding
While a changeset is outstanding, removing transaction directly from the
mempool will invalidate the changeset state, so this is not permitted.
2024-11-13 13:27:01 -05:00
Suhas Daftuar
2b30f4d36c Make RemoveStaged() private 2024-11-13 13:27:01 -05:00
Suhas Daftuar
18829194ca Enforce that there is only one changeset at a time 2024-11-13 13:27:01 -05:00
Suhas Daftuar
7fb62f7db6 Apply mempool changeset transactions directly into the mempool
Rather than individually calling addUnchecked for each transaction added in a
changeset (after removing all the to-be-removed transactions), instead we can
take advantage of boost::multi_index's splicing features to extract and insert
entries directly from the staging multi_index into mapTx.

This has the immediate advantage of saving allocation overhead for mempool
entries which have already been allocated once. This also means that the memory
locations of mempool entries will not change when transactions go from staging
to the main mempool.

Additionally, eliminate addUnchecked and require all new transactions to enter
the mempool via a CTxMemPoolChangeSet.
2024-11-13 13:26:56 -05:00
Suhas Daftuar
34b6c5833d Clean up FinalizeSubpackage to avoid workspace-specific information
Also, use the "package hash" for logging replacements in the package rbf
setting.
2024-11-13 13:19:58 -05:00
Suhas Daftuar
57983b8add Move LimitMempoolSize to take place outside FinalizeSubpackage 2024-11-13 13:17:28 -05:00
Suhas Daftuar
01e145b975 Move changeset from workspace to subpackage
Removes a redundant check that mempool limits will not be violated during
package acceptance.
2024-11-13 13:17:27 -05:00
Suhas Daftuar
802214c083 Introduce mempool changesets
Introduce the CTxMemPool::ChangeSet, a wrapper for creating (potential) new
mempool entries and removing conflicts.
2024-11-13 13:15:12 -05:00
Suhas Daftuar
87d92fa340 test: Add unit test coverage of package rbf + prioritisetransaction 2024-11-13 13:10:57 -05:00
Suhas Daftuar
15d982f91e Add package hash to package-rbf log message 2024-11-13 13:10:57 -05:00
MarcoFalke
fa5e706459
ci: Skip broken Wine64 tests by default 2024-11-13 18:38:24 +01:00
fanquake
4d66854982
ci: remove util-linux from centos CI 2024-11-13 15:51:45 +00:00
fanquake
cdf34be7c9
guix: remove util-linux 2024-11-13 15:51:17 +00:00
Greg Sanders
cbf1a47d60 CheckEphemeralSpends: only compute txid of tx when needed 2024-11-13 09:19:10 -05:00
merge-script
36f5effa17
Merge bitcoin/bitcoin#31235: addrman: cap the max_pct to not exceed the maximum number of addresses
9c5775c331 addrman: cap the `max_pct` to not exceed the maximum number of addresses (brunoerg)

Pull request description:

  Fixes #31234

  This PR fixes a bad alloc issue in `GetAddresses` by capping the value `max_pct`. In practice, values greater than 100 should be treated as 100 since it's the percentage of addresses to return. Also, it limites the value `max_pct` in connman target to exercise values between 0 and 100.

ACKs for top commit:
  adamandrews1:
    Code Review ACK 9c5775c331
  marcofleon:
    Tested ACK 9c5775c331. Reproduced the crash on master and checked that this fixed it. The checks added to `GetAddr_` look reasonable.
  mzumsande:
    Code Review ACK 9c5775c331
  vasild:
    ACK 9c5775c331

Tree-SHA512: 2957ae561ccc37df71f43c1863216d2e563522ea70b9a4baee6990e0b4a1ddadccabdcb9115c131a9a57480367b5ebdd03e0e3d4c8583792e2b7d1911a0a06d3
2024-11-13 12:13:17 +00:00
Fabian Jahr
111465d72d
test: Remove unused attempts parameter from wait_until 2024-11-13 12:02:44 +01:00
Fabian Jahr
5468a23eb9
test: Add check_interval parameter to wait_until
This also replaces two sleep calls in functional tests with wait_until
2024-11-13 12:02:42 +01:00
Fabian Jahr
16c87d91fd
test: Introduce ensure_for helper 2024-11-13 12:00:16 +01:00
merge-script
98ad249b69
Merge bitcoin/bitcoin#31277: doc: mention descriptorprocesspsbt in psbt.md
ebb6cd82ba doc: mention `descriptorprocesspsbt` in psbt.md (Sebastian Falbesoner)

Pull request description:

  Noticed that the `descriptorprocesspsbt` RPC call is currently not documented anywhere.

ACKs for top commit:
  sipa:
    ACK ebb6cd82ba
  kevkevinpal:
    ACK [ebb6cd8](ebb6cd82ba)
  danielabrozzoni:
    ACK ebb6cd82ba
  ismaelsadeeq:
    ACK ebb6cd82ba
  tdb3:
    ACK ebb6cd82ba

Tree-SHA512: 47f3c8693dfc79bf2d38176ee015efe8c1a1539b95f9e0eb3db7693e4ef39222ad2b5cb44d55042ca1eb4288ba5e486068f66c054ff0a59e989b6cdc8e4461f6
2024-11-13 09:25:57 +00:00
Ava Chow
f42ec0f3bf wallet: Check specified wallet exists before migration
The previous error message for non-existent wallets of "Already a
descriptor wallet" is misleading. Return a more specific error when a
non-existent wallet is specified.
2024-11-12 21:19:27 -05:00
glozow
b0222bbb49
Merge bitcoin/bitcoin#30239: Ephemeral Dust
5c2e291060 bench: Add basic CheckEphemeralSpends benchmark (Greg Sanders)
3f6559fa58 Add release note for ephemeral dust (Greg Sanders)
71a6ab4b33 test: unit test for CheckEphemeralSpends (Greg Sanders)
21d28b2f36 fuzz: add ephemeral_package_eval harness (Greg Sanders)
127719f516 test: Add CheckMempoolEphemeralInvariants (Greg Sanders)
e2e30e89ba functional test: Add ephemeral dust tests (Greg Sanders)
4e68f90139 rpc: disallow in-mempool prioritisation of dusty tx (Greg Sanders)
e1d3e81ab4 policy: Allow dust in transactions, spent in-mempool (Greg Sanders)
04b2714fbb functional test: Add new -dustrelayfee=0 test case (Greg Sanders)

Pull request description:

  A replacement for https://github.com/bitcoin/bitcoin/pull/29001

  Now that we have 1P1C relay, TRUC transactions and sibling eviction, it makes sense to retarget this feature more narrowly by not introducing a new output type, and simple focusing on the feature of allowing temporary dust in the mempool.

  Users of this can immediately use dust outputs as:
  1. Single keyed anchor (can be shared by multiple parties)
  2. Single unkeyed anchor, ala P2A

  Which is useful when the parent transaction cannot have fees for technical or accounting reasons.

  What I'm calling "keyed" anchors would be used anytime you don't want a third party to be able to run off with the utxo. As a motivating example, in Ark there is the concept of a "forfeit transaction" which spends a "connector output". The connector output would ideally be 0-value, but you would not want that utxo spend by anyone, because this would cause financial loss for the coordinator of the service: https://arkdev.info/docs/learn/concepts#forfeit-transaction

  Note that this specific use-case likely doesn't work as it involves a tree of dust, but the connector idea in general demonstrates how it could be used.

  Another related example is connector outputs in BitVM2: https://bitvm.org/bitvm2.html .

  Note that non-TRUC usage will be impractical unless the minrelay requirement on individual transactions are dropped in general, which should happen post-cluster mempool.

  Lightning Network intends to use this feature post-29.0 if available: https://github.com/lightning/bolts/issues/1171#issuecomment-2373748582

  It's also useful for Ark, ln-symmetry, spacechains, Timeout Trees, and other constructs with large presigned trees or other large-N party smart contracts.

ACKs for top commit:
  glozow:
    reACK 5c2e291060 via range-diff. Nothing but a rebase and removing the conflict.
  theStack:
    re-ACK 5c2e291060

Tree-SHA512: 88e6a6b3b91dc425de47ccd68b7668c8e98c5683712e892c588f79ad639ae95c665e2d5563dd5e5797983e7542cbd1d4353bc90a7298d45a1843b05a417f09f5
2024-11-12 20:05:01 -05:00
glozow
1dda1892b6
Merge bitcoin/bitcoin#31037: test: enhance p2p_orphan_handling
9de9c858d5 test: enhance p2p_orphan_handling (tdb3)
33af14b62e test: reduce assert_debug_log reliance (tdb3)

Pull request description:

  Previously, `p2p_orphan_handling` relied on checking the debug log for orphanage changes.  This updates the tests to reduce debug log checking and add checks using `tx_in_orphanage()` and `getorphantxs` introduced in #30793.

ACKs for top commit:
  glozow:
    light code review ACK 9de9c858d5
  rkrux:
    tACK 9de9c858d5
  danielabrozzoni:
    ACK 9de9c858d5

Tree-SHA512: b53bf0d66d727c79eab972b736a074bd04ca652afd89d2a50830247f42734c61c4c2fa883fde179560e39469c81d0e7be478e1faa0992d3688d5e04d75c067d7
2024-11-12 12:36:55 -05:00
marcofleon
a6ca8f3243 fuzz: Fix difficulty target generation in p2p_headers_presync
The hardcoded nBits range would occasionally produce values for
the difficulty target that were too low, causing the total work
of the test chain to exceed MinimumChainWork. This fix uses
ConsumeArithUInt256InRange to properly generate targets that
will produce header chains with less work than MinimumChainWork.
2024-11-12 17:01:34 +00:00
Greg Sanders
5c2e291060 bench: Add basic CheckEphemeralSpends benchmark 2024-11-12 09:41:24 -05:00
Greg Sanders
3f6559fa58 Add release note for ephemeral dust 2024-11-12 09:41:24 -05:00
Greg Sanders
71a6ab4b33 test: unit test for CheckEphemeralSpends 2024-11-12 09:41:24 -05:00
Greg Sanders
21d28b2f36 fuzz: add ephemeral_package_eval harness
Works a bit harder to get ephemeral dust
transactions into the mempool.
2024-11-12 09:41:24 -05:00
Greg Sanders
127719f516 test: Add CheckMempoolEphemeralInvariants
Checks that transactions in mempool with dust
follow expected invariants.
2024-11-12 09:24:54 -05:00
Greg Sanders
e2e30e89ba functional test: Add ephemeral dust tests 2024-11-12 09:24:54 -05:00
Greg Sanders
4e68f90139 rpc: disallow in-mempool prioritisation of dusty tx 2024-11-12 09:24:54 -05:00
Greg Sanders
e1d3e81ab4 policy: Allow dust in transactions, spent in-mempool
Also known as Ephemeral Dust.

We try to ensure that dust is spent in blocks by requiring:
  - ephemeral dust tx is 0-fee
  - ephemeral dust tx only has one dust output
  - If the ephemeral dust transaction has a child,
    the dust is spent by by that child.

0-fee requirement means there is no incentive to mine
a transaction which doesn't have a child bringing its
own fees for the transaction package.
2024-11-12 09:24:54 -05:00
Greg Sanders
04b2714fbb functional test: Add new -dustrelayfee=0 test case
This test would catch regressions where ephemeral
dust checks are being erroneously applied on outputs
that are not actually dust.
2024-11-12 09:24:54 -05:00
Sebastian Falbesoner
ebb6cd82ba doc: mention descriptorprocesspsbt in psbt.md 2024-11-12 14:56:12 +01:00
Sjors Provoost
8610bcef9d
ci: skip Github CI on branch pushes for forks
Consistent with Cirrus behavior introduced in e9bfbb5414.
2024-11-12 12:14:34 +01:00
merge-script
2b33322169
Merge bitcoin/bitcoin#31249: test: Add combinerawtransaction test to rpc_createmultisig
83fab3212c test: Add combinerawtransaction test to rpc_createmultisig (Ava Chow)

Pull request description:

  The only coverage of combinerawtransaction is in a legacy wallet only test. So also use it in rpc_createmultisig so that this RPC remains tested after the legacy wallet is removed.

  Split from #28710

ACKs for top commit:
  maflcko:
    re-ACK 83fab3212c
  BrandonOdiwuor:
    Re-ACK 83fab3212c
  Abdulkbk:
    ACK 83fab3212c
  brunoerg:
    code review ACK 83fab3212c
  rkrux:
    tACK 83fab3212c

Tree-SHA512: 383d88ff6c9b54337ed81c714026e527b0fed41d976959fd5c6863b49d0defa4ea13fdc3d984885c86a2b6380825cd66c17842cc31f20fbec4bc42d86aecbbfa
2024-11-12 10:58:33 +00:00
merge-script
3fb6229dcf
Merge bitcoin/bitcoin#31271: doc: correct typos
726cbee955 doc: correct typos (fanquake)
9fdfb73ca8 doc: fix typos (Afanti)

Pull request description:

  Includes #31253.
  Includes https://github.com/bitcoin/bitcoin/pull/31239#pullrequestreview-2425008603.
  Fixes remaining lint output.

ACKs for top commit:
  l0rinc:
    ACK 726cbee955
  rkrux:
    crACK 726cbee955
  tdb3:
    ACK 726cbee955

Tree-SHA512: 51978343f11fb5f0c6b824d92dbfc9999952373a9f790ab79ef8750f920f1c020c092ca874c9e39f478d12d85cdadcfd8c63dda0cbb02745bc55fda28d371e4c
2024-11-12 09:48:13 +00:00