Skip to content

Conversation

@MartinquaXD
Copy link
Contributor

@MartinquaXD MartinquaXD commented Dec 12, 2025

Description

Currently drivers are required to compute a score for their solution and commit to it. If the scores computed by the driver are different from what the autopilot computes it can result in situations where not enough rewards are paid out from the solver accounting scripts.
Since the autopilot has to compute scores anyway we might as well only use and store those instead of the possibly buggy driver computed scores.

Addresses parts of #3462.

Changes

Given how pressing this situation has become this PR only applies a bandage and foregoes a "proper" refactor of the involved code.

  • removed score from the autopilot /solve response DTO
  • removed driver reported score from the autopilot domain types
  • always read the autopilot computed score when storing proposed solutions in the DB
  • removes score handling and assertions from driver tests

The ugly part is that we first build a Solution and only later have the winner selection logic populate the score. This technically exposes us to the problem where the score gets read before it has been set. However, this does not happen in practice because ranking happens immediately after receiving the solutions and only solutions where a score could be computed get preserved. (see here)

I also opted to still have the reference driver report the computed score as there are quite a few driver integration tests that test subtle scoring related logic. Losing those would be a shame and refactoring those to work without reporting the score in the response is also a ton of work.

This will be followed up with a PR refactoring the code such that the score gets initialized during construction to avoid this 2 phase initialization process.

How to test

existing e2e tests

@MartinquaXD MartinquaXD requested a review from a team as a code owner December 12, 2025 14:20
@MartinquaXD MartinquaXD marked this pull request as draft December 12, 2025 14:23
@MartinquaXD MartinquaXD marked this pull request as ready for review December 12, 2025 15:01

pub fn computed_score(&self) -> Option<&Score> {
self.computed_score.as_ref()
self.score.expect(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really unfortunate and makes the refactor high prio, IMHO.

@MartinquaXD MartinquaXD added this pull request to the merge queue Dec 15, 2025
Merged via the queue into main with commit d202beb Dec 15, 2025
18 checks passed
@MartinquaXD MartinquaXD deleted the only-autopilot-computed-scores branch December 15, 2025 08:19
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants