-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make BumpFee RPC user inputs more stricter. #9470
Make BumpFee RPC user inputs more stricter. #9470
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
b1b45e3
to
0f7cd3b
Compare
If we want to get this into a minor release, I think it makes sense to add the new checks at the CLI level first. Then for 0.19, for bump fee that isn't coming from an internal sub-system (we can add some internal attribute to track this), we'll enforce a multiplier check to prevent excessive fees. The multiplier can either be based on the total amount of the output being spent (to set a new default budget), or it can keep the old default budget, then enforce a multiplier based on what the actual conf target is. |
sweep/fee_function.go
Outdated
// are only able to be swept once the deadline is already | ||
// passed we precautiously fetch our chainbackend and make sure | ||
// we limit the fee rate to the current conditions. | ||
fee := FeeEstimateInfo{ |
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.
i don't think we need to change the fee function - also this means we can never reach the budget?
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 it will be reached for all sweep sets which are swept (published) before the deadline of 1. Here we will create the fee-function with the maxBudget as the value for the dealine of 1. However also here I would argue before just taking the feeRate according to the fee-function which we defined at the beginning of the sweep, it acutally makes sense to always query the blockchain for the particular conf-target.
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.
With the internal vs external split, for the external we sort of just use a one-shot fee function, one that starts at it's terminal rate. This is intended to match the user's expectation that we do a one time bump with a CPFP transaction that has a fee rate that's exactly either the conf target or fee sat/vb.
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.
I don't think we should touch the sweep
, instead, everything can already be handled via tuning the params used in making the sweep request. For instance, if we want to provide the functionality that allow user to do one-shot fee function, with the fee rate derived from a fee estimation, we can craft a request such as,
- the user specify a conf target, which is used to perform the fee estimate
- the budget is the estimated fee
- the starting fee rate is the estimated fee rate
- the deadline is 1
And send this request to the sweeper, which I believe is the idea of internal vs external split. The sweeper is already abstracted in a way such that any communication is done via the request, and by changing the fee function here, it gives extra behavior that's not contained in the interface, which is an abstraction violation. This can also be viewed as overexposure,
Overexposure: An API forces callers to be aware of rarely used features in order to use commonly used features.
So if we want to provide the feature, we should do the "internal vs external" split on the RPC layer, though I don't think we even need this feature as the original issue is, the user misunderstood the target-conf
param, and what @guggero suggested should be enough to fix the issue.
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.
I still think we want the internal vs external split here.
I'm also not convinced this should be put in 0.18.5, as minor release should include important bug fixes only? |
Agree. IMO we can do a more in-depth update to the sweeper mechanism in 0.19. But for 0.18.5 I'd suggest only doing CLI level validation (and/or confirmation from user) for potentially dangerous combinations of parameter values. That can IMO be as simple as: lncli bumpfee --conf-target 1
Warning: No budget defined. A block deadline of 1 block will instruct the sweeper to use up to 50% of the
transaction's input as fees to get into the next block. Please provide either a fee rate in sat/vByte or a
budget limit to avoid paying high fees.
Continue? y/n |
99b9cf5
to
de62b21
Compare
What's your opinion about this new approach: We interpret the conf_target as the starting fee estimation, and introduce a new parameter called deadline-delta as proposed by yy ? I think that's the cleanest fix we can do for now ? It does not touch the sweeper logic, but makes sure a budget is supplied in case the new parameter is used ? |
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.
Thanks for the fix! I think this approach is good for 0.18.5.
This shouldn't really break anyone, as I don't expect the --conf-target
was actually understood as deadline delta by any users. And lndclient
only uses a sat/vByte fee rate, so our applications should just work as before.
65005f3
to
e1d6f90
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.
Almost there!
e49cae3
to
69e1ee6
Compare
Fixing itests now. |
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.
Approach ack, thanks!
69e1ee6
to
5757667
Compare
5757667
to
b3e8074
Compare
b3e8074
to
fe29f63
Compare
follow-up: #9487 |
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.
Nice, thanks for the fixes!
fbf7d66
to
46555eb
Compare
46555eb
to
6fe599e
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.
The cli needs to be updated, and a few typos, otherwise it's good to go.
The deadline in number of blocks that the input should be spent within. | ||
When not set, for new inputs, the default value (1008) is used; for | ||
exiting inputs, their current values will be retained.`, | ||
The conf target is the starting fee rate of the fee function expressed |
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 should also update the docs for bumpclosefee
. In addition, we should add the new param deadline_delta
in the cli too.
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.
very good point, updated the bumpclosefee and bumpforceclose RPCs as well.
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.
also added the conf_target (target_conf) to the bumpforceclose RPC
Pending CI and a final squash, other LGTM🙏 |
Add new parameter deadline-delta to the bumpfee request and only allow it to be used when the budget value is used as well.
dc26114
to
d67d30c
Compare
Just Release docs. changed with the final push. |
looking good - can squash the |
7289ef0
to
022b358
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.
LGTM 🥇
The conf-target only reflects this behaviour for the 0.18.5 release, before the conf target had a different meaning: lightningnetwork/lnd#9470 This commit can be undone after minimalCompatibleVersion is bumbed to 0.18.5.
The conf-target only reflects this behaviour for the 0.18.5 release, before the conf target had a different meaning: lightningnetwork/lnd#9470 This commit can be undone after minimalCompatibleVersion is bumbed to 0.18.5.
The conf-target only reflects this behaviour for the 0.18.5 release, before the conf target had a different meaning: lightningnetwork/lnd#9470 This commit can be undone after minimalCompatibleVersion is bumbed to 0.18.5.
The conf-target only reflects this behaviour for the 0.18.5 release, before the conf target had a different meaning: lightningnetwork/lnd#9470 This commit can be undone after minimalCompatibleVersion is bumbed to 0.18.5.
The conf-target only reflects this behaviour for the 0.18.5 release, before the conf target had a different meaning: lightningnetwork/lnd#9470 This commit can be undone after minimalCompatibleVersion is bumbed to 0.18.5.
The BumpFee RPC input parameters are changed with this PR.
For the
lncli
we do not allow to change the width of the fee-function. The conf_target which is specified changes the starting fee rate of the fee function. Which means the initial broadcasting fee if it's an CPFP transaction.