Module lifecycle_service

Module lifecycle_service 

Source
Expand description

Per-chain lifecycle state.

Holds a small LifecycleState value (bootstrap phase, peer presence, stall verdict) and lets consumers subscribe to changes, so that an embedder can show what the light client is doing without parsing log output. See issue #3301.

This is a “latest value” broadcast, not an event log. A subscriber receives the current state when it subscribes and then the newest state after every change. A subscriber that reads slowly simply skips intermediate states. Nothing is buffered, so a slow subscriber can never fall behind or slow down syncing.

start creates the service of a chain together with the two tasks that keep it up to date: one maps the sync service’s status to the phase, the other polls the network service for the peer count and derives the stall verdict.

The schema is unstable.

Structs§

LifecycleService
Holder of the LifecycleState of one chain.
LifecycleState
Lifecycle state of a chain.
Subscription
Handle returned by LifecycleService::subscribe.

Enums§

Health
Verdict of the stall watchdog.
Phase
Bootstrap progress of the chain.
StallReason
Why the watchdog considers the chain stalled.