livepeer / livepeer/subgraph

Reduce nested loops in subgraph mappings

Open
#180 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech debt
Dominant language
TypeScript
Stars
5
Forks
7
Avg merge
4h 1m
Merged PRs (30d)
6

Description

Some subgraph mappings use nested loops (e.g. roundsManager.ts broadcaster tracking). While functional today, nested iteration in mappings can become expensive as data grows and may impact indexing performance:

Goal: Refactor mapping logic to avoid nested loops by using more efficient data structures or indexing strategies.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/mappings/roundsManager.ts at the referenced lines 158 and 199, and trace the broadcaster-tracking mapping logic around those handlers. Identify the data structures or indexing strategies used there; done means the mapping avoids nested loops while preserving current behavior and improving indexing efficiency as data grows.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.