cowprotocol / cowprotocol/services
chore(autopilot): make auction post-processing db operations atomic
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 318
- Forks
- 189
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 121
Description
Background
Currently, the post_processing function on the autopilot performs multiple database saving operations in parallel. While this is good for performance, it opens the door for database inconsistencies in case the autopilot restarts between database operations.
Ideally we would like all the database operations (specially storing the winners and reference scores) to be done atomically.
Details
More in detail, the database operations are in the post_processing function:
save_auction
save_solutions // affects the proposed_solutions table
save_competition // affects the settlement_scores
save_surplus_capturing_jit_order_owner
store_fee_policies
Acceptance criteria
All previously indicated database operations are done atomically. Ideally with minimal performance impact.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the autopilot post_processing function and tracing save_auction, save_solutions, save_competition, save_surplus_capturing_jit_order_owner, and store_fee_policies. Determine how these operations can share an atomic database boundary without significant performance impact. Done means all listed writes commit or fail together, including proposed_solutions and settlement_scores.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100