Skip to content

Conversation

@github-actions
Copy link

Backport of #10469


In this commit, we adds extra validation of the channel_update and node_announcement during the decoding process to ensure that the timestamp is not zero. Per BOLT 7:

For channel_update:
  "MUST set timestamp to greater than 0, AND to greater than any
  previously-sent channel_update for this short_channel_id."

In this commit, we add validation for channel updates and node
announcements to ensure that we reject gossip messages with zero
timestamps at the discovery layer.

From BOLT 7:
  "MUST set timestamp to greater than 0, AND to greater than any
  previously-sent channel_update for this short_channel_id."

This validation is performed in the gossip handlers (handleNodeAnnouncement
and handleChanUpdate) rather than at the wire protocol level. This approach
ensures we can still decode messages from disk or embedded in onion errors
while rejecting invalid gossip from peers.

Remote peers sending zero-timestamp gossip will have their ban score
incremented.

(cherry picked from commit cad1b95)
@ziggie1984 ziggie1984 force-pushed the backport-10469-to-v0.20.x-branch branch from fa243ff to 8b471ea Compare January 12, 2026 13:05
Copy link
Collaborator

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

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

LGTM

@ziggie1984 ziggie1984 merged commit 1827699 into v0.20.x-branch Jan 12, 2026
39 checks passed
@ziggie1984 ziggie1984 deleted the backport-10469-to-v0.20.x-branch branch January 12, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants