-
Notifications
You must be signed in to change notification settings - Fork 45
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
Multiple improvements #115
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0fc7ff1
to
b825c79
Compare
We are using the onchain fee estimator of lnd now. Internally, lnd uses either bitcoind or a fee url for the estimation.
It is now possible to control the node limits of a circuitbreaker instance dynamically.
The onchain matcher offers the possibility to enforce policies depending on the current onchain fees. The confirmation target can be configured by the user (default: 6).
Add synced_to_chain as a criterion to the onchain matcher. synced_to_chain becomes false if LND is not synced to the chain for more than 5 minutes. In the past, this was an indicator of a severe issue that required a hotfix for lnd.
We add the amounts of pending htlcs to the local and remote balance of a channel. Incoming htlcs are added to the remote balance and outgoing htlcs to the local balance.
We take the commit fee into account when calculating the local balance and the remote balance, depending on who opened the channel. This stabilizes the calculation of balances and ratios in times of volatile onchain fees.
We include rules based on either the number of pending HTLCs or the next expiry.
Local constraints are used to floor/cap the min_htlc_mat/max_htlc_msat.
Until now, it could happen with several attributes that the matcher for a namespace was called several times unnecessarily.
1) `min_inbound_fee_ppm_delta` is the necessary minimum change in the inbound_fee_ppm. The parameter uses `min_fee_ppm_delta` as the default. 2) We also ensure that the inbound fee rates are only changed if the change is sufficiently large. 3) If `inbound_level_ppm` is set, `inbound_fee_ppm` is calculated with `min(inbound_level_ppm - fee_ppm; 0)`.
In this new mode we print more information than in verbose mode. Every matched policy is printed. That can be useful if one use a config with many non final policies.
b825c79
to
ce993d4
Compare
Rebased because of #116 |
huge improvements @feelancer21, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added multiple improvements to charge-lnd. Below a summary of the commits. Feel free to test, comment or merge.
Fixes also #111, #83 and #2
Functional Improvements
Rules based on pending htlcs
We include rules based on either the number of pending HTLCs or the
next expiry.
Introducing:
inbound_level_ppm
andmin_inbound_fee_ppm_delta
min_inbound_fee_ppm_delta
is the necessary minimum change in theinbound_fee_ppm. The parameter uses
min_fee_ppm_delta
as the default.change is sufficiently large.
inbound_level_ppm
is set,inbound_fee_ppm
is calculatedwith
min(inbound_level_ppm - fee_ppm; 0)
.Consideration of the local constraints during channel update
Local constraints are used to floor/cap the min_htlc_mat/max_htlc_msat.
Consideration of the commit fee in the balance calculation
We take the commit fee into account when calculating the local balance
and the remote balance, depending on who opened the channel. This
stabilizes the calculation of balances and ratios in times of volatile
onchain fees.
Consideration of the unsettled balance
We add the amounts of pending htlcs to the local and remote balance of
a channel. Incoming htlcs are added to the remote balance and outgoing
htlcs to the local balance.
Add an onchain matcher
The onchain matcher offers the possibility to enforce policies
depending on the current onchain fees. The confirmation target
can be configured by the user (default: 6).
Circuitbreaker support
It is now possible to control the node limits of a circuitbreaker
instance dynamically.
Logging
Printing RpcErrors and UpdateFailures
Very verbose mode
In this new mode we print more information than in verbose mode.
Every matched policy is printed. That can be useful if one use a
config with many non final policies.
Others
Matchers are now only called once
Until now, it could happen with several attributes that the matcher
for a namespace was called several times unnecessarily.
use onchain fee estimate of lnd instead of electrum
We are using the onchain fee estimator of lnd now. Internally, lnd uses
either bitcoind or a fee url for the estimation.
Cleanup unused module imports