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

Fix gossip timestamps set to a future date #211

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

matheusd
Copy link
Member

This fixes an issue in the deployed network where nodes sending ChannelUpdates and NodeAnnouncements set to a future timestamp could cause the gossip syncer to fail to fetch new announcements.

The issue stems from the fact that the gossip syncer stores the timestamp of the last received message and uses that, upon restart, to fetch new messages. An update with a timestamp in the future propagating through the network would cause the syncer to fail to fetch new updates.

This PR fixes the issue by amending the handling of future timestamps in the syncer and by performing a database migration that rewinds any timestamps stored that are set to a future date.

This adds a migration that removes gossip timestamps that are in the
future from the database of last received peer gossip timestamp.

This fixes issues that could lead to lack of routing information when
the peer wrongly sent a date in the future as the timestamp for a
channel update or node announcement.
This adds some handling for gossip timestamps in the future.

Previously, a wrongly configured node could send channel updates or node
announcements with a timestamp in the future, and the propagation of
such timestamps would cause the local node to record a time in the
future as the most recent timestamp received via gossip.

This would cause that, on restarts, the node would install a gossip
timestamp horizon far in the future, causing it to miss channel updates
and node announcements and breaking pathfinding.

This fixes the immediate handling of future timestamps in the gossiper,
while a future commit will fix the existing database entries with a
migration.

The fix in the gossiper involves disregarding future timestamps for the
purposes of storing it in the db, and (for future proofing against
this error happening again) not using such timestamps in case they are
actually saved in the db.
@matheusd matheusd merged commit a9cd7e4 into decred:master Mar 26, 2024
9 checks passed
@matheusd matheusd deleted the future-gossip-ts branch March 26, 2024 14:13
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

Successfully merging this pull request may close these issues.

None yet

2 participants