Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: bug, backend, Stellar Wave, database, critical
Stream IDs are u64 on chain but Int in the database, so any large ID crashes the indexer.
schema.prisma:30 types streamId Int @unique and :70 types StreamEvent.streamId Int, both of which map to Postgres int4 (max 2,147,483,647). The contract keys streams by u64 (types.rs:25, events.rs:9) and the worker stores Number(decodeU64(...)) at soroban-event-worker.ts:438. Once a stream_id goes past int4 max, the insert fails with "value out of range for type integer", which blows up the indexer transaction and drops the stream along with all its events.
What the fix has to hold to
- Stream.streamId, StreamEvent.streamId and the relation reference are BigInt
- The on-chain identifier type stays as it is
- A u64 id above 2^31 survives a full round-trip through the worker
Done when
Where to start
backend/prisma/schema.prisma for the type change plus a migration, and backend/src/workers/soroban-event-worker.ts where the value is decoded and stored. Changing the on-chain identifier type is out of scope. Watch for other spots that read streamId as a JS Number.
Labels:
bug,backend,Stellar Wave,database,criticalStream IDs are
u64on chain butIntin the database, so any large ID crashes the indexer.schema.prisma:30typesstreamId Int @uniqueand:70typesStreamEvent.streamId Int, both of which map to Postgres int4 (max 2,147,483,647). The contract keys streams by u64 (types.rs:25,events.rs:9) and the worker storesNumber(decodeU64(...))atsoroban-event-worker.ts:438. Once a stream_id goes past int4 max, the insert fails with "value out of range for type integer", which blows up the indexer transaction and drops the stream along with all its events.What the fix has to hold to
Done when
Where to start
backend/prisma/schema.prismafor the type change plus a migration, andbackend/src/workers/soroban-event-worker.tswhere the value is decoded and stored. Changing the on-chain identifier type is out of scope. Watch for other spots that read streamId as a JS Number.