1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-20 02:27:32 +01:00
eclair/eclair-core
Pierre-Marie Padiou 2c1811d18f
Remember pruned channels (#706)
Currently we don't remember channels that we have pruned, so we will happily revalidate the same channels again if a node re-sends them to us, and prune them again, a.k.a. the "zombie churn".

Before channel queries, rejecting a stale channel without validating it wasn't trivial,  because nodes sent us the `channel_announcement` before `channel_update`s, and only after receiving the `channel_update` could we know if the channel was still stale. Since we had no way of requesting the `channel_announcement` for one particular channel, we would have to buffer it, which would lead to potential DOS issues. 

But now that we have channel queries, we can now be much more efficient. Process goes like this:
(1) channel x is detected as stale gets pruned, and its id is added to the pruned db
(2) later on we receive a `channel_announcement` from Eve, we ignore it because the channel is in the pruned db
(3) we also receive old `channel_update`s from Eve nodes, just ignore them because we don't know the channel
(4) then one day some other node George sends us the `channel_announcement`, we still ignore it because the channel is still in the pruned db
(5) but then George sends us recent `channel_update`s, and we know that the channel is back from the dead. We ignore those `channel_update`s, but we aldo remove the channel id from the pruned db, and we request announcements for that node from George
(6) George sends us the `channel_announcement` again, we validate it
(7) George then sends us the `channel_update`s again, we process them
(8) done!

This also allows removing the pruning code that we were doing on-the-fly when answering to routing table sync requests.

Needless to say that this leads to a huge reduction in CPU/bandwidth usage on well-connected nodes.

Fixes #623, #624.
2018-09-17 18:30:10 +02:00
..
src Remember pruned channels (#706) 2018-09-17 18:30:10 +02:00
eclair-cli Fixed some logs and added ChannelPersisted event (#674) 2018-08-15 14:39:19 +02:00
pom.xml Electrum: add wallet and watcher tests (via Docker) (#592) 2018-06-27 14:34:02 +02:00