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

未關閉
#4,073 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
22/100
Issue 類型
重構
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
rust

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Rust
星號
1.4k
分支
482
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

lightningdevkit/rust-lightning 的其他 Issue

查看 lightningdevkit/rust-lightning 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。