lnd icon indicating copy to clipboard operation
lnd copied to clipboard

rpc+lnrpc: add new SubcribeChannel RPC for async notifications of channel state changes

Open Roasbeef opened this issue 8 years ago • 9 comments

We currently have streaming RPC's to be notified of changes to our network view, on-chain balances, off-chain balances, and a few others. However, we don't yet have a streaming RPC that's dedicated to notifying callers of changes w.r.t the state of our set of channels. Potential state transitions that we'd want to notify on include: new open channels, new closed channels, channels becoming active/inactive, channel force close events, partial contract sweep events. Implementing a set of rich responses for the SubscribeChannel streaming RPC would allow GUIs to be more reactive as they'll no longer have to poll to obtain the latest channel state.

Steps To Completion:

  • [ ] Identify all areas in the codebase that can trigger changes to the set of open/active channels. Starting locations include: the fundingManager, the contractcourt package, the chanCloser (within the peer), and the channelLink.

  • [ ] Once these areas are identified, either introduce a new set of message between these sub-systems, or intercept the messages that are usually delivered via callbacks/closures, and then pipe these through to the new sub-system to dispatch notifications to subscribed callers.

Roasbeef avatar May 11 '18 02:05 Roasbeef

I would like to try this.

jrmillerwork avatar Jun 16 '18 10:06 jrmillerwork

Interested in taking this one, @jrmillerwork LMK if you take issue with that!

valentinewallace avatar Aug 10 '18 21:08 valentinewallace

@valentinewallace : sorry i left this hanging, please proceed.

jrmillerwork avatar Aug 10 '18 21:08 jrmillerwork

@valentinewallace Hi, is this issue available? :)

tsarpaul avatar Sep 12 '18 21:09 tsarpaul

@tsarpaul go for it :)

valentinewallace avatar Sep 12 '18 22:09 valentinewallace

@tsarpaul hey paul, looks like i'm reclaiming this issue because it's high prio for Lightning App. are you far on it?

valentinewallace avatar Sep 19 '18 21:09 valentinewallace

Hi, I'm on it

tsarpaul avatar Sep 21 '18 21:09 tsarpaul

Hi Paul, we didn't get a reply back, so we've already started to design a solution and are rather far along. Typically if there isn't a PR (even a WIP) one within a few days, then we assume it's still up for grabs. See the "share early, share often" section within our contribution guidelines.

On Fri, Sep 21, 2018, 2:54 PM Paul Litvak [email protected] wrote:

Hi, I'm on it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightningnetwork/lnd/issues/1235#issuecomment-423681448, or mute the thread https://github.com/notifications/unsubscribe-auth/AA87LqRhBhmFjE8900Bo8TT2Q48nZlKsks5udWAygaJpZM4T6zAg .

Roasbeef avatar Sep 21 '18 22:09 Roasbeef

Hi Paul, we didn't get a reply back, so we've already started to design a solution and are rather far along. Typically if there isn't a PR (even a WIP) one within a few days, then we assume it's still up for grabs. See the "share early, share often" section within our contribution guidelines. … On Fri, Sep 21, 2018, 2:54 PM Paul Litvak @.***> wrote: Hi, I'm on it — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#1235 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AA87LqRhBhmFjE8900Bo8TT2Q48nZlKsks5udWAygaJpZM4T6zAg .

I see, I wanted to take it slow seeing how inactive this issue was in the past. I'll make sure to share early next time. Thanks for the update :)

tsarpaul avatar Sep 21 '18 22:09 tsarpaul