Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemini 3f backport: Fix for solution sorting by quality #2041

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions crates/subspace-farmer-components/src/auditing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ where
return None;
}

winning_audit_chunks.sort_by(|a, b| {
// Comparing `b` to `a` because we want smaller values first
b.solution_distance.cmp(&a.solution_distance)
});
winning_audit_chunks.sort_by(|a, b| a.solution_distance.cmp(&b.solution_distance));

Some(ChunkCandidate {
chunk_offset: chunk_offset as u32,
Expand All @@ -135,8 +132,7 @@ where
.expect("Lists of audit chunks are non-empty; qed")
.solution_distance;

// Comparing `b` to `a` because we want smaller values first
b_solution_distance.cmp(&a_solution_distance)
a_solution_distance.cmp(&b_solution_distance)
});

let best_solution_distance = winning_chunks
Expand Down
3 changes: 1 addition & 2 deletions crates/subspace-farmer/src/single_disk_farm/farming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ where
let b_solution_distance =
b.1.best_solution_distance().unwrap_or(SolutionRange::MAX);

// Comparing `b` to `a` because we want smaller values first
b_solution_distance.cmp(&a_solution_distance)
a_solution_distance.cmp(&b_solution_distance)
});

let mut solutions = Vec::<Solution<PublicKey, PublicKey>>::new();
Expand Down
Loading