Bitcoin Core 28.99.0
P2P Digital Currency
|
Data structure encapsulating the chunking of a linearization, permitting removal of subsets. More...
#include <cluster_linearize.h>
Public Member Functions | |
LinearizationChunking (const DepGraph< SetType > &depgraph LIFETIMEBOUND, Span< const ClusterIndex > lin LIFETIMEBOUND) noexcept | |
Initialize a LinearizationSubset object for a given length of linearization. More... | |
ClusterIndex | NumChunksLeft () const noexcept |
Determine how many chunks remain in the linearization. More... | |
const SetInfo< SetType > & | GetChunk (ClusterIndex n) const noexcept |
Access a chunk. More... | |
void | MarkDone (SetType subset) noexcept |
Remove some subset of transactions from the linearization. More... | |
SetInfo< SetType > | IntersectPrefixes (const SetInfo< SetType > &subset) const noexcept |
Find the shortest intersection between subset and the prefixes of remaining chunks of the linearization that has a feerate not below subset's. More... | |
Private Member Functions | |
void | BuildChunks () noexcept |
Fill the m_chunks variable, and remove the done prefix of m_linearization. More... | |
Private Attributes | |
const DepGraph< SetType > & | m_depgraph |
The depgraph this linearization is for. More... | |
Span< const ClusterIndex > | m_linearization |
The linearization we started from, possibly with removed prefix stripped. More... | |
std::vector< SetInfo< SetType > > | m_chunks |
Chunk sets and their feerates, of what remains of the linearization. More... | |
ClusterIndex | m_chunks_skip {0} |
How large a prefix of m_chunks corresponds to removed transactions. More... | |
SetType | m_todo |
Which transactions remain in the linearization. More... | |
Data structure encapsulating the chunking of a linearization, permitting removal of subsets.
Definition at line 393 of file cluster_linearize.h.
|
inlineexplicitnoexcept |
Initialize a LinearizationSubset object for a given length of linearization.
Definition at line 440 of file cluster_linearize.h.
|
inlineprivatenoexcept |
Fill the m_chunks variable, and remove the done prefix of m_linearization.
Definition at line 411 of file cluster_linearize.h.
|
inlinenoexcept |
Access a chunk.
Chunk 0 is the highest-feerate prefix of what remains.
Definition at line 454 of file cluster_linearize.h.
|
inlinenoexcept |
Find the shortest intersection between subset and the prefixes of remaining chunks of the linearization that has a feerate not below subset's.
This is a crucial operation in guaranteeing improvements to linearizations. If subset has a feerate not below GetChunk(0)'s, then moving IntersectPrefixes(subset) to the front of (what remains of) the linearization is guaranteed not to make it worse at any point.
See https://delvingbitcoin.org/t/introduction-to-cluster-linearization/1032 for background.
Definition at line 492 of file cluster_linearize.h.
|
inlinenoexcept |
Remove some subset of transactions from the linearization.
Definition at line 461 of file cluster_linearize.h.
|
inlinenoexcept |
Determine how many chunks remain in the linearization.
Definition at line 451 of file cluster_linearize.h.
|
private |
Chunk sets and their feerates, of what remains of the linearization.
Definition at line 402 of file cluster_linearize.h.
|
private |
How large a prefix of m_chunks corresponds to removed transactions.
Definition at line 405 of file cluster_linearize.h.
|
private |
The depgraph this linearization is for.
Definition at line 396 of file cluster_linearize.h.
|
private |
The linearization we started from, possibly with removed prefix stripped.
Definition at line 399 of file cluster_linearize.h.
|
private |
Which transactions remain in the linearization.
Definition at line 408 of file cluster_linearize.h.