forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[explorer] batch queryEvent calls using the max page limit size of 10…
…00 to fix APY calculations (MystenLabs#10117) ## Description When we fetch validator events in the Explorer, we say that the limit is `30 * numValidators` which on testnet is 2850. The problem is that the `queryEvents` API has a maximum page size of `1000`, so the limit we were providing was causing the API to error out. To fix this, we can batch the API calls together when the limit exceeds the maximum page size. So if we did have 2850 events, we'd fetch 1000 -> fetch another 1000 -> fetch the remaining 850. One thing to note is that there are only 190 validator events (2 completed epochs * 95 validators) thus far, so this batching functionality isn't actually being used at the moment. ## Test Plan - Manual testing on devnet with: - 4 validators and a query limit of 1 - 4 validators and a query limit of 1000 - 4 validators with an event limit of 5 and a query limit of 1 - Manual testing on testnet with: - 95 validators and a query limit of 50 - 95 validators and a query limit of 1000 - 95 validators with an event limit of 5 and a query limit of 2 (limit truncation case) --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [X] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes N/A
- Loading branch information
1 parent
1cd7ced
commit 121f00f
Showing
4 changed files
with
51 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
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