-
Notifications
You must be signed in to change notification settings - Fork 905
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
Relax chainfee requirements #6976
Conversation
@@ -562,7 +562,7 @@ static bool local_opener_has_fee_headroom(const struct channel *channel, | |||
|
|||
/* Now, how much would it cost us if feerate increases 100% and we added | |||
* another HTLC? */ | |||
fee = commit_tx_base_fee(2 * feerate, untrimmed + 1, | |||
fee = commit_tx_base_fee(1.1 * feerate, untrimmed + 1, |
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.
maybe the answer is inside the issue description, but would be good to add a comment on why we are adding this const value?
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.
Added a comment in the commit description.
d03df24
to
21df515
Compare
When the node has a small channel and the current chain fees are at an all time high, adding 10% to the chain fee rate for security is sufficient. Especially with anchors/zero-fee-htlc-tx.
d03df24
to
9e1d37e
Compare
I pushed the wrong branch accidentally. Currently pushed the right branch again and rebased. |
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976
Looks good. I'll go ahead and close this PR in favor of #7063 |
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976 [Fixed up all the other changes required, including spendable calcualtion comments and tests --RR] Header from folded patch 'wip.patch':
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976 [Fixed up all the other changes required, including spendable calcualtion comments and tests --RR] Header from folded patch 'wip.patch':
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976 [Fixed up all the other changes required, including spendable calcualtion comments and unit test and pytest tests --RR]
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes #6974 Closes #6976 [Fixed up all the other changes required, including spendable calcualtion comments and unit test and pytest tests --RR]
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976 [Fixed up all the other changes required, including spendable calcualtion comments and unit test and pytest tests --RR]
The feerate security margin is a multiplicative factor applied to the feerate of some transactions in order to guarantee that the transaction remains publishable and has a sufficient chance of being confirmed, that we can base some of our decisions on that. The multiplicative factor is >=1 and was so far a constant 2. This might have been sensible in the low-fee environment, where the fees are expected to oscillate, and almost guaranteeing that we will eventually have rising feerates but in high-fee environments that is no longer the case, and the 100% margin that the multiplicator 2 brings is excessive. We therefore opt to start out with 100%, then linearly interpolate up to a given maxfeerate (which does not have to be a real feerate ever reached, it just indicates the feerate after which we apply the constant 10% margin. Fixes ElementsProject#6974 Closes ElementsProject#6976 [Fixed up all the other changes required, including spendable calcualtion comments and unit test and pytest tests --RR]
This is a quickfix for nodes that have small channels in the current high chainfee environment. CLN currently doubles the current fee rate in order to check whether a htlc can be added. @cdecker proposes a more mathematical approach in this issue #6974. This PR changes the security check to 110% the current fee rate, rather than 200%.