Skip to content

Conversation

@jtakalai
Copy link

@jtakalai jtakalai commented May 20, 2025

Changes

If streamId is too long, cut and use hash (for uniqueness). Currently no streams have such long IDs, so for existing clients, this change is transparent.

minor cleanup: let -> const

Why

Overlong ID could break the subgraph indexing

Future work

This provides a simple upgrade path for SDK: instead of querying Stream.id, query Stream.streamId (which as an added bonus is of type String and not ID so can be queried with "contains")

@linear
Copy link

linear bot commented May 20, 2025

@teogeb
Copy link
Contributor

teogeb commented May 21, 2025

My suggestion is that we limit the length of the stream ID in StreamRegistry#createStream. If I understood correctly, there is no need for overlong stream ids in practice. The approach in this PR adds significant amount of complexity and confusion as "Stream#id" field in The Graph is no longer same as Stream's ID.

@jtakalai
Copy link
Author

jtakalai commented May 21, 2025

My suggestion is that we limit the length of the stream ID in StreamRegistry#createStream.

It's an option that requires a change to the StreamRegistry contract. The current PR works as a subgraph update. Of course it can still be changed later with minimal hassle.

The complexity added here isn't very significant, and confusion can be remedied with documentation.

not part of this PR
@jtakalai jtakalai requested review from harbu and teogeb May 22, 2025 09:23
@jtakalai
Copy link
Author

closing this (or rather, leaving it here just in case it's actually needed in the future :), fix was implemented in #993

@jtakalai jtakalai closed this May 23, 2025
@jtakalai jtakalai removed request for harbu and teogeb May 23, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants