Phase 2 — raise GET_DEFAULT_MAX_HOPS 3→4 for hybrid GET (#323) #796
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!796
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-7eef"
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
Closes #323.
Raises
GET_DEFAULT_MAX_HOPSfrom 3 to 4 so the default hybrid GET best-execution solver discovers and prices 4-hop routes, matchingGET_POOL_ONLY_MAX_HOPS, the POST BFS cap, and the on-chain routerMAX_HOPS = 4.Changes
GET_DEFAULT_MAX_HOPS = 4inroute_solver.rs(module doc + OpenAPI comments updated)LCD_HYBRID_SIM_BUDGETre-derived to 1700 (5 × 4 × 85); comment notes DB-backed pricing post-#319; unit test pins exact magnituderoute_paths.rs: 4-hop-only linear graph test + unreachable-goal instrumented test atmax_hops = 4api_route_solve.rs: default GET hybrid quote over seeded 4-hop chain (seed_route_solve_4hop)route-solver.md,integrators.md,indexer-invariants.md;check_route_solver_docs.pyexpects 1700No change to
hybrid_cache_keyshape or discount-tier keying (#283).Acceptance checklist
GET_DEFAULT_MAX_HOPS = 4; module doc updatedgrep GET_DEFAULT_MAX_HOPS indexer/src/api/route_solver.rsroute_solve_get_default_hybrid_four_hopsinapi_route_solve.rsLCD_HYBRID_SIM_BUDGET = 1700; budget test pins valuecargo test --lib lcd_budget_is_documented_constantfind_paths_top_kreachability at max_hops=4 unchangedfour_hop_only_route_within_budget_is_found,unreachable_goal_at_four_hops_does_zero_enumerationhybrid_cache_key/ tier keying changecargo test --lib route_paths::tests;cargo test -p indexer routewith PostgresVerification for third parties
Blockers
db_orderbook_sim) so the 4th hop is DB-priced, not LCD-backed. #319 is not yet onmain; merge this MR only after #319 lands to avoid extra LCD load per hybrid GET.api_route_solve.rs) require PostgreSQL; not run on this Cloud Agent VM (no dockerd/Postgres).changed the description
changed the description
mentioned in issue #323
changed the description
Security review
Commit reviewed:
0bc6390cecc9b1f7f5f2522cf26b7b8d06886f9aScope:
GET_DEFAULT_MAX_HOPS3→4,LCD_HYBRID_SIM_BUDGET1275→1700, path-enumeration unit tests, 4-hop hybrid GET integration test, docs/drift-checker updates.Outcome:
FINDINGS: 0medium+Review summary
Reviewed attacker-controlled inputs on
GET|POST /api/v1/route/solveand/best(token_in,token_out,amount_in, optionaltrader/sender) through path enumeration, hybrid optimization, LCD gateway, caching, and rate limiting.5×4×85; still documented, formula-pinned by unit test, and bounded by existingRATE_LIMIT_LCD_HEAVY_RPS(default 10) onlcd_heavy_router. No new bypass of prod floor (0→ forced 10).unreachable_goal_at_four_hops_does_zero_enumerationtest confirms 0 DFS expansions for unreachable goals atmax_hops=4. CPU work still offloaded viaspawn_blocking.hybrid_cache_keyshape unchanged (confirmed in MR scope).lcd_gateway_error 502 sanitization.The hop-cap alignment (hybrid GET now matches POST/pool-only/router
MAX_HOPS=4) is an intentional capability increase within existing guardrails, not a new unbounded attack surface.Inline threads: none (no medium+ findings).
mentioned in commit
7f2f716ac3mentioned in merge request !808