Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
20 changes: 19 additions & 1 deletion crates/autopilot-svm/src/domain/arbitrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ impl WinnerSelection<SolanaCycle> for SolanaArbitrator {
for winner in inner.winners() {
tracing::info!(solver = %winner.solver(), solution = winner.id(), "winner");
}
Ranking { inner, drivers }
// Ranked before filtered, so winner uids come first.
let uids = inner
.ranked
.iter()
.map(|solution| (solution.solver(), solution.id()))
.chain(
inner
.filtered_out
.iter()
.map(|solution| (solution.solver(), solution.id())),
)
.enumerate()
.map(|(uid, key)| (key, i64::try_from(uid).unwrap_or(i64::MAX)))
.collect();
Comment thread
squadgazzz marked this conversation as resolved.
Outdated
Ranking {
inner,
drivers,
uids,
}
}
}
4 changes: 4 additions & 0 deletions crates/autopilot-svm/src/domain/cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ pub struct Ranking {
pub inner: winner_selection::Ranking<Solana>,
/// Driver index per solution, keyed by `(solver, solution id)`.
pub drivers: HashMap<SolutionKey, usize>,
/// Autopilot-generated solution uid per solution, unique within the
/// auction. It disambiguates solver-assigned ids across drivers, and
/// everything persisted references it.
pub uids: HashMap<SolutionKey, i64>,
}

impl RankingInfo<SolanaCycle> for Ranking {
Expand Down
Loading
Loading