Skip to content

Delete channel alias scids when quotes expire #1710

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GeorgeTsagk
Copy link
Member

@GeorgeTsagk GeorgeTsagk commented Aug 6, 2025

Description

Previously when we'd garbage collect quotes we'd only delete the quote entry locally on tapd. What we didn't do is clear the state that was produced in LND, which keeps track of alias scid -> base scid mappings to facilitate routing.

We use the new method XFindBaseLocalChanAlias to retrieve the base scid that corresponds to our quotes, and then we call LND to delete the alias.

Depends on:
lightningnetwork/lnd#10133
lightninglabs/lndclient#236

@GeorgeTsagk GeorgeTsagk self-assigned this Aug 6, 2025
Comment on lines +889 to +892
// Start the main event loop in a separate go routine.
h.Wg.Add(1)
go func() {
defer h.Wg.Done()
Copy link
Contributor

Choose a reason for hiding this comment

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

we could use h.ContextGuard.Goroutine here (and above if you like)

@GeorgeTsagk
Copy link
Member Author

Need to bump configured go version to 1.23.10 since this LND PR also bumps it

@GeorgeTsagk GeorgeTsagk force-pushed the delete-expired-scids branch from cc99a90 to 5a74347 Compare August 6, 2025 13:50
We use the new LND RPC endpoint that looks up the base scid for an
alias, in order to use it to delete the mapping shortly after. In
addition we break the order handler main loop into it's go routine,
which was previously never really running as it followed the HTLC
interceptor setup which was a blocking call.
@GeorgeTsagk GeorgeTsagk force-pushed the delete-expired-scids branch from 5a74347 to 08f114e Compare August 6, 2025 13:53
Copy link

github-actions bot commented Aug 6, 2025

Pull Request Test Coverage Report for Build 16778492979

Details

  • 5 of 41 (12.2%) changed or added relevant lines in 3 files are covered.
  • 107 unchanged lines in 17 files lost coverage.
  • Overall coverage increased (+0.7%) to 56.405%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lndservices/router_client.go 0 4 0.0%
rfq/order.go 4 36 11.11%
Files with Coverage Reduction New Missed Lines %
fn/context_guard.go 1 88.71%
rfq/order.go 1 57.88%
fn/iter.go 2 62.07%
mssmt/compacted_tree.go 4 80.51%
rpcperms/interceptor.go 4 79.57%
rpcserver.go 4 61.46%
tapdb/sqlc/transfers.sql.go 4 82.53%
tapgarden/caretaker.go 4 76.93%
tapdb/assets_common.go 5 77.8%
asset/asset.go 6 79.65%
Totals Coverage Status
Change from base Build 16778309360: 0.7%
Covered Lines: 59172
Relevant Lines: 104905

💛 - Coveralls

@GeorgeTsagk
Copy link
Member Author

For the LiT tests I'll have to make a PR that bumps all versions that are included with this PR
https://github.com/lightninglabs/taproot-assets/actions/runs/16778944176/job/47512051701?pr=1710#step:10:1022

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.

2 participants