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

Merge new fixes into static-addr-staging #851

Closed
wants to merge 7 commits into from
Closed

Conversation

sputn1ck
Copy link
Member

No description provided.

pinglanlu and others added 7 commits November 11, 2024 18:44
Signed-off-by: pinglanlu <pinglanlu@outlook.com>
The first result of function sweepConfTarget was not used. The function
was renamed to canSweep to better reflect what it does.
There are some numeric constants that used to be defined as vars complicating
their usage. They were turned into constants: MinLoopOutPreimageRevealDelta,
DefaultSweepConfTarget, DefaultHtlcConfTarget, DefaultSweepConfTargetDelta.

Also make liquidity.defaultHtlcConfTarget a constant, not a var.
Added argument 'label' to GetSweepFee and GetSweepFeeDetails. It is logged
together with expected weight, fee and feerate.
Add type loopOutSweepFeerateProvider which determines confTarget based on
distance to swap expiration, then determines feerate and fee using. Fee rate
is plugged into sweepbatcher using WithCustomFeeRate. Option WithPublishDelay
is used to make sure fee-rate is updated by loopout.go before the value is used
by sweepbatcher.

When determining confTarget, there are few adjustments over raw distance to
cltv_expiry:
 - make sure confTarget is positive (if the swap has expired, raw distance is
   negative)
 - If confTarget is less than or equal to DefaultSweepConfTargetDelta (10),
   cap it with urgentSweepConfTarget and apply fee factor (1.1x).

Also, if feerate is less than floor (1 sat/vbyte), then the floor is used.

DefaultSweepConfTargetDelta was decreased from 18 to 10.

Every block 100 sats/kw fee bump is disabled. Sweepbatcher re-targets feerate
every block according to current mempool conditions and the number of blocks
until expiry.

Added tests for loopOutSweepFeerateProvider simulating various conditions.
loopout: re-target sweep's feerate every block
@sputn1ck sputn1ck closed this Nov 14, 2024
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.

4 participants