Skip to content
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

Update Channel Monitor without broadcasting transactions #3396

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yellowred
Copy link
Contributor

@yellowred yellowred commented Nov 5, 2024

Allowing Channel Monitor to be updated without executing any commands outside ChannelMonitor. This allows reading Channel Monitor in MonitorUpdatingPersister without using broadcaster and fee estimator and broadcast claims when the node is ready for it.
For example, in a multi tenant environment, a server could load channels data in one place, initialize auxiliary services and perform node configuration, then send the result to another process, that would start a node with all required background processes and one of these processes would broadcast the transactions.

  • Is it safe to loose returned transactions?

Allowing Channel Monitor to be updated without executing any commands outside
ChannelMonitor. This allows reading Channel Monitor in MonitorUpdatingPersister
without using broadcaster and fee estimator and broadcast claims when the node
is ready for it.
@yellowred
Copy link
Contributor Author

@TheBlueMatt Replaced private update_monitor with update_monitor_opt_broadcast. Appreciate if you could take a look to confirm if it goes in the right direction. Specifically If it is ok to make broadcaster optional in private functions so that they may return claims rather than broadcasting them.

@TheBlueMatt
Copy link
Collaborator

Instead of touching all the code here, wouldn't it be simpler to just build a Broadcaster that stores the packages and use that as the Broadcaster passed to the inner methods?

&self,
updates: &ChannelMonitorUpdate,
logger: &L,
) ->Result<(Vec<Result<Vec<PackageTemplate>, ()>>, bool), ()>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sold on returning the packages to broadcast here - if a user is running in a situation where they don't have the ability to register a Broadcaster that can broadcast why can they broadcast a set of transactions we hand to them here? Instead, should we consider storing the packages in the ChannelMonitor to broadcast as soon as we see the node being up (eg a block gets connected)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants