alpenlabs / strata

Rust implementation of the Strata protocol
https://docs.stratabtc.org
Apache License 2.0
23 stars 1 forks source link

Unify status reporting architecture #162

Closed delbonis closed 2 months ago

delbonis commented 4 months ago

The goal of this ticket is to provide a unified way that we can report on the status of internal components in the client to external interfaces. Principally this is the RPC interface, but if we want to expose other interfaces in the future for more specialized forms of metrics collection (like to feed into Graphana) we want to have a standard way to do this.

At the moment of writing we have two sources that we can report on: the ClientState which is updated via a watch channel by the CSM, and the L1Status which is in a rwlock updated by the L1 query task. These are not connected in any ways, which means we have to pass both of them to the RPC service for reporting. These should somehow be unified into the same umbrella so there's a single type like, perhaps, NodeStatus that we can pass around in an Arc to any consumer and has convenient methods for getting the current state, waiting on updates (if applicable), etc. Producers would be hooked up to this in some unique way.

The first step for implementation would just be to wrap the existing structures in the NodeStatus struct before unifying the reporting mechanisms themselves.

john-light commented 3 months ago

Will be continued in next sprint