livepeer / livepeer/go-livepeer

Optimize fetching transcoder pool

Open
#2,328 7 comments 0 reactions 1 assignee View on GitHub

@RiccardoBiosas is already working on this.

Since Mar 18, 2022.

area: blockchain status: core contributors working on it
Dominant language
Go
Stars
586
Forks
226
Avg merge
1d 17h
Merged PRs (30d)
19

Description

Livepeer fetches all active orchestrators from the chain. It happens in the function TranscoderPool(), which is called in a number of scenarios:

Fetching orchestrators happens sequentially. Each transcoder is fetched by calling the on-chain contract function GetNextTranscoderInPool(). This process already takes almost 2 min and it will grow linearly together with the number of active orchestrators.

We need to research and implement an optimization to this process. Some first ideas:

  • Use Subgraph with indexed chain data
  • Create a smart contract which stores the orchestrator pool on-chain
  • Cache active orchestrator pool in the local DB

I suggest to first research the domain of solutions, describe and review them, and when we agree on the solution, finally do the actual implementation.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.