<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 14, 2022 at 3:18 PM Jim Newsome <<a href="mailto:jnewsome@torproject.org">jnewsome@torproject.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/14/22 11:44, Nick Mathewson wrote:<br>
<br>
<snip><br>
<br>
 > Currently Tor relays use a 4-byte timestamp (in seconds since the Unix<br>
 > epoch) in their NETINFO cells.  Notoriously, such a timestamp will<br>
 > overflow on 19 January 2038.<br>
 ><br>
 > Let's get ahead of the problem and squash this issue now, by expanding<br>
 > the timestamp to 8 bytes. (8 bytes worth of seconds will be long enough<br>
 > to outlast the Earth's sun.)<br>
<br>
<snip><br>
<br>
With all those extra bits, would there be any value to using a more <br>
granular time measure? e.g. microseconds?<br></blockquote><div><br></div><div><span class="gmail-im"><div><br></div></span><div>I
 don't think so, necessarily.  We aren't doing full NTP here; in fact, 
we're just trying to detect clock skew that's big enough to break Tor.  
(Like, on the order of hours.)  I don't think we'll get anything useful 
 out of sub-second observations.<br></div><span class="gmail-im"><div> </div></span> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If not, would it be worth saving some bytes and only expanding to 5 <br>
bytes? (I know; it *feels* wrong, but I can't think of much real downside)<br></blockquote><div><br></div><div><div> Hm, possibly.  One downside is that 5-byte decoder/encoder 
functions aren't exactly common, so we'd require everybody to build 
one.  (Or to do something like <br></div><div>  u8 ts_high;</div><div>  u32 ts_low;</div><div>)</div><div><br></div><div>Since the extra 3 bytes are only used once per connection attempt, I'm pretty comfortable letting them be useless until 36812 CE or whenever.<br></div> </div></div></div>