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

Introduce optional pagination to ChainProcessor #5068

Merged
merged 2 commits into from
Jun 25, 2024
Merged

Conversation

NullSoldier
Copy link
Contributor

Summary

This adds similar optional pagination that the RemoteChainProcessor has to the ChainProcessor. This is useful if you want to stop after a certain amount of blocks to perform other work.

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes


blockCount++
if (this.maxQueueSize && blockCount >= this.maxQueueSize) {
return { hashChanged: !oldHash || !this.hash.equals(oldHash) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: given that this is repeated in multiple places, we could have an anonymous fn like this:

const returnValue = () => ({ hashChanged: !oldHash || !this.hash.equals(oldHash) })

and then change all the return { ... } statements to:

return returnValue()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have one more recommendation for this that I put in another PR here, #5073.

Base automatically changed from jason/chainprocessor to staging June 25, 2024 04:33
@NullSoldier NullSoldier marked this pull request as ready for review June 25, 2024 04:46
@NullSoldier NullSoldier requested a review from a team as a code owner June 25, 2024 04:46
@NullSoldier NullSoldier merged commit 30bba2f into staging Jun 25, 2024
6 checks passed
@NullSoldier NullSoldier deleted the jason/pagination branch June 25, 2024 05:00
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