Skip to content

Commit eabcd0e

Browse files
instagibbssipa
authored andcommitted
txgraph: remove unnecessary m_group_oversized (simplification)
1 parent 19b14e6 commit eabcd0e

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/txgraph.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,6 @@ class TxGraphImpl final : public TxGraph
231231
std::vector<GroupEntry> m_groups;
232232
/** Which clusters are to be merged. GroupEntry::m_cluster_offset indexes into this. */
233233
std::vector<Cluster*> m_group_clusters;
234-
/** Whether at least one of the groups cannot be applied because it would result in a
235-
* Cluster that violates the max cluster count or size limit. */
236-
bool m_group_oversized;
237234
};
238235

239236
/** The collection of all Clusters in main or staged. */
@@ -257,9 +254,7 @@ class TxGraphImpl final : public TxGraph
257254
GraphIndex m_txcount{0};
258255
/** Total number of individually oversized transactions in the graph. */
259256
GraphIndex m_txcount_oversized{0};
260-
/** Whether this graph is oversized (if known). This roughly matches
261-
* m_group_data->m_group_oversized || (m_txcount_oversized > 0), but may be known even if
262-
* m_group_data is not. */
257+
/** Whether this graph is oversized (if known). */
263258
std::optional<bool> m_oversized{false};
264259

265260
ClusterSet() noexcept = default;
@@ -1463,9 +1458,9 @@ void TxGraphImpl::GroupClusters(int level) noexcept
14631458
// back to m_deps_to_add.
14641459
clusterset.m_group_data = GroupData{};
14651460
clusterset.m_group_data->m_group_clusters.reserve(an_clusters.size());
1466-
clusterset.m_group_data->m_group_oversized = false;
14671461
clusterset.m_deps_to_add.clear();
14681462
clusterset.m_deps_to_add.reserve(an_deps.size());
1463+
clusterset.m_oversized = false;
14691464
auto an_deps_it = an_deps.begin();
14701465
auto an_clusters_it = an_clusters.begin();
14711466
while (an_clusters_it != an_clusters.end()) {
@@ -1495,12 +1490,11 @@ void TxGraphImpl::GroupClusters(int level) noexcept
14951490
}
14961491
// Detect oversizedness.
14971492
if (total_count > m_max_cluster_count || total_size > m_max_cluster_size) {
1498-
clusterset.m_group_data->m_group_oversized = true;
1493+
clusterset.m_oversized = true;
14991494
}
15001495
}
15011496
Assume(an_deps_it == an_deps.end());
15021497
Assume(an_clusters_it == an_clusters.end());
1503-
clusterset.m_oversized = clusterset.m_group_data->m_group_oversized;
15041498
Compact();
15051499
}
15061500

@@ -2366,13 +2360,6 @@ void TxGraphImpl::SanityCheck() const
23662360
if (!clusterset.m_to_remove.empty()) compact_possible = false;
23672361
if (!clusterset.m_removed.empty()) compact_possible = false;
23682362

2369-
// If m_group_data exists, and no outstanding removals remain, m_group_oversized must match
2370-
// m_group_oversized || (m_txcount_oversized > 0).
2371-
if (clusterset.m_group_data.has_value() && clusterset.m_to_remove.empty()) {
2372-
assert(clusterset.m_oversized ==
2373-
(clusterset.m_group_data->m_group_oversized || (clusterset.m_txcount_oversized > 0)));
2374-
}
2375-
23762363
// For non-top levels, m_oversized must be known (as it cannot change until the level
23772364
// on top is gone).
23782365
if (level < GetTopLevel()) assert(clusterset.m_oversized.has_value());

0 commit comments

Comments
 (0)