contracts/stream/src/storage.rs (add_stream_to_sender/add_stream_to_recipient, lines 48-64) load an address's entire Vec<u64> of stream IDs, push one entry, and rewrite the whole Vec back to persistent storage — on every create_stream and create_batch_streams call. There's no cap and no alternate indexed lookup, so a sender or recipient who accumulates many streams over time pays strictly growing read/rewrite cost on each new stream, and will eventually hit Soroban's per-entry size/resource limits — permanently breaking create_stream for that address with no mitigation path in the contract today.
Done when: stream IDs are tracked in a way that doesn't require rewriting a growing list on every call (e.g. a paginated/indexed key scheme), or there's a documented, enforced cap with a clear failure mode well before the resource limit is hit.
Where: contracts/stream/src/storage.rs
contracts/stream/src/storage.rs(add_stream_to_sender/add_stream_to_recipient, lines 48-64) load an address's entireVec<u64>of stream IDs, push one entry, and rewrite the whole Vec back to persistent storage — on everycreate_streamandcreate_batch_streamscall. There's no cap and no alternate indexed lookup, so a sender or recipient who accumulates many streams over time pays strictly growing read/rewrite cost on each new stream, and will eventually hit Soroban's per-entry size/resource limits — permanently breakingcreate_streamfor that address with no mitigation path in the contract today.Done when: stream IDs are tracked in a way that doesn't require rewriting a growing list on every call (e.g. a paginated/indexed key scheme), or there's a documented, enforced cap with a clear failure mode well before the resource limit is hit.
Where:
contracts/stream/src/storage.rs