[Backend] Two indexers run concurrently - soroban-indexer.service + soroban-event-worker race on the same rows and double-count withdrawnAmount
I maintainer di solito rispondono entro 7 giorni
@Banx17 ci sta già lavorando.
Dal 25/8/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- node.js, postgresql, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 18
- Fork
- 250
- Merge medio
- 5g 6h
- PR unite (30g)
- 85
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LabsCrypt/flowfi
-
[test] Cover indexed fee event accountingForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabackend points: 150 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 7 giorni
-
backend points: 150 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 7 giorni
-
backend points: 150 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 7 giorni
-
backend points: 150 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 7 giorni
-
backend points: 150 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 7 giorni
Tutte le issue di LabsCrypt/flowfi
Issue simili
-
New icon: `filter-clear`Apertacalcite-ui-icons enhancement impact - p3 - not time sensitive needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Esri/calcite-design-system#15467 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
diegosouzapw/OmniRoute#18390 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
guilhermerodz/input-otp#157 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
davidjerleke/embla-carousel#1414 ·
I maintainer di solito rispondono entro 4 giorni