Migrating from PATH to SAGE
SAGE is a restructured successor to PATH, built to drop into PATH’s place. Your PATH config loads unmodified, and your clients keep sending the same requests to the same /v1 path with the same Target-Service-Id header. The full contract, with every deliberate difference and the test that holds it, is docs/path-compat.md.
Steps
- Run SAGE on your existing PATH config. Same file, same keys:
bash
./sagegw -config /path/to/your/path-config.yaml - Read the startup report. For every key SAGE does not act on, it says so and why (see below). Resolve anything you relied on.
- Move your probes. Liveness to
/livezor/health, readiness and startup to/ready. See Health and readiness. - Check what your clients read from responses. If anything parses PATH’s metadata headers or the
-31001error code, see What clients see. - Send a share of traffic to SAGE, compare error rates and latency, then move the rest.
What the Startup Report Tells You
SAGE never fails on a PATH key it lacks. It reports each one at startup:
| Report | Meaning | Examples |
|---|---|---|
| Ignored | SAGE has no such setting | strike_system (SAGE uses continuous scoring, not strikes) |
| Not implemented | SAGE handles this another way, and the line says how | active_health_checks.coordination, router_config.max_concurrent_websocket_connections |
| No effect | The key parses into a field nothing reads | latency_profiles (latency breaks ties but never lowers a score), the retry_on_* switches (retryability comes from the response’s grade), lazy_mode and session_rollover_blocks (sessions follow the protocol’s own boundaries) |
| Probably not what was meant | The value is read; the line says what SAGE will do with it | Reputation thresholds that do not descend |
Most of PATH’s reputation tuning is honoured: signal_impacts, the tiered_selection thresholds, probation and min_threshold.
Keys That Differ
| Key | PATH | SAGE |
|---|---|---|
owned_apps_private_keys_hex | Names the apps | Still accepted, with a warning: SAGE only derives the addresses. Prefer owned_apps_addresses (pokt1…), which keeps application keys out of the config |
gateway_mode: delegated | Signs for the app the App-Address header names | Loads with a warning: SAGE relays for its configured apps only and ignores the header |
retry_config.enabled | Absent means on | Same, read from the key’s presence in the YAML |
| Strikes and cooldowns | Endpoints benched by strike counters | No strikes: a continuous score feeds tiered selection |
Health and Readiness
| Route | PATH | SAGE |
|---|---|---|
/health | Liveness | Liveness (same) |
/healthz | Readiness: 503 until a session exists | Same |
/livez | — | Liveness |
/ready | — | 503 until sessions are ready and reputation has warmed from health checks |
/ready/{service} | 503 without a session or endpoints | Same condition |
Gate readiness on /ready: a pod that takes traffic on session readiness alone serves errors until reputation has warmed.
What Clients See
Supplier output passes through unchanged: response bodies, JSON-RPC ids and WebSocket frames. What SAGE itself produces follows HTTP and JSON-RPC semantics rather than PATH’s conventions:
| Area | PATH | SAGE |
|---|---|---|
| Gateway-made errors | HTTP 500, JSON-RPC code -31001 | A status for the cause: 500, 504 on timeout, 429 on rate limit, 400 on a client mistake, 502 for an oversized supplier response |
| Oversized request or batch | Refused by net/http, or a 500 | 413 with a JSON body |
| Metadata response headers | X-Retry-Count, X-Suppliers-Tried, X-Archival-Request, … | None. X-Request-ID is echoed, and X-Degraded marks a degraded answer |
Target-Suppliers header | Pins the relay to listed suppliers | Ignored |
/v1/{portal_app_id}/… prefix | Stripped when Portal-Application-ID is set | Not stripped: forwarded as the REST path |
GET /config, GET /disqualified_endpoints | On the relay port | Absent; the admin port has the equivalents |
Requests that PATH refused before relaying (unknown service, unsupported RPC type, malformed JSON-RPC) get the same 400 with a -32600 envelope on SAGE.
Operations That Differ
- Three listeners. Relays on
3069, admin on loopback9091, Prometheus on9090. PATH’s operational routes on the relay port moved to the admin port. - One prober per fleet. With Redis, an elected leader sends health-check probes and every replica applies the results, instead of each replica probing every supplier.
- Metrics are named
sage_*. Dashboards and alerts built on PATH’s metric names need new queries; docs/metrics.md lists them all.