livepeer / livepeer/go-livepeer

Legacy gas limits prohibit Livepeer Payments in BYOC

Open
#3,746 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: triage
Dominant language
Go
Stars
586
Forks
226
Avg merge
1d 17h
Merged PRs (30d)
19

Description

might be Relevant to the issue: https://github.com/livepeer/go-livepeer/issues/3744

Impact: High. Cannot process BYOC jobs into Livepeer.

Problem: When trying to sent Micropayments to a Bring your own container(BYOC) type of job using the Livepeer go implementation for a Gateway and Orchestrator the job request is not able to be processed. The Orchestrator and gateway containers show the following errors:

  • Gateway Error:
    job_id= capability=<capability name> processing job request job_id= capability=<capability name> Failed to get token from Orchestrator [<orchestrator url>⁠](<orchestrator url>) err=<nil>

  • Orchestrator error:
    could not get ticket params err=insufficient sender reserve but is think it s on your side now

Gateway Config

`services:
gateway:
image: livepeer/go-livepeer:latest
container_name: vtuber_network-gateway-test
volumes:
- ./data/gateway:/data
ports:
- 9999:9999
command: [
"-gateway",
"-orchAddr=,
"-orchSecret=${LIVEPEER_ORCH_SECRET:-orch-secret}",
"-httpAddr=gateway:9999",
"-httpIngest=true",
"-maxTicketEV=17000000000000",
"-maxTotalEV=17000000000000",
"-maxFaceValue=1000000000000000",
"-maxPricePerUnit=17000000000000",
"-network=arbitrum-one-mainnet",
"-ethUrl=https://arb1.arbitrum.io/rpc",
"-ethPassword=",
"-dataDir=/data",
"-v=6",
]
networks:
- default

networks:
default:
name: vtuber_network
external: true`

Orchestrator Config
`#############################################

Livepeer VTuber environment

#############################################

------------ Livepeer orchestrator (go-livepeer) ------------

LIVEPEER_NETWORK=arbitrum-one-mainnet
ORCHESTRATOR_PORT=9995
LIVEPEER_ORCH_SECRET=
ETH_RPC_URL=
ETH_PASSWORD_FILE=/root/.lpData/.ethpass # Mount config/ethpass with the keystore password
ETH_ADDRESS=
ETH_ORCH_ADDRESS=
PRICE_PER_UNIT=16000000000000
TICKET_EV=16000000000000
AUTO_ADJUST_PRICE=false
MAX_GAS_PRICE=1000000000

------------ Worker registration ------------

LIVEPEER_ORCH_URL=https://vtuber.ultimaratio.link:9995
LIVEPEER_ORCH_SKIP_VERIFY=true
ORCHESTRATOR_HOST=# public IP or hostname for serviceAddr, e.g. 65.188.126.223
CAPABILITY_NAME=Frank111 # IMPORTANT: Fill the capability name that you gave us in the form here!

CAPABILITY_PRICE_PER_UNIT=16000000000000

CAPABILITY_PRICE_PER_UNIT=0

------------ Pixel Streaming / Unreal ------------

VTUBER_SESSION_DIR=/home/ubuntu/vtuber_sessions
VTUBER_TCP_HOST=host.docker.internal
VTUBER_TCP_PORT=7777`

Livepeer request code:

` def create_livepeer_headers(self, capability_config: Dict[str, str]) -> Dict[str, str]:
"""Create proper Livepeer headers for gateway requests, including extra timeouts"""
job_header = base64.b64encode(json.dumps({
"request": json.dumps({"run": capability_config["run_command"]}),
"parameters": json.dumps({}),
"capability": capability_config["capability_name"],
"timeout_seconds": 1
}).encode()).decode()

    headers = {
        'Content-Type': 'application/json',
        'Livepeer': job_header,
        'Livepeer-Orch-Search-Timeout': '2s',
        'Livepeer-Orch-Search-Resp-Timeout': '1s'
    }
    return headers
    `

How our logic works:
Our script sends one payment request x seconds, you can think of this as Total Ticket EV = Payment for x seconds of hosting our app.

What is happening:
Legacy network perceives this as a "transcoding" request offered for a huge payment. From a logical perspective such edge cases where either prohibited from Go-Livepeer logic or if not programmatically prohibited should had received less rigorous testing. But could also be due to incorrect gas calculation from Legacy Arbitrum state

Suggestion for resolution:
As a temporary solution we can set a tested PRICE_PER_UNIT variable and multiply with y = timeout_seconds variableto reach TICKET_EV=16000000000000 then still route that job request as we would normally do. But this is not guarantee to work properly at all times if the issue is due to legacy gas calculation rather than hardcoded limits

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

Reproduce the BYOC payment request with the supplied Gateway and Orchestrator configurations, then start at the orchestrator ticket-parameter path that reports “insufficient sender reserve” and trace the corresponding gateway token-fetch failure. Done means a BYOC job request can process its payment on arbitrum-one-mainnet without the reserve or ticket-parameter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
backend, blockchain, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.