lightningequipment/circuitbreaker

Update/refresh web UI after closing or adding new peers

Closed this issue · 11 comments

Problem:
After closing peers oder adding new peers, the web ui is not updated. The circuitbreaker instance has to be restarted to be updated.

Actual Fix:
When using circuitbreaker via systemd, the service could be restarted every 1 hour. However with this solution, the statistics is deleted.

Suggestion:
It would be great if the program itself could update its peer list.

Will take a look at this, thanks for reporting.

I looked in more detail at the current behavior:

  • When a new peer is added, it doesn't automatically become visible. But once a first htlc has come in from that peer, the peer is shown.
  • When all channels with a peer are closed, the peer remains in the list as long as circuitbreaker runs.
  • On startup, all peers are shown.
  • Nodes that are no longer a peer but have a custom limit set are still shown.

It would indeed be more logical to always show all current peers only.

The only slight downside might be that a custom limit for a peer that is no longer a peer isn't visible or editable. The limit will be remembered though in case the peer re-appears in the future. At that point, the old limit may come as a surprise perhaps?

To your first point: That was the main problem, that irritated me the most, because I thought circuitbreaker is not handling new nodes. Improvement of this point is very important.
Second point: Update the list every hour with auto-removal of closed peers
Last point: maybe the peer is offline for several days, so it would be could to keep the old rule.

However, I would appreciated an up-to-date list of peers.

Btw any chance that htlc management could be splitted? Would like to run the electronwall from calle simultanously.

Yes, so a peer that is offline is still a peer. I wouldn't remove it from the list in any case.

Splitting htlc management is indeed something that I've been thinking about a few times too. It is currently a limitation in lnd that only a single htlc interceptor application can be connected. Will require careful consideration how to do that safely.

@M1ch43lV Fixed the addition part in master now. Let me know if that works for you!

Thanks! Seems to work now!
It would be good, if you could add some version number in the GUI for the next release!

Expose lnd and circuit breaker version: #45

Created new issue for remainder of this one: #46

@M1ch43lV welcome to test the new configuration display in the web ui! It's in master.

Screenshot_20230206_203334_Brave
On my mobile Bravebrowser the screen of the Web ui is unfavourably splitted (see screenshot). Hope it can be optimized.

Yes, I am aware that the app isn't mobile friendly at the moment. Created #48 for tracking.

Going to close this issue now because I think all suggestions have been spun out into separate issues.