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
{{ message }}
Repository navigation
Swap announcement/update serials for block timestamp. #493
We currently just send serials in update/announcement messages as a monotonically increasing number, but other implementations (incorrectly) assume that they are actually timestamps. We should just use the last block timestamp since thats easy to access.
Are they currently treated differently in the BOLTs? IIRC they are both explicitly allowed to be anything that increases, but are called "timestamp"s and others treat them as timestamps (when they are not).
"MUST set timestamp to greater than 0, AND to greater than any previously-sent channel_update for this short_channel_id SHOULD base timestamp on a UNIX timestamp " (channel update)
"MUST set timestamp to be greater than that of any previous node_announcement it has previously created MAY base it on a UNIX timestamp" (node announcement)
So yes a divergence, but more broadly if everyone interpret them as UNIX timestamps it should be mandatory to avoid confusion. Or some kind of semantic like nLocktime to either unix or block height.
Hmm, interesting. Either way we should get both removed from the spec and clarify that nothing should depend on timestamps being any more accurate than the latest block time (though I don’t know that it makes sense to allow anything as it does now, since efficient graph sync will likely rely on it).
On Feb 11, 2020, at 16:02, Antoine Riard ***@***.***> wrote:
"MUST set timestamp to greater than 0, AND to greater than any previously-sent channel_update for this short_channel_id SHOULD base timestamp on a UNIX timestamp " (channel update)
"MUST set timestamp to be greater than that of any previous node_announcement it has previously created MAY base it on a UNIX timestamp" (node announcement)
So yes a divergence, but more broadly if everyone interpret them as UNIX timestamps it should be mandatory to avoid confusion. Or some kind of semantic like nLocktime to either unix or block height.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Hmm, interesting. Either way we should get both removed from the spec and clarify that nothing should depend on timestamps being any more accurate than the latest block time (though I don’t know that it makes sense to allow anything as it does now, since efficient graph sync will likely rely on it).
Activity
ariard commentedon Feb 11, 2020
Fix BOLT to align node_announcement timestamp encoding on the channel_update one ?
TheBlueMatt commentedon Feb 11, 2020
Are they currently treated differently in the BOLTs? IIRC they are both explicitly allowed to be anything that increases, but are called "timestamp"s and others treat them as timestamps (when they are not).
ariard commentedon Feb 12, 2020
"MUST set timestamp to greater than 0, AND to greater than any previously-sent channel_update for this short_channel_id SHOULD base timestamp on a UNIX timestamp " (channel update)
"MUST set timestamp to be greater than that of any previous node_announcement it has previously created MAY base it on a UNIX timestamp" (node announcement)
So yes a divergence, but more broadly if everyone interpret them as UNIX timestamps it should be mandatory to avoid confusion. Or some kind of semantic like nLocktime to either unix or block height.
TheBlueMatt commentedon Feb 12, 2020
Updates generated after a blockget a serial >= the block's timestamp
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
Use block timestamps as the min for generated update messages.
jkczyz commentedon Mar 5, 2020
Is there an open issue for this in the spec?
Use block timestamps as the min for generated update messages.
TheBlueMatt commentedon Mar 6, 2020
Apparently there is not. I noted what needs to happen on lightning/bolts#584 (comment)
Use block timestamps as the min for generated update messages.