[Backend] Two indexers run concurrently - soroban-indexer.service + soroban-event-worker race on the same rows and double-count withdrawnAmount
Los mantenedores suelen responder en 3 días
@Banx17 ya está trabajando en esto.
Desde el 25/8/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, postgresql, typescript
Línea de trabajo
Start with backend/src/index.ts and compare the two startup paths, then read backend/src/services/soroban-indexer.service.ts and soroban-event-worker.ts to understand their event polling and WITHDRAWN handling. Add or run the regression test that verifies only one indexer polls the contract, and verify a repeated WITHDRAWN event cannot increment withdrawnAmount twice. Run tests and lint; note that an open linked pull request means this work may already be underway.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: bug, backend, Stellar Wave, database, critical
Two indexers run at once and double-count withdrawnAmount, which corrupts claimable balances.
index.ts:32 calls sorobanIndexerService.start() and index.ts:33 startWorkers() starts SorobanEventWorker. Both poll STREAM_CONTRACT_ID and write Stream/StreamEvent. Their WITHDRAWN handlers both read-then-add withdrawnAmount (soroban-indexer.service.ts:216 and soroban-event-worker.ts:631) in separate transactions, so when both pick up the same event before either commits, the increment lands twice. That inflates withdrawnAmount and shrinks claimable. The legacy service also keeps its cursor in memory and ignores IndexerState. One indexer should own this.
What the fix has to hold to
- Only one component indexes contract events
- The same WITHDRAWN event never increments
withdrawnAmountmore than once
Done when
-
sorobanIndexerService.start()/stop()removed fromindex.tsso onlySorobanEventWorkerindexes -
services/soroban-indexer.service.tsdeleted or disabled - Regression test asserts only one indexer instance polls the contract
- Verified
withdrawnAmountisn't double-incremented for the same event - Tests + lint pass, CI green
Where to start
backend/src/index.ts (drop the legacy start), then remove backend/src/services/soroban-indexer.service.ts; soroban-event-worker.ts stays as the single indexer. Contract-side and frontend indexer-status UI are out of scope. Medium.
- Lenguaje dominante
- TypeScript
- Estrellas
- 18
- Forks
- 250
- Merge medio
- 4 d 12 h
- PR fusionados (30 d)
- 65
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de LabsCrypt/flowfi
-
[test] Cover indexed fee event accountingPosiblemente ocupada @huangji6693-max la tomó hace 2 días. Abiertobackend points: 150 testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
LabsCrypt/flowfi#1764 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
backend points: 150 testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 3 días
-
backend points: 150 testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 3 días
-
backend points: 150 testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 3 días
-
[test] Cover admin ledger reset validationPosiblemente ocupada @Ranjeet2063 la tomó hace 1 día. Abiertobackend points: 150 testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 3 días
Todos los issues de LabsCrypt/flowfi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
gnosis/gnosis_vpn#661 ·
Los mantenedores suelen responder en 1 día
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Abiertotriage:bug-verified
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Eyevinn/open-videocore#1300 ·
Los mantenedores suelen responder en 1 día
-
nextjs-tracking
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
cloudflare/vinext#4390 ·
Los mantenedores suelen responder en 1 día
-
kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
kubernetes-sigs/headlamp#8175 ·
Los mantenedores suelen responder en 2 días