Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add GetConfirmedBlocksWithLimit RPC method #12599

Merged
merged 1 commit into from
Oct 2, 2020
Merged

Conversation

mvines
Copy link
Contributor

@mvines mvines commented Sep 30, 2020

GetConfirmedBlocks requires that I provide an end_slot or else I get fed up to 500,000 blocks. This is wasteful when I just want to poke around the ledger and return a block or two after a given slot (eg, the first block in an epoch).

To get around this add GetConfirmedBlocksWithLimit, which requires a starting slot and a limit.

Adding a new method seemed conceptually much simpler than trying to shoehorn an optional limit argument at the end of GetConfirmedBlocks. Also GetConfirmedBlocks still has it's uses (ie, when I want to fetch all confirmed blocks in a given epoch) so it deserves to continue to exist as a non-deprecated method alongside GetConfirmedBlocksWithLimit

@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #12599 into master will increase coverage by 0.0%.
The diff coverage is 87.8%.

@@           Coverage Diff           @@
##           master   #12599   +/-   ##
=======================================
  Coverage    82.1%    82.1%           
=======================================
  Files         358      358           
  Lines       83580    83650   +70     
=======================================
+ Hits        68630    68698   +68     
- Misses      14950    14952    +2     

@mvines mvines requested a review from CriesofCarrots October 2, 2020 04:12
@mvines
Copy link
Contributor Author

mvines commented Oct 2, 2020

@CriesofCarrots - wdyt?

Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

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

Wfm, I will definitely make use of it! The request_processor method internals could be deduped, but they are simple enough that it feels like more trouble than it's worth.

@mvines
Copy link
Contributor Author

mvines commented Oct 2, 2020

The request_processor method internals could be deduped, but they are simple enough that it feels like more trouble than it's worth.

My thinking as well, not worth the trouble.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants