[Backend] Two indexers run concurrently - soroban-indexer.service + soroban-event-worker race on the same rows and double-count withdrawnAmount
Les mainteneurs répondent en général sous 3 jours
@Banx17 y travaille déjà.
Depuis le 25/8/2026.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- node.js, postgresql, typescript
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 18
- Forks
- 250
- Merge moyen
- 4 j 12 h
- PR mergées (30 j)
- 65
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de LabsCrypt/flowfi
-
[test] Cover indexed fee event accountingPeut-être pris @huangji6693-max l’a pris il y a 4 jours. Ouvertebackend points: 150 testing
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
LabsCrypt/flowfi#1764 · 2 commentaires ·
Les mainteneurs répondent en général sous 3 jours
-
backend points: 150 testing
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 3 jours
-
backend points: 150 testing
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 3 jours
-
backend points: 150 testing
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 3 jours
-
[test] Cover admin ledger reset validationPeut-être pris @Ranjeet2063 l’a pris il y a 3 jours. Ouvertebackend points: 150 testing
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de LabsCrypt/flowfi
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
Les mainteneurs répondent en général sous 2 jours
-
BeOS .json missingOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
mihaip/infinite-mac#475 ·
-
Let TypeScript accept an initial object in ReactiveDictPeut-être pris @yograj-vijay-yadav l’a pris aujourd’hui. Ouvertebug good first issue help wanted workshop
Difficulté 2/5 1-3 heures Accessibilité débutants 92/100
meteor/meteor#14919 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
marmelab/atomic-crm#401 ·
Les mainteneurs répondent en général sous 1 jour
-
account: profile
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 5 jours