bitcoin/src/util
glozow 489e5aa3a2
Merge bitcoin/bitcoin#30857: cluster mempool: extend DepGraph functionality
0b3ec8c59b clusterlin: remove Cluster type (Pieter Wuille)
1c24c62510 clusterlin: merge two DepGraph fuzz tests into simulation test (Pieter Wuille)
0606e66fdb clusterlin: add DepGraph::RemoveTransactions and support for holes in DepGraph (Pieter Wuille)
75b5d42419 clusterlin: make DepGraph::AddDependency support multiple dependencies at once (Pieter Wuille)
abf50649d1 clusterlin: simplify DepGraphFormatter::Ser (Pieter Wuille)
eaab55ffc8 clusterlin: rework DepGraphFormatter::Unser (Pieter Wuille)
5901cf7100 clusterlin: abstract out DepGraph::GetReduced{Parents,Children} (Pieter Wuille)

Pull request description:

  Part of cluster mempool: #30289

  This adds:
  * `DepGraph::AddDependencies` to add 0 or more dependencies to a single transaction at once (identical to calling `DepGraph::AddDependency` once for each, but more efficient).
  * `DepGraph::RemoveTransactions` to remove 0 or more transactions from a depgraph.
  * `DepGraph::GetReducedParents` (and `DepGraph::GetReducedChildren`) to get the (reduced) direct parents and children of a transaction in a depgraph.

  After which, the `Cluster` type is removed.

  This is the result of fleshing out the design for the "intermediate layer" ("TxGraph", no PR yet) between the cluster linearization layer and the mempool layer. My earlier thinking was that TxGraph would store `Cluster` objects (vectors of pairs of `FeeFrac`s and sets of parents), and convert them to `DepGraph` on the fly whenever needed. However, after more consideration, it seems better to have TxGraph store `DepGraph` objects, and manipulate them directly without constantly re-creating them. This requires `DepGraph` to have some additional functionality.

  The bulk of the complexity here is the addition of `DepGraph::RemoveTransactions`, which leaves the remaining transactions' positions within the `DepGraph` untouched (we want existing identifiers to remain valid), so this implies that graphs can now have "holes" (positions that are unused, but followed by positions that are used). To enable that, an extension of the fuzz/test serialization format `DepGraphFormatter` is included to deal with such holes.

ACKs for top commit:
  sdaftuar:
    reACK 0b3ec8c59b
  instagibbs:
    reACK 0b3ec8c59b
  ismaelsadeeq:
    reACK 0b3ec8c59b
  glozow:
    ACK 0b3ec8c59b, reviewed range-diff from  aab53ddcd8fcbc3c0be0da9383f8e06abe5badda and `clusterlin_depgraph_sim`

Tree-SHA512: a804b7f26d544c5cb0847322e235c810525cb0607737be6116c3156d582da3ba3352af8ea48e74eed5268f9c3eca63b30181d01b23a6dd0be1b99191f81cceb0
2024-10-10 10:40:44 -04:00
..
any.h
asmap.cpp streams: cache file position within AutoFile 2024-09-13 07:35:41 -04:00
asmap.h
batchpriority.cpp
batchpriority.h
bip32.cpp
bip32.h
bitdeque.h refactor: Fix "error C2248: cannot access private member" on MSVC 2024-04-28 07:11:24 +01:00
bitset.h util: add BitSet 2024-06-10 07:54:48 -04:00
bytevectorhash.cpp random: get rid of GetRand by inlining 2024-07-01 12:39:53 -04:00
bytevectorhash.h
chaintype.cpp testnet: Introduce Testnet4 2024-08-06 01:38:10 +02:00
chaintype.h testnet: Introduce Testnet4 2024-08-06 01:38:10 +02:00
check.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
check.h clusterlin: add DepGraph::RemoveTransactions and support for holes in DepGraph 2024-10-07 13:49:35 -04:00
CMakeLists.txt common: move pcp.cpp and netif.cpp files from util to common library since they depend on netaddress.cpp 2024-10-01 09:28:31 -04:00
epochguard.h
exception.cpp
exception.h
fastrange.h
feefrac.cpp Avoid explicitly computing diagram; compare based on chunks 2024-04-22 09:36:36 -04:00
feefrac.h clusterlin: add DepGraph::RemoveTransactions and support for holes in DepGraph 2024-10-07 13:49:35 -04:00
fs.cpp Add tests for C++20 std::u8string 2023-12-11 17:42:05 +01:00
fs.h refactor: Rename fs::path::u8string() to fs::path::utf8string() 2023-12-14 16:22:40 +01:00
fs_helpers.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
fs_helpers.h util: add perm string helper functions 2024-06-27 14:55:10 +01:00
golombrice.h
hash_type.h
hasher.cpp random: get rid of GetRand by inlining 2024-07-01 12:39:53 -04:00
hasher.h Bump g++ minimum supported version to 10 2023-10-30 15:12:26 +01:00
insert.h
macros.h
moneystr.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
moneystr.h
overflow.h
overloaded.h doc: Clarify C++20 comments 2024-01-05 11:22:31 +01:00
rbf.cpp
rbf.h
readwritefile.cpp
readwritefile.h
result.h refactor: Avoid copying util::Result values 2024-04-25 16:08:24 -04:00
serfloat.cpp
serfloat.h
signalinterrupt.cpp util: Get rid of uncaught exceptions thrown by SignalInterrupt class 2023-12-04 15:39:15 -04:00
signalinterrupt.h util: Get rid of uncaught exceptions thrown by SignalInterrupt class 2023-12-04 15:39:15 -04:00
sock.cpp sock: change Sock::SendComplete() to take Span 2023-10-31 18:19:22 +01:00
sock.h sock: change Sock::SendComplete() to take Span 2023-10-31 18:19:22 +01:00
strencodings.cpp util: remove unused IsHexNumber 2024-08-23 13:53:40 +01:00
strencodings.h util: Add consteval ""_hex[_v][_u8] literals 2024-08-28 19:09:51 +02:00
string.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
string.h util: Use compile-time check for FatalErrorf 2024-09-12 15:01:20 +02:00
subprocess.h tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00
syserror.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
syserror.h Show descriptive error messages when FileCommit fails 2023-06-30 09:48:21 -04:00
task_runner.h tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00
thread.cpp
thread.h
threadinterrupt.cpp
threadinterrupt.h util: Add SignalInterrupt class and use in shutdown.cpp 2023-06-28 09:49:28 +02:00
threadnames.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
threadnames.h util: avoid using thread_local variable that has a destructor 2024-05-16 18:16:46 +02:00
time.cpp refactor: Use chrono type for g_mock_time 2024-04-15 13:34:31 +02:00
time.h Revert "time: add runtime sanity check" 2024-03-18 16:01:08 +01:00
tokenpipe.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
tokenpipe.h
trace.h scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
transaction_identifier.h refactor: remove TxidFromString 2024-07-31 16:47:39 +01:00
translation.h util: Catch translation string errors at compile time 2024-07-10 09:40:47 +02:00
types.h doc: Clarify C++20 comments 2024-01-05 11:22:31 +01:00
ui_change_type.h
vecdeque.h utils: add missing include 2024-06-11 16:28:11 +00:00
vector.h chainparams: add blockhash to AssumeutxoData 2023-09-30 06:38:47 -04:00