clusterlin: avoid depgraph argument in SanityCheck (cleanup)

Since the deterministic ordering change, SpanningForestState holds a
reference to the DepGraph it is linearizing. So this means we do not
need to pass it to SanityCheck() as an argument anymore.
This commit is contained in:
Pieter Wuille committed 2026-02-17 09:04:36 -05:00
1 parent 666b37970f
commit 900e459778
2 files changed
+10 -10

No files matched your search

+9 -9
View File
@@ -1440,7 +1440,7 @@ public:
uint64_t GetCost() const noexcept { return m_cost; } uint64_t GetCost() const noexcept { return m_cost; }
/** Verify internal consistency of the data structure. */ /** Verify internal consistency of the data structure. */
void SanityCheck(const DepGraph<SetType>& depgraph) const void SanityCheck() const
{ {
// //
// Verify dependency parent/child information, and build list of (active) dependencies. // Verify dependency parent/child information, and build list of (active) dependencies.
@@ -1448,8 +1448,8 @@ public:
std::vector<std::pair<TxIdx, TxIdx>> expected_dependencies; std::vector<std::pair<TxIdx, TxIdx>> expected_dependencies;
std::vector<std::tuple<TxIdx, TxIdx, DepIdx>> all_dependencies; std::vector<std::tuple<TxIdx, TxIdx, DepIdx>> all_dependencies;
std::vector<std::tuple<TxIdx, TxIdx, DepIdx>> active_dependencies; std::vector<std::tuple<TxIdx, TxIdx, DepIdx>> active_dependencies;
for (auto parent_idx : depgraph.Positions()) { for (auto parent_idx : m_depgraph.Positions()) {
for (auto child_idx : depgraph.GetReducedChildren(parent_idx)) { for (auto child_idx : m_depgraph.GetReducedChildren(parent_idx)) {
expected_dependencies.emplace_back(parent_idx, child_idx); expected_dependencies.emplace_back(parent_idx, child_idx);
} }
} }
@@ -1473,7 +1473,7 @@ public:
// //
// Verify the chunks against the list of active dependencies // Verify the chunks against the list of active dependencies
// //
for (auto tx_idx: depgraph.Positions()) { for (auto tx_idx: m_depgraph.Positions()) {
// Only process chunks for now. // Only process chunks for now.
if (m_tx_data[tx_idx].chunk_rep == tx_idx) { if (m_tx_data[tx_idx].chunk_rep == tx_idx) {
const auto& chunk_data = m_tx_data[tx_idx]; const auto& chunk_data = m_tx_data[tx_idx];
@@ -1505,14 +1505,14 @@ public:
assert(chunk_data.chunk_setinfo.transactions == expected_chunk); assert(chunk_data.chunk_setinfo.transactions == expected_chunk);
// Verify the chunk's feerate. // Verify the chunk's feerate.
assert(chunk_data.chunk_setinfo.feerate == assert(chunk_data.chunk_setinfo.feerate ==
depgraph.FeeRate(chunk_data.chunk_setinfo.transactions)); m_depgraph.FeeRate(chunk_data.chunk_setinfo.transactions));
} }
} }
// //
// Verify other transaction data. // Verify other transaction data.
// //
assert(m_transaction_idxs == depgraph.Positions()); assert(m_transaction_idxs == m_depgraph.Positions());
for (auto tx_idx : m_transaction_idxs) { for (auto tx_idx : m_transaction_idxs) {
const auto& tx_data = m_tx_data[tx_idx]; const auto& tx_data = m_tx_data[tx_idx];
// Verify it has a valid chunk representative, and that chunk includes this // Verify it has a valid chunk representative, and that chunk includes this
@@ -1520,8 +1520,8 @@ public:
assert(m_tx_data[tx_data.chunk_rep].chunk_rep == tx_data.chunk_rep); assert(m_tx_data[tx_data.chunk_rep].chunk_rep == tx_data.chunk_rep);
assert(m_tx_data[tx_data.chunk_rep].chunk_setinfo.transactions[tx_idx]); assert(m_tx_data[tx_data.chunk_rep].chunk_setinfo.transactions[tx_idx]);
// Verify parents/children. // Verify parents/children.
assert(tx_data.parents == depgraph.GetReducedParents(tx_idx)); assert(tx_data.parents == m_depgraph.GetReducedParents(tx_idx));
assert(tx_data.children == depgraph.GetReducedChildren(tx_idx)); assert(tx_data.children == m_depgraph.GetReducedChildren(tx_idx));
// Verify list of child dependencies. // Verify list of child dependencies.
std::vector<DepIdx> expected_child_deps; std::vector<DepIdx> expected_child_deps;
for (const auto& [par_idx, chl_idx, dep_idx] : all_dependencies) { for (const auto& [par_idx, chl_idx, dep_idx] : all_dependencies) {
@@ -1559,7 +1559,7 @@ public:
assert(dep_data.top_setinfo.transactions == expected_top); assert(dep_data.top_setinfo.transactions == expected_top);
// Verify the top_info's feerate. // Verify the top_info's feerate.
assert(dep_data.top_setinfo.feerate == assert(dep_data.top_setinfo.feerate ==
depgraph.FeeRate(dep_data.top_setinfo.transactions)); m_depgraph.FeeRate(dep_data.top_setinfo.transactions));
} }
// //
+1 -1
View File
@@ -919,7 +919,7 @@ FUZZ_TARGET(clusterlin_sfl)
if (rng.randbits(4) == 0) { if (rng.randbits(4) == 0) {
// Perform sanity checks from time to time (too computationally expensive to do after // Perform sanity checks from time to time (too computationally expensive to do after
// every step). // every step).
sfl.SanityCheck(depgraph); sfl.SanityCheck();
} }
auto diagram = sfl.GetDiagram(); auto diagram = sfl.GetDiagram();
if (rng.randbits(4) == 0) { if (rng.randbits(4) == 0) {