Skip to content

Conversation

@jmg-duarte
Copy link
Contributor

Description

Updates Axum from 0.6 to 0.8 along with related ecosystem dependencies:

  • axum 0.6.20 -> 0.8.8
  • tower 0.4.13/0.5.3 -> 0.5.3 (unified)
  • tower-http 0.4.4/0.6.8 -> 0.6.8 (unified)
  • hyper 0.14.32 -> 1.8.1
  • reqwest 0.11.27/0.12.28 -> 0.13.1
  • tonic 0.11.0/0.13.1 -> 0.14.2
  • console-subscriber 0.3.0 -> 0.5.0

Changes

  • Update dependencies
  • Refactor accordingly

How to test

Compilation, E2E tests, staging

jmg-duarte and others added 10 commits January 22, 2026 16:12
This commit migrates the orderbook HTTP API from the warp web framework
to axum. The migration includes:

- Replace warp filters with axum Router and handlers
- Update HTTP status codes to match axum conventions (422 for JSON
  deserialization errors, proper 400/404 distinction)
- Restructure API with centralized AppState shared across handlers
- Implement axum-compatible middleware for metrics and tracing
- Remove warp dependency and related tracing utilities
- Update e2e tests to reflect new HTTP behavior

Breaking changes:
- Invalid JSON payloads now return 422 (Unprocessable Entity) instead
  of 400
- Path parameter validation now returns 400 for malformed values
- Error response format remains compatible

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Fixed critical issues identified in PR review:
- Fixed route conflicts by using .merge() for multiple HTTP methods on same paths
- Changed get_trades_v2 to use database_read instead of database_write
- Reorganized routes alphabetically by prefix using .nest() for better maintainability
- Made METRIC_LABELS a module-level const for reusability
- Removed convert_json_response helper (too simple to warrant abstraction)
- Optimized Arc wrapping by using trait references directly
- Applied per-method middleware before merging to ensure correct metric labels
- Simplified test code by removing unnecessary verbose match expressions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Updates Axum from 0.6 to 0.8 along with related ecosystem dependencies:
- axum 0.6.20 -> 0.8.8
- tower 0.4.13/0.5.3 -> 0.5.3 (unified)
- tower-http 0.4.4/0.6.8 -> 0.6.8 (unified)
- hyper 0.14.32 -> 1.8.1
- reqwest 0.11.27/0.12.28 -> 0.13.1
- tonic 0.11.0/0.13.1 -> 0.14.2
- console-subscriber 0.3.0 -> 0.5.0

Updates API compatibility across all services (autopilot, driver, orderbook,
solvers) and test infrastructure (e2e tests, mocks) to work with new Axum
extractors and response types. Fixes observability integration with updated
tracing-axum layer and metrics collection.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Axum 0.8 changed path parameter syntax from `:param` to `{param}`.
Updated all route definitions across:
- autopilot: /native_price/{token}
- driver tests: /api/v1/app_data/{app_data}
- orderbook v1 API: account, app_data, orders, solver_competition, token,
  transactions, and users routes
- orderbook v2 API: solver_competition routes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@jmg-duarte jmg-duarte force-pushed the jmgd/axum/orderbook-2 branch from 45e0f9a to 9af007d Compare January 30, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants