Skip to content

solana-driver: Autopilot interface - #4759

Merged
tilacog merged 19 commits into
mainfrom
solana-driver-autopilot-handler
Aug 20, 2026
Merged

solana-driver: Autopilot interface#4759
tilacog merged 19 commits into
mainfrom
solana-driver-autopilot-handler

Conversation

@tilacog

@tilacog tilacog commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

Introduces the HTTP interface for receiving /solve and /settle requests from the autopilot.

The /settle endpoint is a stub for now because the actual settlement logic will be presented in a follow-up PR, but all the other aspects of it's API are in place.

@squadgazzz: This PR diff ended up a bit bigger than I expected. Please let me know if you prefer me to split it into smaller ones. (I'm taking care this doesn't repeat for the follow-up PRs)

Changes

  • crates/autopilot-svm: SolveRequest, Solution, SettleRequest now serialize integer ids as decimal strings, given u64 can't fit in a JSON number.
  • Updated domain types:
    • Competition (new type, holds a list of Solvers and orchestrates solve calls among them.
    • Auction: its id field, rejects non-positive values
    • Order restructured fields to match what we get from the autopilot.
  • implemented api routing for solve and settle.
    • Also defined api-specific Error and error::Kind for invalid data (auction ids, solver failures, etc)

How to test

cargo test -p solana-driver

New TODOs

These are the new TODO comments introduced by this PR.
We're shipping a basic version of the solana-driver first and will optimize these areas later.

  • In competition.rs, the work fan-out is very simple/naive and there's no solution cache.
  • The autopilot sends a deadline_slot that the driver needs to resolve into an actual timestamp, but for now this PR just uses a hardcoded 15s deadline for every auction. (The deadline_slot field is included in the DTO, just not enforced.)
  • The solana-solver engine doesn't yet report the counterpart (buy/sell) amount, so the driver stubs the score and counterpart amount to 0.

@tilacog tilacog changed the title Solana driver autopilot handler solana-driver: Autopilot interface Aug 19, 2026
@tilacog
tilacog marked this pull request as ready for review August 20, 2026 00:12
@tilacog
tilacog requested a review from a team as a code owner August 20, 2026 00:12
@claude

claude Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Claude finished @tilacog's task in 2m 43s —— View job


PR Review: solana-driver Autopilot interface

Solid, well-documented PR — the mirrored DTOs with pinned-literal tests against autopilot-svm are a nice way to keep the two crates in sync, and the acknowledged TODOs (naive fan-out, hardcoded 15s deadline, stubbed score/counterpart amount) are clearly scoped. I confirmed the .expect() in solve_response.rs is safe by construction since Solution::into_domain rejects unknown order UIDs. A few points worth a change, posted inline:

  • SolverFailed → HTTP 400 (error.rs): all-engines-failed is an internal driver failure, not a bad request; should be 500.
  • /settle now panics (settle/mod.rs): a reachable HTTP path aborting the connection is worse than the previous clean 501.
  • Id(pub i64) (auction.rs): public field bypasses the positivity invariant (minor).

Nothing blocking beyond those; the first two are quick fixes.

  • Read PR diff and changed files
  • Analyze domain, api, dto changes
  • Post inline comments for issues
  • Post summary

Comment thread crates/solana-driver/src/infra/api/error.rs
Comment thread crates/solana-driver/src/infra/api/routes/settle/mod.rs
Comment thread crates/solana-driver/src/domain/auction.rs Outdated
Comment thread crates/solana-driver/src/infra/api/routes/settle/mod.rs Outdated
Comment thread crates/solana-driver/src/domain/auction.rs Outdated
Comment thread crates/solana-driver/src/infra/api/routes/solve/dto/solve_response.rs Outdated
Comment thread crates/solana-driver/src/domain/slot.rs
Comment thread crates/solana-driver/src/domain/competition.rs
Comment thread crates/solana-driver/src/infra/api/routes/solve/dto/solve_response.rs Outdated
Comment thread crates/solana-driver/src/infra/api/routes/solve/dto/solve_request.rs Outdated

@squadgazzz squadgazzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

this makes solve_response fn infallible, because we drop any
invalid values during DTO validation.
@tilacog
tilacog added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit c1b3e25 Aug 20, 2026
23 checks passed
@tilacog
tilacog deleted the solana-driver-autopilot-handler branch August 20, 2026 20:25
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 20, 2026
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.

2 participants