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

Simplify on-chain fee management #2696

Merged
merged 14 commits into from
Jun 20, 2023
Merged

Simplify on-chain fee management #2696

merged 14 commits into from
Jun 20, 2023

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Jun 15, 2023

Move away from the "block target" approach.

Get rid of the FeeEstimator abstraction and use an AtomicReference to store and update the current feerates, similar to the block count.

@pm47 pm47 requested a review from t-bast June 15, 2023 15:14
@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2023

Codecov Report

Merging #2696 (b8f334e) into master (3a351f4) will decrease coverage by 0.08%.
The diff coverage is 89.84%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #2696      +/-   ##
==========================================
- Coverage   85.86%   85.78%   -0.08%     
==========================================
  Files         215      215              
  Lines       17626    17637      +11     
  Branches      762      737      -25     
==========================================
- Hits        15134    15130       -4     
- Misses       2492     2507      +15     
Impacted Files Coverage Δ
...n/scala/fr/acinq/eclair/json/JsonSerializers.scala 96.42% <ø> (ø)
...clair/channel/publish/ReplaceableTxPublisher.scala 71.95% <68.88%> (-2.25%) ⬇️
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 93.09% <83.33%> (-0.56%) ⬇️
...r/acinq/eclair/blockchain/fee/OnChainFeeConf.scala 93.33% <87.50%> (ø)
.../fr/acinq/eclair/channel/publish/TxPublisher.scala 97.50% <87.50%> (-1.24%) ⬇️
...la/fr/acinq/eclair/transactions/Transactions.scala 96.58% <92.30%> (ø)
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 85.97% <94.73%> (+0.08%) ⬆️
...ir-core/src/main/scala/fr/acinq/eclair/Setup.scala 75.00% <100.00%> (-0.43%) ⬇️
...in/scala/fr/acinq/eclair/channel/Commitments.scala 96.75% <100.00%> (ø)
...c/main/scala/fr/acinq/eclair/channel/Helpers.scala 95.03% <100.00%> (ø)
... and 8 more

... and 6 files with indirect coverage changes

@pm47
Copy link
Member Author

pm47 commented Jun 16, 2023

Rebased on master.

@pm47 pm47 marked this pull request as ready for review June 16, 2023 16:04
@pm47
Copy link
Member Author

pm47 commented Jun 16, 2023

One thing left to address are the default feerates which I would really like to remove. I think there are two reasons for them to exist:

  • as constant values for regtest (but we can directly use hardcoded values with a ConstantFeeProvider
  • to deal with -1 values returned by estimatesmartfee in some corner cases (e.g. restart of bitcoin core)

Not sure exactly how to proceed though!

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, much better than the previous block targets!

@t-bast
Copy link
Member

t-bast commented Jun 19, 2023

Not sure exactly how to proceed though!

I don't know what we can do honestly, since we want to handle bitcoind restarts...I don't think we want to persist the latest fees, it's better to avoid a frequent DB call, so we need external input from the node operator (which is why hard-coded values in eclair.conf makes sense, even though it's not very satisfying).

pm47 added 12 commits June 20, 2023 10:07
Move away from the "block target" approach.

Get rid of the `FeeEstimator` abstraction and use an `AtomicReference` to store and update the current feerates, similar to the block count.
In particular we set them in human-readable sat/byte.
Also use satoshis-per-byte.
@pm47
Copy link
Member Author

pm47 commented Jun 20, 2023

Rebased.

eclair-core/src/main/resources/reference.conf Outdated Show resolved Hide resolved
docs/release-notes/eclair-vnext.md Show resolved Hide resolved
docs/release-notes/eclair-vnext.md Outdated Show resolved Hide resolved
@pm47
Copy link
Member Author

pm47 commented Jun 20, 2023

Not sure exactly how to proceed though!

I don't know what we can do honestly, since we want to handle bitcoind restarts...I don't think we want to persist the latest fees, it's better to avoid a frequent DB call, so we need external input from the node operator (which is why hard-coded values in eclair.conf makes sense, even though it's not very satisfying).

Let's defer this to a later time.

@pm47 pm47 requested a review from t-bast June 20, 2023 09:05
@pm47 pm47 merged commit da98e19 into master Jun 20, 2023
1 check passed
@pm47 pm47 deleted the fee-estimator branch June 20, 2023 09:56
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.

3 participants