Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
createStream in backend/src/controllers/stream.controller.ts (line ~80) computes:
endTime: parseInt(startTime) + Number(BigInt(depositedAmount) / BigInt(ratePerSecond))
If ratePerSecond is "0", BigInt("0") divisor throws RangeError: Division by zero, which falls into the generic catch and returns a 500. This endpoint (POST /v1/streams) currently has no validation middleware wired (the createStreamSchema regex ^\d+$ would still allow "0" even once wired in #452), and no try/parse guard on the inputs, so malformed bodies crash with an opaque 500.
This is the same class of bug as the indexer div-by-zero (#450) but in a different file and code path.
Acceptance criteria
Files to touch
backend/src/controllers/stream.controller.ts
Out of scope
Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
createStreaminbackend/src/controllers/stream.controller.ts(line ~80) computes:If
ratePerSecondis"0",BigInt("0")divisor throwsRangeError: Division by zero, which falls into the genericcatchand returns a 500. This endpoint (POST /v1/streams) currently has no validation middleware wired (thecreateStreamSchemaregex^\d+$would still allow"0"even once wired in #452), and notry/parseguard on the inputs, so malformed bodies crash with an opaque 500.This is the same class of bug as the indexer div-by-zero (#450) but in a different file and code path.
Acceptance criteria
ratePerSecond > 0(and that numeric fields parse) before computingendTime, returning a 400 with a clear message instead of a 500.createStreamSchemais wired in ([Backend] Wire createStreamSchema validation into POST /v1/streams #452).Files to touch
backend/src/controllers/stream.controller.tsOut of scope
createStreamSchemainto the route ([Backend] Wire createStreamSchema validation into POST /v1/streams #452); indexer div-by-zero ([Backend] Fix indexer division-by-zero on zero-rate streams #450).