Skip to content

Per-address stream-ID list grows unbounded and is rewritten in full on every create_stream call #248

Description

@larryjay007

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions