Skip to content

Speedup graph_get_allocators - #732

Merged
evgeny-stakewise merged 4 commits into
v5-releasefrom
speedup-graph-allocators
May 22, 2026
Merged

Speedup graph_get_allocators#732
evgeny-stakewise merged 4 commits into
v5-releasefrom
speedup-graph-allocators

Conversation

@evgeny-stakewise

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors graph_get_allocators to reduce the amount of allocator data fetched from the subgraph by first querying eligible redemption vaults (excluding legacy vaults and optionally meta vaults), then querying allocators per vault.

Changes:

  • Split graph_get_allocators into graph_get_redemption_vaults + graph_get_allocators_from_vaults.
  • Moved legacy/meta-vault filtering to the vaults query and added per-vault allocator querying with mintedOsTokenShares_gt: 0.
  • Updated the redemptions graph unit test to exercise the new graph_get_allocators_from_vaults aggregation behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/redemptions/graph.py Refactors allocator fetching into a 2-step vaults-then-allocators flow; adds new helper functions.
src/redemptions/tests/test_graph.py Updates tests to target graph_get_allocators_from_vaults and validate aggregation across multiple vaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/redemptions/graph.py Outdated
Comment thread src/redemptions/graph.py Outdated

@evgeny-stakewise evgeny-stakewise May 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Refactored mocks here, because mocking 'fetch_pages' gets too hard. There are many fetch_pages calls inside graph_get_allocators. Added patch_graph_calls instead.

@evgeny-stakewise
evgeny-stakewise merged commit 23c0cca into v5-release May 22, 2026
6 of 7 checks passed
@evgeny-stakewise
evgeny-stakewise deleted the speedup-graph-allocators branch May 22, 2026 16:45
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.

3 participants