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

Preview block timing #1088

Closed
wants to merge 2 commits into from
Closed

Preview block timing #1088

wants to merge 2 commits into from

Conversation

brennanjl
Copy link
Collaborator

Sets the current block and block timestamp to the most recently seen block if in a call.

@brennanjl
Copy link
Collaborator Author

brennanjl commented Nov 21, 2024

Once this is good to go, I will cherry-pick to main and v0.9. I did it here first because it's at the request of @sapience who is still on preview (v0.8+)

@Yaiba
Copy link
Contributor

Yaiba commented Nov 25, 2024

I'm not familiar with this part of the code, just a question since @charithabandi told me before we already have height/timestamp already in the block header, why don't we just use what's already in the block header?

@jchappelow
Copy link
Member

I'm not familiar with this part of the code, just a question since @charithabandi told me before we already have height/timestamp already in the block header, why don't we just use what's already in the block header?

This is sorta doing just that, although a little roundabout. svc.engine.Procedure could set internally if these fields are -1 or unset, as an alternative. I don't know if that's better or easier though.

@jchappelow
Copy link
Member

Only alternative that comes to mind is that usersvc.(*Service).Call could do:

stat, _ := svc.chainClient.Status(ctx)
height, stamp := stat.Sync.BestBlockHeight, stat.Sync.BestBlockTime

Does that work? I haven't digested the need for the committed vs uncommitted in the current approach.

@brennanjl
Copy link
Collaborator Author

Closed in favor of #1094

@brennanjl brennanjl closed this Nov 26, 2024
@brennanjl brennanjl deleted the preview-block-timing branch November 26, 2024 23:07
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.

3 participants