Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[W-4] Money consumed without session granted — no refund path

Aperta
#803 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend, payments

Direzione di ricerca

Start by confirming whether the bug still reproduces on current upstream main, since the issue says this was not verified during migration. Then read merchant.go around lines 486-494 (the 30s timeout branch, where the Receive goroutine keeps running) and 538-552 (the grant-failure path), and check the Lightning MintTokens-then-grant flow. Done means tokens are consumed only after a session is granted, with a refund path for the other cases, and a test covers each of the three failure paths.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Migrated from Amperstrand/tollgate-module-basic-go#73 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: #758.]


MEDIUM-HIGH: Partial-failure accounting bug where money settles before service is decided. Three concrete paths:

  1. 30s timeout leaves the non-cancellable Receive goroutine running; late swap success = token consumed, no session, retry hits "already spent", no refund path.
  2. Gate-open failure after successful swap (including the shared 00:00:00:00:00:00 fallback-MAC bucket where ndsctl auth fails for a non-existent client) = same client-side loss.
  3. Lightning: MintTokens ok + grant fail = funds parked, monitor retries forever.

File references: merchant.go:486-494 (timeout branch), :538-552 (grant-failure).

Fix: Implement grant-or-refund accounting to ensure tokens are only consumed when a session is successfully granted.

Evidence: /home/ubuntu/src/tollgate_audit_report_2026-08-26.md §7, line 146


Migrated 2026-10-09. Applicability to current upstream main (4614ac2, post-rc1) was not re-verified during migration — confirming whether the finding still reproduces upstream is this issue's first task.

Lingua principale
Go
Stelle
12
Fork
14
Merge medio
1g 6h
PR unite (30g)
234

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenTollGate/tollgate-module-basic-go

Tutte le issue di OpenTollGate/tollgate-module-basic-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.