Skip to main content

is_established_route_dead

Function is_established_route_dead 

Source
pub fn is_established_route_dead(_flags: Flags, code: &str) -> bool
Expand description

Whether the caller should evict this established route, reopen it, and resend the request once. Consumers mapping route death to their own custody, provider, or suspect verdict keep their own named code lists; sharing this predicate for those meanings can change a verdict on a protocol bump (prefrontal#59).

Takes envelope flags so the daemon-origin check can be enabled here in one place. Phase 2 requires first that every daemon a consumer can meet sets DAEMON_ORIGIN on these error frames, both landed and deployed; only then may this predicate require the bit. Requiring it sooner makes a new SDK against an older daemon stop evicting on a genuine stale_route_epoch — the failure this predicate is meant to prevent.

The daemon emits these codes in RouterError::to_error_frame at crates/subc-daemon/src/router.rs (UnknownChannel and StaleRouteEpoch).