-
Notifications
You must be signed in to change notification settings - Fork 166
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
feat: Pool performance data to batches. Per-page fetching, pool join subset. #2057
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rossbulat
commented
Apr 4, 2024
rossbulat
commented
Apr 4, 2024
TingALin
requested changes
Apr 4, 2024
Co-authored-by: Ting A Lin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the fetching of pool performance data, and optimises pool joining UX. Prior to this PR, the app fetched performance data for every bonded pool. This was extremely useful to have as performance data was lacking ecosystem wide, but it came at a severe cost of consuming resources and slowing the app down on initialisation.
This PR now allows pool performance data to be fetched in small batches - a batch is fetched per page when the All Pools tab is visited, as well as a small batch when users click Join Pool. There are numerous other improvements in this PR that are documented below.
Breakdown of Changes
A new
JoinPoolsProvider
has been introduced, that stores a small subset of active bonded pools that are used as a "pool" of pools to join for new stakers. This is prepared on app initialisation, but no performance data is fetched until users explicitly want to join a pool.BondedPools
context, so it is remembered on subsequent pool list visits.PoolPerformance
context has been revamped to host "tasks" metadata for each pool performance batch being processed. Refs have been used within the context to ensure the correct state is being used for updates. Improved type interfaces have been introduced making the structures easier to understand.poolPerformance
worker now accumulates era points where pools have backed multiple validators.listItemsPerPage
default has now been removed in favour of a range of perPage consts for each list type.MaxEraRewardPointsEras
has been decreased from 14 to 10.