Skip to content

Stop consuming uniform clearing prices in the autopilot#4370

Draft
jmg-duarte wants to merge 1 commit intomainfrom
jmgd/remove-ucp/2
Draft

Stop consuming uniform clearing prices in the autopilot#4370
jmg-duarte wants to merge 1 commit intomainfrom
jmgd/remove-ucp/2

Conversation

@jmg-duarte
Copy link
Copy Markdown
Contributor

Description

The autopilot no longer uses per-solution uniform clearing prices — scoring uses auction-level native prices and settlement verification reads them from on-chain calldata. Remove UCPs from the autopilot's domain model and DB writes, keeping the wire format intact so the change is safe under a rolling k8s deploy.

Changes

  • Drop prices from the autopilot's domain Solution and SolutionError::InvalidPrice (plus its metric label).
  • Write empty arrays into proposed_solutions.price_tokens / price_values (columns retained; an empty array still satisfies NOT NULL).
  • Add #[serde(default)] to the autopilot's clearing_prices deserializer; log at debug when a driver still sends it.
  • Leave driver-side emission of clearingPrices in place so old autopilots can still parse new driver responses.
  • Mark clearingPrices as deprecated: true in driver and orderbook OpenAPI specs.

A follow-up PR will remove the driver field, the deprecation log, and could drop the now-unused proposed_solutions.price_tokens / price_values columns.

How to test

  1. cargo nextest run -p autopilot -p driver.
  2. solver_competition_v2 for a new auction returns clearingPrices: {}; for a pre-change auction it's still populated.

Scoring uses auction-level native prices and settlement verification
reads prices from on-chain calldata, so per-solution UCPs are dead
weight. Drop them from the autopilot domain `Solution`, the
`SolutionError::InvalidPrice` variant, and the `proposed_solutions`
price columns (now written as empty arrays).

The `/solve` wire format is preserved for rolling-deploy safety:
- autopilot tolerates a missing `clearingPrices` (`#[serde(default)]`)
- our driver still emits it from existing settlement data

`clearingPrices` is marked `deprecated: true` in the driver and
orderbook OpenAPI specs. A follow-up PR will remove the field, the
deprecation log, and the empty DB columns.
@github-actions
Copy link
Copy Markdown

Reminder: Please consider backward compatibility when modifying the API specification.
If breaking changes are unavoidable, ensure:

  • You explicitly pointed out breaking changes.
  • You communicate the changes to affected teams (at least Frontend team and SAFE team).
  • You provide proper versioning and migration mechanisms.

Caused by:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant