-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running clboss in a "low cost" mode #202
Comments
Wow, I just added #201 yesterday! I think it's mostly the same sentiment ...
Yes, this seems very sensible. |
One tricky part is figuring out how the various CLBOSS modules interact. For example many of the features use the I've started to make diagrams to improve my own understanding: I'm planning on diagramming the other "feature groups" as well in my spare time. |
@sj-fisher Which features/actions (which are on by default) would be the most useful to disable? This might be a good starting point for a plan ... |
I think we can cleanly disable channel opening by telling CLBOSS to ignore the onchain funds which is already supported. Since disabling closing is also supported the remaining items from your list are:
Maybe these are a good starting point ... |
Thanks, I somehow managed to miss #201 - sorry about that. I guess I was too focused on the "low cost" angle when initially searching and as I kept rewriting my original issue as I thought it through it grew more similar to #201 but I'd forgotten about it by then. I haven't looked at the code myself yet but your idea of diagramming the data flows seems a good one. I think the items you mention from my list are a good starting point. I would guess the Boltz swap can be disabled relatively safely, since Boltz could go down indefinitely anyway even if we'd like to use their service so we shouldn't rely on it for anything else to work. Without having looked at the code I suspect circular balancing may be a bit trickier, since it's possible that one part of clboss will ask for this to happen, it won't happen because it's been disabled and that will be interpreted as an unreliable peer somewhere in the path. It may well not be a problem, but if there is going to be a problem with these initial changes, I suspect this is the most likely place for one to crop up. I would ideally like to be able to disable (e.g.) channel opening by saying "don't do this, except when I allow you explicitly for the next n hours" rather than having to set "don't do this for the next infinity hours" to disable it, needing to set "allow this" when I want to enable it and needing to remember to set back to "disable for infinity hours" manually later on. So (just by way of example) instead of clboss-ignore-onchain=n (hours) and clboss-notice-onchain to revert before the n hours are up, we'd have something like cboss-monitor-onchain={true,false} and clboss-monitor-onchain-invert=n (hours). I don't like those names very much, but I hope this gets the idea across. |
FWIW I am working on a prototype implementation of this. |
I've implemented a prototype of this at https://github.com/sj-fisher/clboss/tree/low-cost-v1. Feedback would be appreciated! This has been lightly tested on signet and nothing more. Please be very cautious if using this on mainnet! OverviewThis adds three new boolean options:
The new options can be specified via config file entries, e.g.
and can also be controlled via lightning-cli, e.g.:
If present, config file entries are applied on startup, overriding any changes made earlier using lightning-cli commands. Otherwise, changes made with lightning-cli are persisted in the database across restarts. This feels a bit over-complex, but it's also the most flexible approach. If nothing is ever specified, all three default to "true" for backwards compatibility. Each of the options can also be temporarily set using lightning-cli, e.g.:
will temporarily allow auto-opening of channels for 3 hours. If this command uses the same boolean value as the base state, it is a no-op. A temporary setting can be removed before it times out by using the non-temporary form of the command. For example, to cancel the previous temporary permission to auto-open channels:
You can see the current state using:
Possible problemsOverlap between auto-open-channels and ignore-onchainThe new auto-open-channels/temporarily-auto-open-channels commands have a lot of overlap with the existing notice/ignore-onchain commands. They are not quite the same:
It would obviously be possible to check in the same places in the code if desired. I do like the ability to have "default false", which is why I added this in the first place. I think there is a theoretical difference between the two which doesn't apply at the moment - if (for example) we had support for advertising our willingness to dual-fund channels, ignore-onchain should probably prevent that, whereas "auto-open-channels false" would not. I'm reluctant to break backwards compatibility by removing the notice/ignore-onchain options completely, but they could be handled as special-case syntax for the new auto-open-channels behavior. Implementation notesMost of the new code is in Boss/ModG/TimedBoolean.hpp, which adds a TimedBoolean helper class which deals with all the messy user interface and state maintenance for "timed booleans", i.e. booleans which have a base state and which can be set to a different state for a fixed period of time. This has its origins in the existing OnchainFundsIgnorer code. Three new controllers (AutoOpenController, AutoSwapController and CircularRebalanceController, all in Boss/Mod) use TimedBoolean internally and expose a pair of Request/Response messages to allow their current state to be queried. Logic has then been added (in ChannelCreationDecider, NodeBalanceSwapper and EarningsRebalancer) to disable the existing behavior where the relevant timed boolean is currently false. |
@sj-fisher apologies for the delay, starting to look ... Can you make a PR from your branch? It's fine to mark it |
Thanks Ken! I didn't know draft pull requests were a thing. I've opened one now and copied my initial comments from this issue into that pull request to keep everything together. |
Is there currently any support for running clboss in a "low cost" mode?
I have a node which I use to make and receive fairly small and infrequent payments over lightning. I would like to run clboss on this node in order to benefit from:
I am not trying to make a profit from routing or to help the network by operating a routing node at a loss, so I do not want clboss to automatically do anything which costs money:
It would be nice to have the ability to manually re-enable those features temporarily if I decide the node would benefit from them.
My current half-baked thinking is that the way to do this would be by adding a handful of options/new behaviors to clboss which might be individually useful, such as:
Combining these would then effectively provide a variety of "economy modes" for clboss with an emphasis on lowering costs in return for the node being less reliable and hands-off.
Noting the obvious pattern in the ideas above and that you can already do the opposite with "noticing on-chain funds" - you can temporarily disable this for a set period - I wonder if the thing to do here would be to generalize that pattern. In other words, add some generic way to configure a clboss feature to be on or off by default and to have an ability to temporarily invert that setting for a time-limited period.
I am interested in doing some implementation work to support this, if it isn't already a thing. I've opened this issue before I start hacking to see if anyone has any thoughts. Is this even a sensible thing to want? Is there an alternative automated Core Lightning node manager which suits these goals better than clboss? Is there a better way to modify clboss to achieve this goal instead of the approach I sketched out above?
The text was updated successfully, but these errors were encountered: