Find or improve a linearization for a cluster.
Declared in <cluster_linearize.h>
template<typename SetType>
std::tuple<std::vector<DepGraphIndex>, bool, uint64_t>
Linearize(
DepGraph<SetType> const& depgraph,
uint64_t max_cost,
uint64_t rng_seed,
auto const& fallback_order,
std::span<DepGraphIndex const> old_linearization = {},
bool is_topological = true) noexcept;
A tuple of: - The resulting linearization. It is guaranteed to be at least as good (in the feerate diagram sense) as old_linearization. - A boolean indicating whether the result is guaranteed to be optimal with minimal chunks. - How many optimization steps were actually performed.
| Name | Description |
|---|---|
| depgraph [in] | Dependency graph of the cluster to be linearized. |
| max_cost [in] | Upper bound on the amount of work that will be done. |
| rng_seed [in] | A random number seed to control search order. This prevents peers from predicting exactly which clusters would be hard for us to linearize. |
| fallback_order [in] | A comparator to order transactions, used to sort equal-feerate chunks and transactions. See SpanningForestState::GetLinearization for details. |
| old_linearization [in] | An existing linearization for the cluster, or empty. |
| is_topological [in] | (Only relevant if old_linearization is not empty) Whether old_linearization is topologically valid. |