Append ChannelEvent on Channel Backup Subscriptions in LND's gRPC API #8022
bluebycode
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
I don't think that addition is needed. Since the information for a particular channel doesn't change during the lifetime of that channel (with the sole exception being if the peer announces a different public IP address), you can basically just run a diff on the channel points themselves. If the list of channel points doesn't change, then the content won't have changed either. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The implementation of the
SubscribeChannelBackups
API in LND's gRPC service provides valuable real-time updates on channel backups. However, it lacks granularity in specifying the type of event that triggered the backup change. As per the official documentation, the API sends a new set of channel backups whenever a channel is opened or closed. This is useful but needs to be more sufficient for particular use cases.For instance, when a channel is opened or closed, two consecutive events are received with different byte representations of the backup but with the same list of channel points. This behavior can be detected in the codebase and debugging LND locally, specifically in the channel_notifier.go file. The "issue" or this particularity arises when distinguishing between these two events, as the byte representation is encrypted, and the list of channel points remains the same for both.
To address this, it would be beneficial to include an additional enumerator field in the
ChanBackupSnapshot
object returned by the subscription. This enumeration state could specify the type of event that triggered the backup change, such as 'PendingOpen,' 'Open', 'PendingClose', or 'Close'. By doing so, consumers of this API would have a clearer understanding of the channel state transitions, enabling more robust and informed decision-making processes.Enhancing the API to include this additional information can provide a more comprehensive and user-friendly experience for developers interacting with LND's gRPC services.
Do you think this enhancement can be valuable ? Or as in most cases of use, persisting the backup object, getting the latest one, and then not looking backward...
Beta Was this translation helpful? Give feedback.
All reactions