-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add Configurable Fee Functions to Sweeper with Dynamic Selection #9701
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
base: master
Are you sure you want to change the base?
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 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 (
|
Hey @ziggie1984 sir, |
I guess you refer to the SoB project proposal here: LND - Sweeper Fee Function Please complete the Competency Tests and apply properly via the SoB program. |
Description
This PR enhances the LND
UtxoSweeper
by introducing configurable fee functions—LinearFeeFunction
,CubicDelayFeeFunction
, andCubicEagerFeeFunction
—to optimize transaction fee estimation for sweeping UTXOs. Users can now specify the fee function type (linear
,cubic_delay
, orcubic_eager
) and a base fee rate via configuration options (--sweeper.feefunctiontype
and--sweeper.basefeerate
). Additionally, a dynamic selection mechanism chooses the optimal fee function based on value density ((\rho)) and confirmation target (deadline_delta
), derived from analysis inoptimization.ipynb
(gist: [pending upload, replace with link if available]).The motivation is to improve fee efficiency:
cubic_eager
accelerates fee increases for urgent, high-value sweeps;cubic_delay
delays increases for less urgent, low-value sweeps; andlinear
remains a balanced default. This is a feature enhancement and not tied to a specific issue, though it aligns with broader efforts to refine fee management in LND.Steps to Test
cubic_eager
:Fee rate increased from X to Y at position Z
).lncli pendingchannels
or logs.linear
):cubic_eager
((\rho > 9008.22),deadline_delta < 13
).cubic_delay
(deadline_delta >= 40
or>= 26
with (\rho < 65983.36)).Pull Request Checklist
Testing
make fmt-check
andmake unit
pass locally.)CubicDelayFeeFunction
andCubicEagerFeeFunction
, and integration tests for dynamic selection are pending.)Code Style and Documentation
feat: add configurable fee functions to sweeper with dynamic selection
)log.Debugf
andlog.Errorf
insweep
package, matching existing conventions.)[skip ci]
in the commit message for small changes. (TODO: Add release notes entry underdocs/release-notes
for this feature.)📝 Please see our Contribution Guidelines for further guidance.