discovery: add detailed comment.

Describe why it is ok to resurrect zombie channels based on the
timestamp of the `ReplyChannelRange` msg although its not verifiable
data.
This commit is contained in:
ziggie 2024-08-14 22:02:57 +02:00 committed by Olaoluwa Osuntokun
parent 44413868c7
commit d906010508

View file

@ -2143,6 +2143,21 @@ func (c *ChannelGraph) FilterKnownChanIDs(chansInfo []ChannelUpdateInfo,
zombieIndex, scid, zombieIndex, scid,
) )
// TODO(ziggie): Make sure that for the strict
// pruning case we compare the pubkeys and
// whether the right timestamp is not older than
// the `ChannelPruneExpiry`.
//
// NOTE: The timestamp data has no verification
// attached to it in the `ReplyChannelRange` msg
// so we are trusting this data at this point.
// However it is not critical because we are
// just removing the channel from the db when
// the timestamps are more recent. During the
// querying of the gossip msg verification
// happens as usual.
// However we should start punishing peers when
// they don't provide us honest data ?
isStillZombie := isZombieChan( isStillZombie := isZombieChan(
info.Node1UpdateTimestamp, info.Node1UpdateTimestamp,
info.Node2UpdateTimestamp, info.Node2UpdateTimestamp,