clusterlin: update SFL comments for deterministic order
What changed, and why it matters
This commit only changes comments in a single source file. It updates documentation to describe how transaction ordering is chosen when multiple equally-good options exist. No actual code behavior was changed, so it cannot affect security on its own.
No security action needed. Review as ordinary documentation update.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies explanatory comments in src/cluster_linearize.h for the SpanningForestState class. It replaces a description of a randomized tie-breaking strategy with a description of a deterministic tie-breaking strategy (smallest chunk first, then fallback order). The diff contains only comment text changes; no executable logic, data structures, or interfaces were altered.
Changed components
src/cluster_linearize.h (comments only)Inspect captured patch +8 / −4
diff --git a/src/cluster_linearize.h b/src/cluster_linearize.h
index 774bc617..237efd89 100644
--- a/src/cluster_linearize.h
+++ b/src/cluster_linearize.h
@@ -709,10 +709,14 @@ public:
* feerate diagram increases by at least gain/2), while self-merges do not change it.
*
* - How to decide the exact output linearization:
- * - When there are multiple equal-feerate chunks with no dependencies between them, output a
- * uniformly random one among the ones with no missing dependent chunks first.
- * - Within chunks, repeatedly pick a uniformly random transaction among those with no missing
- * dependencies.
+ * - When there are multiple equal-feerate chunks with no dependencies between them, pick the
+ * smallest one first. If there are multiple smallest ones, pick the one that contains the
+ * last transaction (according to the provided fallback order) last (note that this is not the
+ * same as picking the chunk with the first transaction first).
+ * - Within chunks, pick among all transactions without missing dependencies the one with the
+ * highest individual feerate. If there are multiple ones with the same individual feerate,
+ * pick the smallest first. If there are multiple with the same fee and size, pick the one
+ * that sorts first according to the fallback order first.
*/
template<typename SetType, typename CostModel = SFLDefaultCostModel>
class SpanningForestState
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.