Skip to content

delta-sync#4283

Closed
ashleychandy wants to merge 0 commit intocowprotocol:mainfrom
ashleychandy:auction-delta-sync
Closed

delta-sync#4283
ashleychandy wants to merge 0 commit intocowprotocol:mainfrom
ashleychandy:auction-delta-sync

Conversation

@ashleychandy
Copy link
Copy Markdown
Contributor

Description

Implements auction delta sync to reduce solver payload size by sending incremental updates instead of full orderbook snapshots. This lays the foundation for Unified Auction by introducing structured change events and a driver-side replica that can consume deltas while still serving full auctions to solvers.

Changes

  • Refactor solvable orders caching to emit structured change events used internally by autopilot.
  • Add delta-sync infrastructure and replica logic in the driver, plus metrics and health/readiness tweaks.
  • Extend solver/driver DTOs and headers to support delta sync protocol versions.
  • Add delta-sync e2e coverage and integration wiring.

How to test

  1. cargo nextest run -p e2e local_node_delta_sync_update_pipeline_integration --run-ignored ignored-only --test-threads 1 --failure-output final

Fixes #4207

@ashleychandy ashleychandy requested a review from a team as a code owner March 22, 2026 00:45
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a delta-sync mechanism to reduce payload sizes for solver auctions. The changes are extensive, adding new API endpoints for snapshots and streaming updates, a driver-side replica for auction data, and extending DTOs to support the new protocol. The implementation appears robust, with considerations for security, performance, and resilience. I've found one high-severity logic issue in the fallback handling for thin requests when the replica is unavailable.

Comment on lines +299 to +301
if let Ok(from_body) = parse_full_solve_request(body.clone()).await {
from_body
} else {
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.

high

When body_mode is Thin and the replica is not ready, the current logic incorrectly handles correctly-formed thin requests.

A thin request body (with an empty orders array) will cause parse_full_solve_request to succeed. The code then proceeds with this empty auction, bypassing the else block which contains the necessary logic to use the replica (with retries/bootstrap). This leads to missed solving opportunities.

To fix this, you should check if from_body.orders is empty after parsing. If it is, you should proceed to the replica-handling logic in the else block instead of returning the empty auction.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2026
@ashleychandy ashleychandy deleted the auction-delta-sync branch March 22, 2026 01:25
@ashleychandy ashleychandy restored the auction-delta-sync branch March 22, 2026 01:39
@ashleychandy ashleychandy deleted the auction-delta-sync branch March 29, 2026 20:37
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.

tracker: Auction delta sync

1 participant