-
Notifications
You must be signed in to change notification settings - Fork 911
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
funder
cleanups!
#5650
funder
cleanups!
#5650
Conversation
b0292c7
to
3a98aa4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent cleanups 👍
ACK 3a98aa4
lightningd/dual_open_control.c
Outdated
/* iiuc deserialized gets called multiple times? */ | ||
if (!payload->rates) | ||
payload->rates = tal(payload, struct lease_rates); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, once for each plugin that gets called :-)
|
||
/* Next add available utxos until we surpass the | ||
* requested funds goal */ | ||
/* FIXME: Update `utxopsbt` to automatically add more inputs? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be an extra RPC method called fundpsbt
to mirror bitcoind
's API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a fundpsbt
that behaves slightly differently.
Seems there is one json scan that doesn't always match the payload:
The offending field is |
We were leaving out the `channel_max_msat` for `openchannel2` when channels are 'wumbo' (the conversion to msat in the json helper overflowed, which resulted in the field not being printed) Changelog-Changed: Plugins: `openchannel2` now always includes the `channel_max_msat`
Parse the channel_max along with everything else.
We're gonna need it for rbf requests/re-negotiations
if they request less than we wanted/accepted FIXME: add a test for this?
If more than one plugin calls `openchannel2`, the payload will get re-freshed/re-parsed.
let's let RBFs know about our lease info!
We're going to need to know what utxos we used if we RBF this channel; so we serialize our inputs and save them to the datastore under the channel_id.
It'd be nice to know which utxos we used previously, so we can rebuild a transaction using them!
Still need to use them to build the PSBT for the rbf however.
We use the saved previous outputs (plus maybe some new ones?) to build a psbt for an RBF request. RBFs utxo reuse is now working so we can unfail the test (and update it to reflect that the lease sticks around through an RBF cycle). Changelog-Fixed: Plugins: `funder` now honors lease requests across RBFs
If for some reason a utxo we used previously is no longer 'unspent', we shouldn't use it for the next transaction.
Let's not leave old state hanging around! Note that this fires for pretty much every/any channel (even if we're not the opener).
3a98aa4
to
ebcc865
Compare
Oh fun. We don't include Added a new commit, b6ef966, which now uses a non-overflow-ing number for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ebcc865
I've been dying to clean up some things in
funder
that are/were subpar. Here they are!I kinda think that's it? That might be it.