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

Tap channels liquidity fixes #1120

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

GeorgeTsagk
Copy link
Member

This PR adds some small fixes for liquidity related bugs that were reported on tap channels.

@GeorgeTsagk GeorgeTsagk self-assigned this Sep 10, 2024
@GeorgeTsagk
Copy link
Member Author

"Parent" PR (itest in litd) for more context & linked issues:
lightninglabs/lightning-terminal#842

@coveralls
Copy link

coveralls commented Sep 10, 2024

Pull Request Test Coverage Report for Build 10938152046

Details

  • 0 of 60 (0.0%) changed or added relevant lines in 3 files are covered.
  • 24 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.05%) to 40.364%

Changes Missing Coverage Covered Lines Changed/Added Lines %
server.go 0 2 0.0%
tapchannel/commitment.go 0 23 0.0%
tapchannel/aux_traffic_shaper.go 0 35 0.0%
Files with Coverage Reduction New Missed Lines %
asset/asset.go 2 81.8%
commitment/tap.go 3 84.17%
universe/interface.go 4 50.22%
tapdb/multiverse.go 7 60.32%
tapgarden/caretaker.go 8 68.5%
Totals Coverage Status
Change from base Build 10924632032: -0.05%
Covered Lines: 24211
Relevant Lines: 59981

💛 - Coveralls

@dstadulis dstadulis added this to the v0.4.2 milestone Sep 10, 2024
@GeorgeTsagk GeorgeTsagk force-pushed the tap-chan-liquidity-fixes branch from 3e4f920 to 2ea5adb Compare September 12, 2024 12:38
@GeorgeTsagk GeorgeTsagk marked this pull request as ready for review September 12, 2024 12:44
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice, I think this should work.

tapchannel/commitment.go Outdated Show resolved Hide resolved
tapchannel/commitment.go Outdated Show resolved Hide resolved
tapchannel/commitment.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
tapchannel/aux_traffic_shaper.go Outdated Show resolved Hide resolved
@@ -140,6 +140,33 @@ func (s *AuxTrafficShaper) PaymentBandwidth(htlcBlob,
return linkBandwidth, nil
}

// Get the minimum HTLC amount, which is just above dust.
minHtlcAmt := lnwire.NewMSatFromSatoshis(DefaultOnChainHtlcAmount)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, looking at the previous commit, I wondered if this value needed to be dynamic, based on the channel config's dust limit.
But luckily for lnd to lnd this value is always static: https://github.com/lightningnetwork/lnd/blob/b58fcf73fff36a0ac45e89fac2d7aa589fa6c47b/lnwallet/wallet.go#L1419

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, perhaps worth keeping track of somehow, in case we ever have tap channel between different LN node implementations

@GeorgeTsagk GeorgeTsagk force-pushed the tap-chan-liquidity-fixes branch from 2ea5adb to 67b4d2e Compare September 16, 2024 13:53
@GeorgeTsagk GeorgeTsagk requested a review from guggero September 16, 2024 14:32
@GeorgeTsagk GeorgeTsagk force-pushed the tap-chan-liquidity-fixes branch 2 times, most recently from 1ea6175 to a875044 Compare September 17, 2024 00:23
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Only nits, other than that LGTM 🌮

tapchannel/commitment.go Outdated Show resolved Hide resolved
tapchannel/aux_traffic_shaper.go Outdated Show resolved Hide resolved
tapchannel/aux_traffic_shaper.go Outdated Show resolved Hide resolved
@GeorgeTsagk GeorgeTsagk force-pushed the tap-chan-liquidity-fixes branch from a875044 to ed13ed7 Compare September 18, 2024 16:58
@GeorgeTsagk GeorgeTsagk force-pushed the tap-chan-liquidity-fixes branch from ed13ed7 to a6f5c3e Compare September 19, 2024 09:22
@GeorgeTsagk
Copy link
Member Author

go.mod updated to point to the latest commit of lnd/0-19-staging, which includes the fixes this PR depends on

@GeorgeTsagk GeorgeTsagk requested a review from guggero September 19, 2024 09:27
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Great fixes, thank you! LGTM 🎉

@GeorgeTsagk GeorgeTsagk added this pull request to the merge queue Sep 19, 2024
Merged via the queue into lightninglabs:main with commit 81dd002 Sep 19, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants