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

Add mechanism to get blockhash queue length #10162

Closed

Conversation

CriesofCarrots
Copy link
Contributor

@CriesofCarrots CriesofCarrots commented May 21, 2020

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 also be helpful for clients to be able to estimate how many slots until expiration. getRecentBlockhash returns the slot context of the response, so clients just need the blockhash queue length to track its expiration.

We may also want to be able to change how long a blockhash is valid for, most likely at epoch boundaries.

re: #10054 (comment)

Summary of Changes

  • Add getBlockhashLifespan rpc endpoint. Response includes the relevant epoch, on the assumption that any queue-length changes will be valid for the entire epoch.
  • Plumb getBlockhashLifespan through client
  • Brush up solana fees, and add blockhash-lifespan info to it.
  • Also sneak in a few camelCase tags that were missing in cli_output

@CriesofCarrots CriesofCarrots requested a review from mvines May 21, 2020 18:09
@mvines
Copy link
Member

mvines commented May 21, 2020

docs/src/apps/jsonrpc-api.md 💔

@mvines
Copy link
Member

mvines commented May 21, 2020

Funny thing, I'm currently improving solana ping and this is a thing I could immediately use

@CriesofCarrots CriesofCarrots force-pushed the rpc-blockhash-length branch from c20ca6f to 86c2132 Compare May 21, 2020 18:27
@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label May 21, 2020
@garious garious removed the automerge Merge this Pull Request automatically once CI passes label May 21, 2020
@garious
Copy link
Contributor

garious commented May 21, 2020

What about returning the lifespan via get_recent_blockhash_with_commitment()? And better, what about returning a "valid_through_slot_height" instead of a lifespan. That'd save me the trouble of the next question, where do I get the "birth date" of the blockhash with this "lifespan"?

@codecov
Copy link

codecov bot commented May 21, 2020

Codecov Report

Merging #10162 into master will increase coverage by 0.0%.
The diff coverage is 40.9%.

@@           Coverage Diff           @@
##           master   #10162   +/-   ##
=======================================
  Coverage    81.3%    81.4%           
=======================================
  Files         283      283           
  Lines       66038    66094   +56     
=======================================
+ Hits        53731    53829   +98     
+ Misses      12307    12265   -42     

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