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.