Skip to content
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

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

ilija42
Copy link
Contributor

@ilija42 ilija42 commented Sep 10, 2024

core ref: be3ae431096e0d240e282b4c3233a2d3bb5d832e
starknet ref: 1accbe13d8372cef26c7d252e3e06a182d74ee64
solana ref: 052a8297ee098a740e037ac737f7158025644b32

Atrax1
Atrax1 previously approved these changes Sep 11, 2024
Farber98
Farber98 previously approved these changes Sep 11, 2024
Timestamp uint64
Height string
Hash []byte
Timestamp uint64
Copy link
Collaborator

@jmank88 jmank88 Sep 11, 2024

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 🤔)

Copy link
Contributor Author

@ilija42 ilija42 Sep 11, 2024

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?

Copy link
Collaborator

@jmank88 jmank88 Sep 11, 2024

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

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

@ilija42 ilija42 merged commit 27a338b into main Sep 11, 2024
8 of 9 checks passed
@ilija42 ilija42 deleted the BCF-3381-expose-latest-heads branch September 11, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants