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

Set timestamp filter lower bound to current time #837

Merged
merged 1 commit into from
Jan 28, 2019

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Jan 28, 2019

We previously assumed that the gossip_timestamp_filter only applied to
future messages, so we set first_timestamp to 0 in order to have a
pass-all filter.

But BOLT 7 actually says that the remote peer:

SHOULD send all gossip messages whose timestamp is greater or equal to
first_timestamp, and less than first_timestamp plus timestamp_range

Which means that the way our filter was set, the remote peer would dump
the entire routing table on us.

By setting first_timestamp to the current time, we achieve what we
want. The synchronization of older messages is done by sending a
query_channel_range and then one or several query_short_channel_ids.

We previously assumed that the `gossip_timestamp_filter` only applied to
future messages, so we set `first_timestamp` to 0 in order to have a
pass-all filter.

But BOLT 7 actually says that the remote peer:
> SHOULD send all gossip messages whose timestamp is greater or equal to
first_timestamp, and less than first_timestamp plus timestamp_range

Which means that the way our filter was set, the remote peer would dump
the entire routing table on us.

By setting `first_timestamp` to the current time, we achieve what we
want. The synchronization of older messages is done by sending a
`query_channel_range` and then one or several `query_short_channel_ids`.
@pm47 pm47 requested a review from sstone January 28, 2019 14:27
@pm47 pm47 merged commit 3954e39 into master Jan 28, 2019
@pm47 pm47 deleted the query-timestamp-filter branch January 28, 2019 14:58
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.

2 participants