Repository navigation
Pay at least the relay floor when the backend minimum is above 1 sat/vB - #70
Merged
Merged
Conversation
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.
When the backend's minimum relay fee is above 1 sat/vB, transactions paid at our floor feerate came out a few satoshis short and bitcoind rejected them. We round the fee down from weight, bitcoind rounds up from vsize, and
FEERATE_FLOOR's slack only covers that gap at 1 sat/vB.This adds
feerate_relay_floor(), the lowest feerate that relays at a given backend minimum for any transaction weight fromMINIMUM_TX_WEIGHTup, and uses it as the floor for transactions we pay for ourselves: estimates, theminimumfeerate keyword, opening, mutual close, anchor fallbacks and onchain sweeps. Feerates we accept from peers still check against the raw backend minimum. At the default 1 sat/vB it returnsFEERATE_FLOOR, so nothing changes there; above it, it adds about 0.75% plus 5 sat/kw.Targets beyond 200 blocks used to return
FEERATE_FLOORregardless of the backend minimum. Delayed sweeps to our wallet always target 300 blocks out, so with a raised minimum they never relayed. They now get the relay floor too, and the onchain sweep loop stops at the relay floor rather thanFEERATE_FLOOR.Tests:
run-feerate_relay_floorbrute-forces the bound across backend minimums and transaction weights.test_penalty_htlc_min_feeratenow also runs at raisedminrelaytxfeevalues; 8 of its 10 variants failed before this change.test_onchain_delayed_sweep_min_feeratefails before this change ("min relay fee not met") and passes after.The wallet weight under-count described in #67 did not reproduce: the funding estimate matches the transaction's actual weight, so there is no change for it.
Fixes #67
Changelog-None