livepeer / livepeer/go-livepeer-basicnet

Replace StreamID with an opaque bigint

Open
#31 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
18
Forks
6
PR merge metrics
No merged PRs in 30d

Description

For a Livepeer node, this corresponds to the JobID, from which the StreamID can be looked up easily on-chain. Other off-chain applications can use the bigint as a lookup key.

Currently, the only time StreamID is used concretely within basicnet is to determine the broadcaster's NodeID. We should be able to work around this. Treat the ID as an opaque identifier that's used only by the API consumer, not basicnet.

Benefits:

* The StreamID right now is not a canonical identifier; we need to maintain a reverse lookup table for the JobID to find any transcoder information. This is additional bookkeping that we should avoid.
* Concretely, solves this issue https://github.com/livepeer/go-livepeer-basicnet/issues/21#issuecomment-369310870
* Doesn't make assumptions about the structure of the StreamID within basicnet. This reduces coupling with Livepeer -- other systems might not want to make the same assumptions about their bookkeeping.
* Further decouples basicnet from Livepeer; keeping this identifier opaque means any changes to the ID in Livepeer doesn't necessitate changes in basicnet.

Contributor guide

No contributing guide indexed for this repository

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

No file or test path is named. Start by tracing StreamID references in basicnet, especially the logic that determines the broadcaster's NodeID, and inspect issue #21 for context; done means the identifier is an opaque bigint and basicnet no longer depends on its internal structure or reverse lookups.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.