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

Rpc: add getBlockhashLastValidSlot endpoint #10237

Conversation

CriesofCarrots
Copy link
Contributor

Problem

It can be crucial for clients to know if a particular blockhash has expired. getFeeCalculatorForBlockhash offers one way to test this, but it would be a lot easier to know the expiration slot concretely.

re: #10054 (comment)

Summary of Changes

  • Add getBlockhashLastValidSlot rpc endpoint, and expose in RpcClient::get_recent_blockhash_with_commitment

I've left application of blockhash_last_valid_slot in various solana client crates, like solana-tokens, solana-bench-tps, or solana-cli ping, for separate prs. In particular, solana-bench-tps would require exposing blockhash_last_valid_slot in ThinClient (perhaps via the Client trait), and so deserves additional consideration.

Incidentally, another approach could be to return the last-valid-slot with every getRecentBlockhash query, but it requires a lot more churn and very careful rollout, as there's a lot of potential to break downstream clients.

Closes #10162

Copy link
Contributor

@garious garious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should need to make two round-trips to get both a recent blockhash and its "good through" date. How about just one endpoint to get both?

@CriesofCarrots CriesofCarrots deleted the rpc-get-blockhash-last-valid-slot branch May 26, 2020 23:29
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.

2 participants