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
// NOTE: on the wire this value will be *little* endian
81
74
optional fixed32 EpochNanoseconds = 2;
82
75
}
83
76
```
@@ -207,6 +200,21 @@ This scheme would see metadata stored in an external database.
207
200
208
201
The downsides to this are that metadata would not be transferred from one node to another when syncing as [Bitswap] is not aware of the database, and in-tree metadata
209
202
203
+
### TimeSpec protobuf datatype rationale
204
+
205
+
#### EpochSeconds
206
+
207
+
The integer portion of the epoch is represented on the wire using a varint encoding. While this is inefficient for
208
+
negative values, it avoids introducing zig-zag encoding. Negative epoch values will be exceedingly rare, and there
209
+
could very well be value in having such cases stand out, while at the same keeping the "usual" positive values easy
210
+
to eyeball. The varint representing the time of writing this text is 5 bytes long. It will remain so until
211
+
October 26, 3058 ( 34,359,738,367 )
212
+
213
+
#### EpichNanoseconds
214
+
Since fractional values will very often be > 2^28 nanoseconds, that part is represented as a 4-byte `fixed32`,
215
+
[as per google's recommendation](https://developers.google.com/protocol-buffers/docs/proto#scalar).
0 commit comments