You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the generation time, not last seen time, for update timestamps
When we write an update, we have to include a timestamp that
represents both the the time that the client will use to fetch the
next diff and the timestamp used as a reference point when adding
updates to the network graph (the client actually uses the included
timestamp minus two weeks).
Because of the second use, updates were being generated with the
highest timestmap of all included updates, rounded down to the
nearest update-interval multiple (because of the first use).
In practice, because we expect to see many updates in any hour
window, this meant we were really calculating the generation
reference timestamp in a very indirect way. Here we simply change
to using the reference timestamp directly.
This updates regtest results when generating an initial sync
against an empty graph to include a real timestamp, rather than 0,
though this shouldn't impact clients' correctness.
Fixes#95
let delta = super::calculate_delta(network_graph_clone.clone(), current_last_sync_timestamp.clone()asu32,Some(reference_timestamp),self.logger.clone()).await;
124
-
let snapshot_v1 = super::serialize_delta(&delta,1,self.logger.clone());
125
-
let snapshot_v2 = super::serialize_delta(&delta,2,self.logger.clone());
125
+
let snapshot_v1 = super::serialize_delta(&delta,serialized_timestamp,1,self.logger.clone());
126
+
let snapshot_v2 = super::serialize_delta(&delta,serialized_timestamp,2,self.logger.clone());
126
127
127
128
// persist the snapshot and update the symlink
128
129
let snapshot_filename = format!("snapshot__calculated-at:{}__range:{}-scope__previous-sync:{}.lngossip", reference_timestamp, current_scope, current_last_sync_timestamp);
0 commit comments