Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Conversation

@ursulabauer
Copy link

I’ve implemented several important improvements to the delegation handling logic for better performance and efficiency:

  1. Delegation Caching:

    • I’ve added a caching mechanism to store delegation data for specific combinations of space, network, and snapshot. This significantly reduces the need for repeated requests to the subgraph, improving the overall performance when querying delegation data multiple times, especially for large sets of addresses.
  2. Reverse Delegation Mapping:

    • A new function getDelegationReverseData was introduced to ensure that we store both the delegator and delegate addresses in a reversed mapping. This improves the structure of delegation data and makes it more efficient to look up delegators for any given address.
  3. Optimized Data Retrieval:

    • The delegations are now retrieved more efficiently by filtering and mapping only the necessary data. This makes the logic cleaner and more optimized.
  4. Improved Data Return:

    • The getDelegationsData function has been refactored to provide a more structured and efficient way of returning delegation data, including the list of delegators for each address and a full list of all unique delegators.

These changes not only streamline the delegation process but also enhance scalability and performance by reducing unnecessary computations and improving data handling efficiency.

@ursulabauer ursulabauer closed this by deleting the head repository Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant