Skip to content

Protect against channel_announcements from channels that are already spent #2975

@t-bast

Description

@t-bast

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...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions