LSPS2: Isolate `PeerState` types via a `sealed` sub-module

Abierto
#4,073 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
22/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rust

Línea de trabajo

This is an architectural refactor of the LSPS2 service handler: move PeerState and related types into a sealed sub-module so they are only reachable through dedicated internal pub methods, shrinking the places that set needs_persist. Start from the existing LSPS2 handler and any work already sketched in #4008. Done means state changes that must be persisted go only through that API and the rest of the handler no longer mutates PeerState directly.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

lightning-liquidity

The LSPS2 service handler has a lot going on. In particular, it might currently is hard to follow when we actually make a state change that needs to be persisted.

We should isolate the PeerState and related types to a sealed sub-module to ensure we can only access/modify it via dedicated internal pub API methods. This would reduce the number of places where we need to set needs_persist, making it much less error prone.

FWIW, I started down this road as part of #4008, but this would be huge refactor on its own right so decided not to continue for the time being.

Lenguaje dominante
Rust
Estrellas
1.4k
Forks
482
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lightningdevkit/rust-lightning

Todos los issues de lightningdevkit/rust-lightning

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.