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

FR: Allow GetBlockRange to stream blocks in descending order #350

Closed
adityapk00 opened this issue May 4, 2021 · 4 comments · Fixed by #355
Closed

FR: Allow GetBlockRange to stream blocks in descending order #350

adityapk00 opened this issue May 4, 2021 · 4 comments · Fixed by #355
Assignees

Comments

@adityapk00
Copy link
Contributor

What is your feature request?
Right now, the GetBlockRange method streams blocks from lowest height to tallest height. For BlazeSync, it might be useful to have the blocks streamed backwards - i.e., tallest height to lowest height. Maybe have an optional parameter that specifies the direction in which to stream blocks

How would this feature help you?
Streaming blocks backwards allows wallets to detect incoming spends quicker, allowing users access to their most recent transactions first.

cc: @LarryRuane , @braddmiller

@LarryRuane
Copy link
Collaborator

This should be easy, just generalize GetBlockRange() to run the loop index either up or down. Rather than adding an optional parameter, it may make sense to just allow start=20, end=10 to mean return 20, 19, ... 10. Currently, those arguments would return an empty list. This approach is almost backward-compatible -- close enough, I think.

@LarryRuane LarryRuane self-assigned this May 5, 2021
@adityapk00
Copy link
Contributor Author

This is a great idea. We should just do this.

@braddmiller
Copy link
Contributor

This looks like a really great solution, adding to our sprint

@braddmiller
Copy link
Contributor

@mdr0id, can we get PR #355 up in our LWD instance for testing?

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 a pull request may close this issue.

3 participants