Commit graph

517 commits

Author SHA1 Message Date
Byron Hambly
474dd0f6f9 Merge 7143d43884 into merged_master (Bitcoin PR bitcoin/bitcoin#28948) 2025-12-03 19:08:52 +00:00
Byron Hambly
dc732e22fa
Merge 651fb034d8 into merged_master (Bitcoin PR bitcoin/bitcoin#29260) 2025-11-18 13:39:34 +02:00
Byron Hambly
c99f0e4a16
Merge dd391944dc into merged_master (Bitcoin PR bitcoin/bitcoin#28863) 2025-11-17 20:53:12 +02:00
Byron Hambly
ace23d7b9b
Merge a97a89244e into merged_master (Bitcoin PR bitcoin/bitcoin#28368) 2025-11-11 14:35:48 +02:00
Byron Hambly
c21dfe5a42
Merge 535424a10b into merged_master (Bitcoin PR bitcoin/bitcoin#28903) 2025-11-11 10:43:21 +02:00
Byron Hambly
26b9abc2f2
Merge b5a271334c into merged_master (Bitcoin PR bitcoin/bitcoin#28922) 2025-11-11 08:56:23 +02:00
Byron Hambly
d37a031e7e
Merge d232e36abd into merged_master (Bitcoin PR bitcoin/bitcoin#28207) 2025-11-06 11:32:58 +02:00
Byron Hambly
d55f2b27cb
Merge dd5f5713bc into merged_master (Bitcoin PR bitcoin/bitcoin#28391) 2025-11-06 11:13:40 +02:00
Byron Hambly
69492d27da
Merge 08ea835220 into merged_master (Bitcoin PR bitcoin/bitcoin#28583) 2025-08-07 10:05:15 +02:00
Byron Hambly
9250f7cb6b
Merge 2303fd2f43 into merged_master (Bitcoin PR bitcoin/bitcoin#28471) 2025-08-04 10:23:30 +02:00
Byron Hambly
1c95683b4f
Merge 3966b0a0b6 into merged_master (Bitcoin PR bitcoin/bitcoin#28472) 2025-08-04 09:26:56 +02:00
Byron Hambly
b5fa48988e Merge f1a9fd627b into merged_master (Bitcoin PR bitcoin/bitcoin#28251) 2025-07-21 13:58:00 +02:00
Byron Hambly
ca14c27f1b Merge 00fc7cdc25 into merged_master (Bitcoin PR bitcoin/bitcoin#28200) 2025-07-05 07:45:03 +02:00
Byron Hambly
27a302a296 Merge a62f5ee86c into merged_master (Bitcoin PR bitcoin/bitcoin#27675) 2025-07-04 09:56:00 +02:00
Byron Hambly
be5e9e1a5e Merge 7c66a4b610 into merged_master (Bitcoin PR bitcoin/bitcoin#28059) 2025-07-03 15:04:19 +02:00
Byron Hambly
f60b1bc9ee Merge d1ae96755a into merged_master (Bitcoin PR bitcoin/bitcoin#27890) 2025-06-27 15:40:28 +02:00
Byron Hambly
4bbb50081b Merge 58b36fc303 into merged_master (Bitcoin PR bitcoin/bitcoin#23962) 2025-06-27 14:26:15 +02:00
Byron Hambly
6b602eff8d Merge 1af72e728d into merged_master (Bitcoin PR bitcoin/bitcoin#27501) 2025-06-27 11:42:46 +02:00
Byron Hambly
edc585d157 Merge 9564f98fee into merged_master (Bitcoin PR bitcoin/bitcoin#27636) 2025-06-25 11:40:46 +02:00
Byron Hambly
0d64b264ee Merge 0f8c95dccd into merged_master (Bitcoin PR bitcoin/bitcoin#27021) 2025-06-20 21:39:19 +02:00
Byron Hambly
974c4bd0b9 Merge 137a98c5a2 into merged_master (Bitcoin PR bitcoin/bitcoin#27610) 2025-06-20 10:57:34 +02:00
Byron Hambly
5ac82e15a9 Merge 669af32632 into merged_master (Bitcoin PR bitcoin/bitcoin#27419) 2025-05-09 11:47:45 +02:00
Thomas Trevethan
b49bfac365 Merge 60f142e395 into merged_master (Bitcoin PR bitcoin/bitcoin#26531) 2025-04-11 14:45:16 +01:00
Byron Hambly
2ba842104d Merge 550e6bd227 into merged_master (Bitcoin PR bitcoin/bitcoin#26935) 2025-04-05 10:57:32 +02:00
Byron Hambly
86799b1cb9 Merge 2cfe379623 into merged_master (Bitcoin PR bitcoin/bitcoin#26823) 2025-04-01 19:42:10 +02:00
Byron Hambly
3d63f2c634 Merge 03254c2229 into merged_master (Bitcoin PR bitcoin/bitcoin#19909) 2025-04-01 10:26:45 +02:00
Byron Hambly
80b3fcae86 Merge 80fc1af096 into merged_master (Bitcoin PR bitcoin/bitcoin#26289) 2025-04-01 09:10:14 +02:00
Byron Hambly
b4405ba453 Merge e9262ea32a into merged_master (Bitcoin PR bitcoin/bitcoin#26750) 2025-03-31 16:37:52 +02:00
Byron Hambly
da8b6f2f7f
Merge d0b1f613c2 into merged_master (Bitcoin PR bitcoin/bitcoin#17786) 2025-03-03 11:12:31 +02:00
Byron Hambly
7ea69ff0d8
Merge UP TO 48174c0f28 into merged_master (UP TO Bitcoin PR bitcoin/bitcoin#26240)
FIXME in wallet_taproot.py functional test

1668424146 2022-11-14T12:09:06+01:00 48174c0f28 Bitcoin Merge bitcoin/bitcoin#26240: rpc: Adjust RPCTypeCheckObj error string
1668417474 2022-11-14T10:17:54+01:00 59e00c7e03 Bitcoin Merge bitcoin/bitcoin#25714: univalue: Avoid std::string copies
1668111238 2022-11-10T15:13:58-05:00 7ef730ca84 Bitcoin Merge bitcoin/bitcoin#26483: test: Don't pass add_to_wallet option to walletcreatefundedpsbt
1668004459 2022-11-09T15:34:19+01:00 9dce30194b Bitcoin Merge bitcoin/bitcoin#26472: test: add missing bech32m / BIP86 test-cases to wallet_descriptor.py
1667992471 2022-11-09T12:14:31+01:00 44ca5d5e87 Bitcoin Merge bitcoin/bitcoin#26473: test: Avoid collision with valid path names in `getarg_tests/logargs`
1667640759 2022-11-05T10:32:39+01:00 50422b770a Bitcoin Merge bitcoin/bitcoin#26419: log: mempool: log removal reason in validation interface
1667636699 2022-11-05T09:24:59+01:00 ce57dbac90 Bitcoin Merge bitcoin/bitcoin#26449: rpc: doc: add missing option "bech32m" for `change_type` parameters
1667577253 2022-11-04T15:54:13+00:00 ae6bb6e71e Bitcoin Merge bitcoin/bitcoin#26418: Fix signing of multi_a and rawtr scripts with wallets that only have corresponding keys
2025-02-27 15:15:49 +02:00
Byron Hambly
ca0a68b350
Merge UP TO 551c8e9526 into merged_master (UP TO bitcoin/bitcoin#26349)
Includes FIXMEs for a few functional tests
2025-02-05 09:50:17 +02:00
Byron Hambly
d06e8b7c42 Merge 5558d2f549 into merged_master (Bitcoin PR bitcoin/bitcoin#26048) 2024-11-26 13:19:38 +02:00
Byron Hambly
12dbf6cb9d Merge f6fdedf850 into merged_master (Bitcoin PR bitcoin/bitcoin#25648) 2024-10-24 20:20:13 +02:00
Byron Hambly
076e809b74 Merge 821f5c824f into merged_master (Bitcoin PR bitcoin/bitcoin#25487) 2024-10-17 09:16:23 +02:00
James Dorfman
dbab4c012c Merge a7f3479ba3 into merged_master (Bitcoin PR bitcoin/bitcoin#25353) 2024-10-13 18:06:13 +00:00
James Dorfman
17851700b4 Merge e4e201dfd9 into merged_master (Bitcoin PR bitcoin/bitcoin#25290) 2024-09-19 18:56:19 +00:00
James Dorfman
ed625a6abc Merge dde7205c57 into merged_master (Bitcoin PR bitcoin/bitcoin#23418) 2024-09-16 06:14:02 +00:00
James Dorfman
5b1a4e1dd3 Merge 1e3ed01faa into merged_master (Bitcoin PR bitcoin/bitcoin#23416) 2024-07-30 06:40:35 +00:00
James Dorfman
76db49f822 Merge bbb83f0b2b into merged_master (Bitcoin PR bitcoin/bitcoin#24145) 2024-07-29 18:55:35 +00:00
James Dorfman
b3a377c2d0 Merge 0da559e02e into merged_master (Bitcoin PR bitcoin/bitcoin#24661) 2024-07-08 15:17:32 +00:00
James Dorfman
9c1d4cc8ff Merge a4d7ac7bbe into merged_master (Elements PR #1317) 2024-05-24 16:13:46 +00:00
Byron Hambly
b7b2288a74
discount: implement mempool logic 2024-05-14 19:03:36 +02:00
Ava Chow
7143d43884
Merge bitcoin/bitcoin#28948: v3 transaction policy for anti-pinning
29029df5c7 [doc] v3 signaling in mempool-replacements.md (glozow)
e643ea795e [fuzz] v3 transactions and sigop-adjusted vsize (glozow)
1fd16b5c62 [functional test] v3 transaction submission (glozow)
27c8786ba9 test framework: Add and use option for tx-version in MiniWallet methods (MarcoFalke)
9a1fea55b2 [policy/validation] allow v3 transactions with certain restrictions (glozow)
eb8d5a2e7d [policy] add v3 policy rules (glozow)
9a29d470fb [rpc] return full string for package_msg and package-error (glozow)
158623b8e0 [refactor] change Workspace::m_conflicts and adjacent funcs/structs to use Txid (glozow)

Pull request description:

  See #27463 for overall package relay tracking.

  Delving Bitcoin discussion thread: https://delvingbitcoin.org/t/v3-transaction-policy-for-anti-pinning/340
  Delving Bitcoin discussion for LN usage: https://delvingbitcoin.org/t/lightning-transactions-with-v3-and-ephemeral-anchors/418

  Rationale:
  - There are various pinning problems with RBF and our general ancestor/descendant limits. These policies help mitigate many pinning attacks and make package RBF feasible (see #28984 which implements package RBF on top of this). I would focus the most here on Rule 3 pinning. [1][2]
  - Switching to a cluster-based mempool (see #27677 and #28676) requires the removal of CPFP carve out, which applications depend on. V3 + package RBF + ephemeral anchors + 1-parent-1-child package relay provides an intermediate solution.

  V3 policy is for "Priority Transactions." [3][4] It allows users to opt in to more restrictive topological limits for shared transactions, in exchange for the more robust fee-bumping abilities that offers. Even though we don't have cluster limits, we are able to treat these transactions as having as having a maximum cluster size of 2.

  Immediate benefits:

  - You can presign a transaction with 0 fees (not just 1sat/vB!) and add a fee-bump later.
  - Rule 3 pinning is reduced by a significant amount, since the attacker can only attach a maximum of 1000vB to your shared transaction.

  This also enables some other cool things (again see #27463 for overall roadmap):
  - Ephemeral Anchors
  - Package RBF for these 1-parent-1-child packages. That means e.g. a commitment tx + child can replace another commitment tx using the child's fees.
  - We can transition to a "single anchor" universe without worrying about package limit pinning. So current users of CPFP carve out would have something else to use.
  - We can switch to a cluster-based mempool [5] (#27677 #28676), which removes CPFP carve out [6].

  [1]: Original mailing list post and discussion about RBF pinning problems https://gist.github.com/glozow/25d9662c52453bd08b4b4b1d3783b9ff, https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html
  [2]: A FAQ is "we need this for cluster mempool, but is this still necessary afterwards?" There are some pinning issues that are fixed here and not fully fixed in cluster mempool, so we will still want this or something similar afterward.
  [3]: Mailing list post for v3 https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-September/020937.html
  [4]: Original PR #25038 also contains a lot of the discussion
  [5]: https://delvingbitcoin.org/t/an-overview-of-the-cluster-mempool-proposal/393/7
  [6]: https://delvingbitcoin.org/t/an-overview-of-the-cluster-mempool-proposal/393#the-cpfp-carveout-rule-can-no-longer-be-supported-12

ACKs for top commit:
  sdaftuar:
    ACK 29029df5c7
  achow101:
    ACK 29029df5c7
  instagibbs:
    ACK 29029df5c7 modulo that

Tree-SHA512: 9664b078890cfdca2a146439f8835c9d9ab483f43b30af8c7cd6962f09aa557fb1ce7689d5e130a2ec142235dbc8f21213881baa75241c5881660f9008d68450
2024-02-09 23:37:57 -05:00
Byron Hambly
9f081a556e Merge 0a14a16efe into merged_master (Bitcoin PR bitcoin/bitcoin#24625) 2024-02-02 12:01:42 +02:00
stickies-v
282b12ddb0
refactor: remove CTxMemPool::queryHashes()
Its only usage can easily be replaced with CTxMemPool::entryAll()
2024-01-18 21:54:56 +00:00
glozow
158623b8e0 [refactor] change Workspace::m_conflicts and adjacent funcs/structs to use Txid
It's preferable to use type-safe transaction identifiers to avoid
confusing txid and wtxid. The next commit will add a reference to this
set; we use this opportunity to change it to Txid ahead of time instead
of adding new uses of uint256.
2024-01-16 14:20:33 +00:00
ismaelsadeeq
8dec9c560b wallet, mempool: propagete checkChainLimits error message to wallet
Update CheckPackageLimits to use util::Result to pass the error message
instead of out parameter.

Also update test to reflect the error message from `CTxMempool`
`CheckPackageLimits` output.
2023-12-17 21:13:44 +01:00
Andrew Chow
a97a89244e
Merge bitcoin/bitcoin#28368: Fee Estimator updates from Validation Interface/CScheduler thread
91504cbe0d rpc: `SyncWithValidationInterfaceQueue` on fee estimation RPC's (ismaelsadeeq)
714523918b tx fees, policy: CBlockPolicyEstimator update from `CValidationInterface` notifications (ismaelsadeeq)
dff5ad3b99 CValidationInterface: modify the parameter of `TransactionAddedToMempool` (ismaelsadeeq)
91532bd382 tx fees, policy: update `CBlockPolicyEstimator::processBlock` parameter (ismaelsadeeq)
bfcd401368 CValidationInterface, mempool: add new callback to `CValidationInterface` (ismaelsadeeq)
0889e07987 tx fees, policy: cast with static_cast instead of C-Style cast (ismaelsadeeq)
a0e3eb7549 tx fees, policy: bugfix: move `removeTx` into reason != `BLOCK` condition (ismaelsadeeq)

Pull request description:

  This is an attempt to  #11775

  This Pr will enable fee estimator to listen to ValidationInterface notifications to process new transactions added and removed from the mempool.

  This PR includes the following changes:

  - Added a new callback to the Validation Interface `MempoolTransactionsRemovedForConnectedBlock`, which notifies listeners about the transactions that have been removed due to a new block being connected, along with the height at which the transactions were removed.
  - Modified the `TransactionAddedToMempool` callback parameter to include additional information about the transaction needed for fee estimation.
  - Updated `CBlockPolicyEstimator` to process transactions using` CTransactionRef` instead of `CTxMempoolEntry.`
  - Implemented the `CValidationInterface` interface in `CBlockPolicyEstimater` and overridden the `TransactionAddedToMempool`, `TransactionRemovedFromMempool`, and `MempoolTransactionsRemovedForConnectedBlock` methods to receive updates from their notifications.

  Prior to this PR, the fee estimator updates from the mempool, i.e whenever a new block is connected all transactions in the block that are in our mempool are going to be removed using the `removeForBlock` function in `txmempool.cpp`.

  This removal triggered updates to the fee estimator. As a result, the fee estimator would block mempool's `cs` until it finished updating every time a new block was connected.
  Instead of being blocked only on mempool tx removal, we were blocking on both tx removal and fee estimator updating.
  If we want to further improve fee estimation, or add heavy-calulation steps to it, it is currently not viable as we would be slowing down block relay in the process

  This PR is smaller in terms of the changes made compared to #11775, as it focuses solely on enabling fee estimator updates from the validationInterface/cscheduler thread notifications.

  I have not split the validation interface because, as I understand it, the rationale behind the split in #11775 was to have `MempoolInterface` signals come from the mempool and `CValidationInterface` events come from validation. I believe this separation can be achieved in a separate refactoring PR when the need arises.

  Also left out some commits from #11775
  - Some refactoring which are no longer needed.
  - Handle reorgs much better in fee estimator.
  - Track witness hash malleation in fee estimator

  I believe they are a separate change that can come in a follow-up after this.

ACKs for top commit:
  achow101:
    ACK 91504cbe0d
  TheCharlatan:
    Re-ACK 91504cbe0d
  willcl-ark:
    ACK 91504cbe0d

Tree-SHA512: 846dfb9da57a8a42458827b8975722d153907fe6302ad65748d74f311e1925557ad951c3d95fe71fb90ddcc8a3710c45abb343ab86b88780871cb9c38c72c7b1
2023-12-01 15:07:23 -05:00
Andrew Chow
535424a10b
Merge bitcoin/bitcoin#28903: refactor: Make CTxMemPoolEntry only explicitly copyable
705e3f1de0 refactor: Make CTxMemPoolEntry only explicitly copyable (TheCharlatan)

Pull request description:

  This has the goal of prohibiting users from accidentally creating runtime failures, e.g. by interacting with iterator_to with a copied entry. This was brought up here:  https://github.com/bitcoin/bitcoin/pull/28886#issuecomment-1814794954.

  CTxMemPoolEntry is already implicitly not move-constructable. So be explicit about this and use a std::list to collect the values in the policy_estimator fuzz test instead of a std::vector.

ACKs for top commit:
  maflcko:
    ACK 705e3f1de0 🌯
  achow101:
    ACK 705e3f1de0
  ajtowns:
    ACK 705e3f1de0
  ismaelsadeeq:
    ACK 705e3f1de0

Tree-SHA512: 62056905c679c919d00f9ae065ed66ac986e7e7062015aea542843d8deecda57104d7a68d002f7b20afa3164f8e9215d2d2d002c167224129540e3b1bd0712cc
2023-11-28 14:45:23 -05:00
ismaelsadeeq
714523918b tx fees, policy: CBlockPolicyEstimator update from CValidationInterface notifications
`CBlockPolicyEstimator` will implement `CValidationInterface` and
subscribe to its notification to process transactions added and removed
from the mempool.

Re-delegate calculation of `validForFeeEstimation` from validation to fee estimator.

Also clean up the validForFeeEstimation arg thats no longer needed in `CTxMempool`.

Co-authored-by: Matt Corallo <git@bluematt.me>
2023-11-22 11:48:21 +01:00