From b95a5c9c403d1e92b7fb5964edaf8df2b1f964c0 Mon Sep 17 00:00:00 2001
From: Bradley Olson <34992650+BradleyOlson64@users.noreply.github.com>
Date: Mon, 26 Dec 2022 11:50:18 -0800
Subject: [PATCH] Added comment describing satisfied invariant (#6460)

---
 .../provisioner/src/disputes/prioritized_selection/mod.rs     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/polkadot/node/core/provisioner/src/disputes/prioritized_selection/mod.rs b/polkadot/node/core/provisioner/src/disputes/prioritized_selection/mod.rs
index 8ac582bb1cc..7d8e52ccf19 100644
--- a/polkadot/node/core/provisioner/src/disputes/prioritized_selection/mod.rs
+++ b/polkadot/node/core/provisioner/src/disputes/prioritized_selection/mod.rs
@@ -218,7 +218,9 @@ where
 		for (session_index, candidate_hash, selected_votes) in votes {
 			let votes_len = selected_votes.valid.raw().len() + selected_votes.invalid.len();
 			if votes_len + total_votes_len > MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME {
-				// we are done - no more votes can be added
+				// we are done - no more votes can be added. Importantly, we don't add any votes for a dispute here
+				// if we can't fit them all. This gives us an important invariant, that backing votes for
+				// disputes make it into the provisioned vote set.
 				return result
 			}
 			result.insert((session_index, candidate_hash), selected_votes);
-- 
GitLab