#324 Phase 3 — concurrent candidate solve + cache-key robustness #809
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!809
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-08a1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements GitLab #324 (Phase 3 of #279):
solve_global_best_executionfans out per-pathoptimize + maybe_simulateunderSOLVE_CONCURRENCY(=MAX_PATH_CANDIDATES= 5) usingtokio::task::JoinSet(no newfuturescrate). Fail-fast on first candidate error; deterministic first-seen tie-break merge matches the prior serial loop.hybrid_cache_keybucketsmax_maker_fillsviacache_key_maker_fills(retail 1–8 → 8), drops raw trader address (relies ondiscount_bpsper #283). Bumpssolver_versiontoglobal_v3(LCD) /global_v4(DB) to invalidate stale cache entries.search_truncatedonBestExecutionMeta/ response +hybrid_noteswarning when concurrency cap < enumerated candidates.Acceptance checklist
cd indexer && cargo test concurrent_fanout_latency --libcd indexer && cargo test merge_ --libcd indexer && cargo test merge_ --libmax_maker_fills7/8 share cache keycd indexer && cargo test hybrid_cache_key_maker_fills --libcd indexer && cargo test hybrid_cache_key_distinguishes_discount_bps --libcd indexer && cargo test hybrid_notes_warn_when_search_truncated --libcd indexer && cargo test concurrent_eval_fail_fast --libfuturescrate addedcargo testlib + cache-key greencd indexer && cargo test --lib(127 passed)api_route_solveindexer/.env); not run in Cloud Agent VMmake lint/ docs driftpython3 scripts/check_route_solver_docs.pyVerification for third parties
Issue left open until merge.
changed the description
changed the description
mentioned in issue #324
changed the description
added 3 commits
main864e072e- feat(indexer): concurrent candidate solve + cache-key robustness (#324)Compare with previous version
changed the description
changed the description
Security review
Commit reviewed:
864e072ec1f931020b7b089006a17978946f16b5Scope:
indexer/src/api/best_execution.rs(concurrentJoinSetcandidate eval, merge parity),indexer/src/api/route_solver.rs(hybrid_cache_key/cache_key_maker_fills,resolve_discount_bps, solver version bump), responsesearch_truncatedfield, docs/tests.Outcome:
FINDINGS: 0medium+Summary
Reviewed attacker-controlled inputs (
token_in,token_out,amount_in,trader/sender,max_maker_fills) through the hybrid GET cache path and concurrent solve pipeline.SOLVE_CONCURRENCY(=MAX_PATH_CANDIDATES= 5) per request;JoinSetuses read-only shared state (Arc<AppState>,Arc<HashMap>mirrors). Fail-fast aborts remaining tasks on first candidate error. No unbounded task spawn or cross-request shared mutable state observed.discount_bps(on-chainGetDiscountwhen configured, elsetier_discount_bpsfrom synced tier). Cross-tier collision is covered by unit tests and existing integration tests (route_solve_get_cache_tier_isolation,route_solve_get_cache_same_tier_reuses_lcd).max_maker_fillsbucketing (1–8 → 8) can only serve a quote computed with equal or higher fill budget — suboptimal for some callers, not an exploitable over-quote path. Solver version bump (global_v3/global_v4) invalidates stale entries.trader/sendervalidated asterra1addresses; LCD 502 bodies stay sanitized; existing LCD-heavy rate limits (10 RPS/IP) still apply. No new SSRF, deserialization, or secret-logging surfaces in this diff.Inline threads: none (no medium+ findings).
Automated security review (Cursor Cloud Agent)
Security review
Commit reviewed:
864e072ec1f931020b7b089006a17978946f16b5Scope: MR !809 — concurrent path-candidate evaluation (
JoinSet/SOLVE_CONCURRENCY), hybrid GET cache-key changes (cache_key_maker_fills, trader dropped from key,solver_versionbump toglobal_v3/global_v4),search_truncatedresponse metadata, docs/tests.Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
Areas examined
hybrid_cache_keynow keys ondiscount_bps+ bucketedmax_maker_fills; trader address removed. Tracedresolve_discount_bps→ on-chainGetDiscount(trusted-routertrader/senderrules) and DBtier_discount_bpsfallback. Cross-tier collision is prevented by distinctdiscount_bpsin the key; same-tier sharing is intentional (#283). Existing integration coverage:route_solve_get_cache_tier_isolation,route_solve_get_cache_same_tier_reuses_lcd. No plausible path for one caller to obtain another wallet's discounted quote via cache poisoning.SOLVE_CONCURRENCY=MAX_PATH_CANDIDATES= 5); fail-fast on first candidate error withabort_all. SharedArc<AppState>/ read-only mirror map — no authz bypass or data races identified. Per-request LCD query budget unchanged vs the prior serial loop; burst parallelism is bounded and mitigated by existing per-IP LCD-heavy rate limiting (rate_limit_lcd_heavy_rps, default 10 RPS).terra1address validation unchanged; no secret leakage or unsafe logging in the diff.Inline threads: none (no medium+ findings).
mentioned in commit
04d38a98d8mentioned in issue #335
mentioned in merge request !818
mentioned in commit
bbe9ae1f3e