Commit graph

469 commits

Author SHA1 Message Date
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
Byron Hambly
9f081a556e Merge 0a14a16efe into merged_master (Bitcoin PR bitcoin/bitcoin#24625) 2024-02-02 12:01:42 +02:00
Byron Hambly
3911e7e2b3
build: fix compilation warnings 2023-09-01 16:39:08 +02:00
Byron Hambly
941940e946
Fix unnecessary pvChecks arg introduced in df8f97d63b in merge of Bitcoin PR bitcoin/bitcoin#23157 2023-08-08 10:10:00 +02:00
Byron Hambly
522ba1a6a8 Merge 0147278e37 into merged_master (Bitcoin PR bitcoin/bitcoin#21464) 2023-06-21 09:23:39 +00:00
Byron Hambly
ba233174c1 Merge 75a227e39e into merged_master (Bitcoin PR bitcoin/bitcoin#23683) 2023-06-14 17:57:12 +00:00
Byron Hambly
47626b5a64 Merge 623745ca74 into merged_master (Bitcoin PR bitcoin/bitcoin#23912) 2023-06-14 15:44:11 +00:00
Andrew Chow
1af72e728d
Merge bitcoin/bitcoin#27501: mempool / rpc: add getprioritisedtransactions, delete a mapDeltas entry when delta==0
67b7fecacd [mempool] clear mapDeltas entry if prioritisetransaction sets delta to 0 (glozow)
c1061acb9d [functional test] prioritisation is not removed during replacement and expiry (glozow)
0e5874f0b0 [functional test] getprioritisedtransactions RPC (glozow)
99f8046829 [rpc] add getprioritisedtransactions (glozow)
9e9ca36c80 [mempool] add GetPrioritisedTransactions (glozow)

Pull request description:

  Add an RPC to get prioritised transactions (also tells you whether the tx is in mempool or not), helping users clean up `mapDeltas` manually. When `CTxMemPool::PrioritiseTransaction` sets a delta to 0, remove the entry from `mapDeltas`.

  Motivation / Background
  - `mapDeltas` entries are never removed from mapDeltas except when the tx is mined in a block or conflicted.
  - Mostly it is a feature to allow `prioritisetransaction` for a tx that isn't in the mempool {yet, anymore}. A user can may resbumit a tx and it retains its priority, or mark a tx as "definitely accept" before it is seen.
  - Since #8448, `mapDeltas` is persisted to mempool.dat and loaded on restart. This is also good, otherwise we lose prioritisation on restart.
  - Note the removal due to block/conflict is only done when `removeForBlock` is called, i.e. when the block is received. If you load a mempool.dat containing `mapDeltas` with transactions that were mined already (e.g. the file was saved prior to the last few blocks), you don't delete them.
  - Related: #4818 and #6464.
  - There is no way to query the node for not-in-mempool `mapDeltas`. If you add a priority and forget what the value was, the only way to get that information is to inspect mempool.dat.
  - Calling `prioritisetransaction` with an inverse value does not remove it from `mapDeltas`, it just sets the value to 0. It disappears on a restart (`LoadMempool` checks if delta is 0), but that might not happen for a while.

  Added together, if a user calls `prioritisetransaction` very regularly and not all those transactions get mined/conflicted, `mapDeltas` might keep lots of entries of delta=0 around. A user should clean up the not-in-mempool prioritisations, but that's currently difficult without keeping track of what those txids/amounts are.

ACKs for top commit:
  achow101:
    ACK 67b7fecacd
  theStack:
    Code-review ACK 67b7fecacd
  instagibbs:
    code review ACK 67b7fecacd
  ajtowns:
    ACK 67b7fecacd code review only, some nits

Tree-SHA512: 9df48b622ef27f33db1a2748f682bb3f16abe8172fcb7ac3c1a3e1654121ffb9b31aeaad5570c4162261f7e2ff5b5912ddc61a1b8beac0e9f346a86f5952260a
2023-06-07 03:29:05 -04:00
Byron Hambly
1aedc97366 Merge ffe414bd9a into merged_master (Bitcoin PR bitcoin/bitcoin#23649) 2023-06-01 13:32:01 +00:00
Byron Hambly
2da6d2363d Merge 4633199cc8 into merged_master (Bitcoin PR bitcoin/bitcoin#22677) 2023-06-01 09:42:34 +00:00
Byron Hambly
2da8f66309 Merge 38b2a0a3f9 into merged_master (Bitcoin PR bitcoin/bitcoin#23173) 2023-05-24 11:45:57 +00:00
TheCharlatan
7d3b35004b
refactor: Move system from util to common library
Since the kernel library no longer depends on the system file, move it
to the common library instead in accordance to the diagram in
doc/design/libraries.md.
2023-05-20 12:08:13 +02:00
glozow
0f8c95dccd
Merge bitcoin/bitcoin#27021: Implement Mini version of BlockAssembler to calculate mining scores
6b605b91c1 [fuzz] Add MiniMiner target + diff fuzz against BlockAssembler (glozow)
3f3f2d59ea [unit test] GatherClusters and MiniMiner unit tests (glozow)
59afcc8354 Implement Mini version of BlockAssembler to calculate mining scores (glozow)
56484f0fdc [mempool] find connected mempool entries with GatherClusters(…) (glozow)

Pull request description:

  Implement Mini version of BlockAssembler to calculate mining scores

  Run the mining algorithm on a subset of the mempool, only disturbing the
  mempool to copy out fee information for relevant entries. Intended to be
  used by wallet to calculate amounts needed for fee-bumping unconfirmed
  transactions.

  From comments of sipa and glozow below:

  > > In what way does the code added here differ from the real block assembly code?
  >
  >    * Only operates on the relevant transactions rather than full mempool
  >    * Has the ability to remove transactions that will be replaced so they don't impact their ancestors
  >    * Does not hold mempool lock outside of the constructor, makes copies of the entries it needs instead (though I'm not sure if this has an effect in practice)
  >    * Doesn't do the sanity checks like keeping weight within max block weight and `IsFinalTx()`
  >    * After the block template is built, additionally calculates fees to bump remaining ancestor packages to target feerate

ACKs for top commit:
  achow101:
    ACK 6b605b91c1
  Xekyo:
    > ACK [6b605b9](6b605b91c1) modulo `miniminer_overlap` test.
  furszy:
    ACK 6b605b91 modulo `miniminer_overlap` test.
  theStack:
    Code-review ACK 6b605b91c1

Tree-SHA512: f86a8b4ae0506858a7b15d90f417ebceea5038b395c05c825e3796123ad3b6cb8a98ebb948521316802a4c6d60ebd7041093356b1e2c2922a06b3b96b3b8acb6
2023-05-19 10:26:19 -04:00
James Dorfman
a63119985d Merge e2b5192d1c into merged_master (Bitcoin PR bitcoin/bitcoin#23211) 2023-05-17 00:31:26 +00:00
James Dorfman
df8f97d63b Merge 1847ce2d49 into merged_master (Bitcoin PR bitcoin/bitcoin#23157) 2023-05-16 09:04:56 +00:00
Byron Hambly
7925c2a451 Merge 224e90d9fd into merged_master (Bitcoin PR bitcoin/bitcoin#23336) 2023-05-15 12:27:08 +00:00
Byron Hambly
8299bec8a2 Merge c001da306b into merged_master (Bitcoin PR bitcoin/bitcoin#23325) 2023-05-14 10:52:15 +00:00
glozow
67b7fecacd [mempool] clear mapDeltas entry if prioritisetransaction sets delta to 0
It's unnecessary to keep the data around, as it doesn't do anything. If
prioritisetransaction is called again, we'll make a new entry in
mapDeltas.

These entries are only deleted when the transaction is mined or conflicted
from a block (i.e. not in replacement or eviction), are persisted in
mempool.dat, and never expire. If node operators use the RPC to
regularly prioritise/de-prioritise transactions, these (meaningless)
map entries may hang around forever and take up valuable mempool memory.
2023-05-10 21:10:44 +01:00
glozow
9e9ca36c80 [mempool] add GetPrioritisedTransactions 2023-05-10 21:10:44 +01:00
Anthony Towns
228e9201ef txmempool: have CompareDepthAndScore sort missing txs first
We use CompareDepthAndScore to choose an order of txs to inv. Rather
than sorting txs that have been evicted from the mempool at the end
of the list, sort them at the beginning so they are removed from
the queue immediately.
2023-05-10 10:51:26 +10:00
Byron Hambly
59c2d9c374 Merge 3120bceeaf into merged_master (Bitcoin PR bitcoin/bitcoin#23054) 2023-04-23 09:06:53 +00:00
James Dorfman
97a63f4efd Merge eb180d807a into merged_master (Bitcoin PR bitcoin/bitcoin#23050) 2023-04-22 02:41:40 +00:00
James Dorfman
7e2135c61c Merge 488e745560 into merged_master (Bitcoin PR bitcoin/bitcoin#12677) 2023-04-22 02:01:59 +00:00
TheCharlatan
be55f545d5
move-only: Extract common/args and common/config.cpp from util/system
This is an extraction of ArgsManager related functions from util/system
into their own common file.

Config file related functions are moved to common/config.cpp.

The background of this commit is an ongoing effort to decouple the
libbitcoinkernel library from the ArgsManager. The ArgsManager belongs
into the common library, since the kernel library should not depend on
it. See doc/design/libraries.md for more information on this rationale.
2023-04-19 10:48:30 +02:00
Byron Hambly
8599606ab3 Merge 21438d55d5 into merged_master (Bitcoin PR bitcoin/bitcoin#21800) 2023-04-09 05:08:13 +00:00
glozow
56484f0fdc
[mempool] find connected mempool entries with GatherClusters(…)
We limit GatherClusters’s result to a maximum of 500 transactions as
clusters can be made arbitrarily large by third parties.

Co-authored-by: Murch <murch@murch.one>
2023-03-27 17:35:12 -04:00