Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

[Backend] Two indexers run concurrently - soroban-indexer.service + soroban-event-worker race on the same rows and double-count withdrawnAmount

Ouverte
#801 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

@Banx17 y travaille déjà.

Depuis le 25/8/2026.

  • #980 par @Banx17 — fermée sans fusion
  • #1181 par @Banx17 — ouverte
  • #1412 par @olu-cmd — ouverte

É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

backend bug critical database GrantFox OSS Maybe Rewarded Official Campaign | FWC26 Stellar Wave

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 withdrawnAmount more than once

Done when

  • sorobanIndexerService.start()/stop() removed from index.ts so only SorobanEventWorker indexes
  • services/soroban-indexer.service.ts deleted or disabled
  • Regression test asserts only one indexer instance polls the contract
  • Verified withdrawnAmount isn'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

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de LabsCrypt/flowfi

Toutes les issues de LabsCrypt/flowfi

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.