Repository navigation
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
The RBF splice test builds its own bitcoind with a lower incrementalrelayfee so that LDK's minimum RBF bump of 25 sat/kwu satisfies BIP125's absolute fee increase requirement. Upcoming tests that fee-bump a splice_in_with_all splice need the same setup, so make it a helper next to setup_bitcoind_and_electrsd. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
splice_in_with_all estimated the maximum amount with a wallet drain and then ran coin selection for that exact amount. The resulting contribution had at most the anchor reserve as a change output, so bump_channel_funding_fee had nothing else to pay a higher fee from. With anchor channels enabled, the bump shrank the change output and so spent the reserve on the splice fee. Without a reserve there was no change output at all; LDK keeps the value added fixed for coin-selected contributions, so the bump fell back to coin selection, which failed for want of further inputs. The drain estimate also ran at the funding feerate estimate while the contribution could be built at a pending splice's higher RBF minimum, so coin selection for that amount could eat into the reserve or fail. Instead, hand LDK the wallet's confirmed UTXOs as manually selected inputs. They are consumed in full with no change output, the amount added to the channel is whatever remains after fees at the template's feerate, and a later fee bump is paid by adding a little less to the channel. When an anchor reserve is required, it is kept as an explicit output back to one of the wallet's own addresses, which stays fixed across bumps. That address is marked used as soon as it is handed out, since the splice transaction only reaches the wallet once negotiation completes and until then BDK would offer the same address as change elsewhere. The mark is dropped again if the contribution cannot be built or LDK rejects it. Insufficient-funds checks stay in front of LDK, which would otherwise build a near-empty contribution. The drain-based splice estimate is removed along with the shared-input handling in the drain helpers that only it used. Fixes lightningdevkit#1168. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
jkczyz
force-pushed
the
2026-10-splice-in-with-all-manual-inputs
branch
from
October 16, 2026 21:38
173105a to
fbaa8d4
Compare
This file contains hidden or 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
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.
Fixes #1168.
Node::splice_in_with_allestimated the maximum amount with a wallet drain and then ran coin selection for that exact amount. The resulting contribution had at most the anchor reserve as a change output, sobump_channel_funding_feehad nothing else to pay a higher fee from. With anchor channels enabled, the bump shrank the change output and spent the reserve on the splice fee. Without a reserve there was no change output at all, so the bump failed withChannelSplicingFailed. The drain estimate also ran at the funding feerate estimate while the contribution could be built at a pending splice's higher RBF minimum.This PR instead hands LDK the wallet's confirmed UTXOs as manually selected inputs (
FundingBuilder::add_inputs). They are consumed in full with no change output, the amount added to the channel is whatever remains after fees at the template's feerate, and a later fee bump is paid by adding a little less to the channel. When an anchor reserve is required, it is kept as an explicit output back to one of the wallet's own addresses, which stays fixed across bumps.The reserve address is marked used in BDK as soon as it is handed out, since the splice transaction only reaches the wallet once negotiation completes and until then BDK would offer the same address as change elsewhere. The mark is dropped again if the contribution cannot be built, or via
DiscardFundingif LDK rejects it.Insufficient-funds checks stay in front of LDK, which would otherwise build a near-empty contribution. The drain-based splice estimate is removed along with the shared-input handling in the drain helpers that only it used.
The first commit extracts the low
-incrementalrelayfeebitcoind setup used by the splice RBF tests into a shared helper, since the new tests need it too.Tests
splice_in_with_all_bump_fee_retains_anchor_reserve: splice in with all funds with an anchor reserve, bump the fee, and check the bump succeeds, the amount added to the channel drops by exactly the fee increase, and the on-chain balance after confirmation still holds the reserve.splice_in_with_all_bump_fee_without_anchor_reserve: same without a reserve, where the bump previously failed outright.Both integration tests fail on
main: with a reserve the bump leaves the spliced-in amount unchanged while the fee rises, i.e. it is paid from the reserve; without a reservebump_channel_funding_feereturnsChannelSplicingFailed.🤖 Generated with Claude Code