Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#801 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@Banx17 ya está trabajando en esto.

Desde el 25/8/2026.

  • #980 de @Banx17 — cerrado sin fusionar
  • #1181 de @Banx17 — abierto
  • #1412 de @olu-cmd — abierto

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

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.

Lenguaje dominante
TypeScript
Estrellas
18
Forks
250
Merge medio
4 d 12 h
PR fusionados (30 d)
65

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de LabsCrypt/flowfi

Todos los issues de LabsCrypt/flowfi

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.