-
Notifications
You must be signed in to change notification settings - Fork 7
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
Enhanced Pooler Efficiency for Smaller Epoch Sizes #43
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
… cleanups, logging and other minor improvements, dependency updates
…finalized epoch calculations
… data (if needed), bug fix in caching submitted base snapshots
…ding failures, increase connection limits for workers
anomit
approved these changes
Aug 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since changes has been observed running stably in staging instances
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.
Fixes #42
Checklist
Current Behavior
The current behavior of the pooler, as outlined in issue #42, demonstrates peak efficiency when employed with larger epoch sizes. However, the performance falters significantly when attempting to utilize the pooler with an epoch size set to 1. This issue initiates a cascading sequence of problems, beginning with the failure of the 24-hour trade volume aggregate computation. This failure subsequently disrupts the entire workflow, rendering it non-operational.
Proposed Changes and Solutions
Drawing from the insights provided in the issue description, the root cause of this issue stems from the intricate nature of the 24-hour trade volume aggregate calculation. The current implementation relies heavily on prior finalized epoch data to execute efficient computations, referencing data from the previous epoch. Unfortunately, the brief time window of
12 seconds
(as observed with ETH) allotted for the finalization of the last epoch is inadequate. Consequently, a full recalculation is triggered for each epoch, leading to the retrieval of extensive data from either the RPC or the local Cache.This excessive data retrieval results in a surge of RPC requests and subsequent Rate Limit errors, creating a domino effect of failures that incapacitate the entire system.
To address this challenge, I propose a comprehensive redesign of the 24-hour trade volume aggregate calculation. The suggested approach revolves around eliminating the dependency on finalized calculations and instead capitalizing on locally stored base snapshots submitted by the snapshotter for the latest unfinalized epochs. This strategic shift in methodology will significantly optimize the system's overall efficiency, paving the way for seamless support of an epoch size equal to 1.
This enhancement holds the potential to surmount the existing challenges and to elevate the pooler's functionality significantly, spanning a wide range of epoch sizes.
Impact of Changes
Deployment Instructions
To integrate these transformative changes, follow these steps:
Updated 24h Trade Volume Aggregation Workflow