-
Notifications
You must be signed in to change notification settings - Fork 16
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
[BCF-3381] - Add LatestHead to ChainService #760
Conversation
60c3aab
to
268a136
Compare
d11e398
Timestamp uint64 | ||
Height string | ||
Hash []byte | ||
Timestamp uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are unix timestamps with second precision be sufficiently general? Or do we need more precision? (I suppose we could just add a field later for nanos or something 🤔)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add more precision if needed later, not sure if all chains even give more precision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could use the official protobuf timestamp, which is (seconds int64, nanos int32): https://pkg.go.dev/google.golang.org/protobuf/types/known/timestamppb#Timestamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always find Unix the most universal, what advantage do you see in using protobuf seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always find Unix the most universal, what advantage do you see in using protobuf seconds?
If we expect use add nanos later, then it could be cleaner to use this built-in type instead, which comes with helper methods.
core ref: be3ae431096e0d240e282b4c3233a2d3bb5d832e
starknet ref: 1accbe13d8372cef26c7d252e3e06a182d74ee64
solana ref: 052a8297ee098a740e037ac737f7158025644b32