refactor: improve exclusive liquidity request latency - #430
Open
louise-poole wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
louise-poole
force-pushed
the
fix/exclusive-liquidity-request-latency
branch
from
August 17, 2026 09:21
527a1ac to
11fd640
Compare
Troshchk
reviewed
Aug 17, 2026
Troshchk
left a comment
Contributor
There was a problem hiding this comment.
Thank you!
Left a couple of qs
| // Mark all remaining worker pools as timed out | ||
| let elapsed_ms = deadline.saturating_duration_since(Instant::now()) | ||
| .as_millis() as u64; | ||
| let elapsed_ms = start_time.elapsed().as_millis() as u64; |
Comment on lines
+77
to
+81
| Err(SolveError::NotReady(_)) => "not_ready", | ||
| Err(SolveError::Timeout { .. }) => "timeout", | ||
| Err(SolveError::NoRouteFound { .. }) => "no_route", | ||
| Err(SolveError::InsufficientLiquidity { .. }) => "insufficient_liquidity", | ||
| Err(_) => "error", |
Contributor
There was a problem hiding this comment.
why not to use solver_error_label for the error matching?
Is it ok, that we wrap some errors into simple "error" string?
| /// Unlike `worker_pool_solve_duration_seconds`, which a worker reports for its own successful | ||
| /// solves, this covers everything the request actually waits for — queue wait, readiness wait, | ||
| /// and the solve — and is recorded for failures too (`outcome`). The gap between the two is | ||
| /// what a request pays for a worker pool beyond its algorithm's own working time. |
Contributor
There was a problem hiding this comment.
Would it make sense to add that the pools are worker pools?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimisation: Quote ranking narrows candidates by borrow instead of cloning, removing one deep copy of every candidate's route from the request path.
Metrics: Makes the time a request spends waiting on each worker pool visible in metrics:
worker_router_pool_response_seconds(new) — per-pool latency as the router sees it: queue wait, readiness wait and the solve, recorded for failures as well as successes.worker_pool_readiness_wait_seconds(new) — time spent waiting for derived data before solving.worker_pool_solve_duration_seconds— now labelled byoutcome, and recorded for every outcome rather than successes only.🤖 Generated with Claude Code