Conversation
a153d80 to
a002cce
Compare
a002cce to
7ad4420
Compare
Add the replaceable trait to ClaimHtlcTx and ensure the channel sends the corresponding command to the TxPublisher.
These transactions are much simpler than HTLC transactions: we don't add new inputs, we just decrease the output amount and we can unilaterally sign the updated transaction.
7ad4420 to
3d0761b
Compare
There was a problem hiding this comment.
I like how easy this change is! Shows that our model is good.
The ReplaceableTxPublisher deserves some refactoring
A few minor remarks:
- How about renaming
RawTxPublishertoFinalTxPublisher? - Wonder if this precheck should be done when starting the
RawTxPublisheractor, which would then stop right away (same forReplaceableTxPublisher). - This log should make it clear that the existing tx has a higher feerate and that's why we don't replace it (e.g. append
" with higher feerate={}").
eclair-core/src/main/scala/fr/acinq/eclair/transactions/Transactions.scala
Show resolved
Hide resolved
Good idea, it's a better distinction with I'll do this in a follow-up PR.
We can't do that for the
In the next PR (#2113, not yet completely ready for review) I change this to use a deadline instead of an explicit feerate, so I'll fix it there. |
We add
claim-htlctransactions to the set of transactions that we will RBF if they don't confirm quickly.This is important because the feerate is evaluated when we see the remote commitment in the mempool, so it may be outdated by the time we can actually publish the
claim-htlctransaction (either because of the absolute timelock or because the remote commitment took a long time to confirm).It's very simple to set the fees for these transactions: since we can unilaterally sign, we simply decrease the output amount and re-sign. Note that we do it for both standard commitments and anchor output commitments. For standard commitments, these transactions are marked as non-RBFable, so RBF attempts will simply fail if the previous transaction is in the mempool. But it's still worth attempting it, as it may have been dropped from the mempool in high-fee environments.
The
ReplaceableTxPublisherdeserves some refactoring: integrating these various types of transactions shows where the model works and where it doesn't. But I've got a few other changes I'd like to make which impact the architecture, so I'd like to keep it like this for now and refactor after a few more PRs.