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

Protect against channel_announcements from channels that are already spent #2975

Open
t-bast opened this issue Jan 6, 2025 · 0 comments
Open
Assignees

Comments

@t-bast
Copy link
Member

t-bast commented Jan 6, 2025

In #2936, we changed WatchExternalChannelSpent to be a WatchSpent instead of a WatchSpentBasic. One of the consequences is that whenever we receive a channel_announcement, we will call checkSpent:

private def checkSpent(w: WatchSpent[_ <: WatchSpentTriggered]): Future[Unit] = {

If the announcement is from a utxo that has been spent a long time ago, we go through client.lookForSpendingTx which iterates over blocks and is very inefficient. It's important to go through this process for our own channels, but for external channels this can be used as a DoS vector.

I'm not sure what exactly we should do: if we don't look into the blockchain, we won't find the spending tx and thus cannot wait 12 blocks before removing the channel. But if we look into the blockchain, that's expensive and can be abused...

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

No branches or pull requests

2 participants