allocations map retains released issues — phantom ledger drift

Aperta
#608 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@PINYOPATTANAWASANPORN ci sta già lavorando.

Dal 30/10/2026.

  • #637 di @yggdrasilworld — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
blockchain

Direzione di ricerca

Start by reading release_issue and how milestone.allocations is updated; compare the release path with the issue's described allocate and deallocate behavior. Check the open pull request #637 before starting, since work is already underway. Done means released issues no longer remain in the outstanding allocations view, while the Released status still prevents double payment.

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

Descrizione

Bug: release_issue never removes the released allocation — allocations grows into a phantom ledger

release_issue marks the issue Released and transfers the funds out, but it does not remove the entry from milestone.allocations. Over a milestone's lifetime the map accumulates every released allocation alongside live ones — allocations stops meaning "outstanding allocations" and becomes a monotonically-growing phantom ledger.

Why it matters
  • get_milestone exposes allocations — an indexer/UI summing it to show "outstanding payouts" over-states the real obligation (released funds still appear allocated)
  • The invariant contract_balance == remaining_budget + sum(allocations) silently breaks — released amounts stay counted
  • allocations grows unboundedly on a long-lived milestone (allocate adds, deallocate removes, release leaves the entry)

The Released status-check prevents double-pay, so this isn't a direct fund-loss — it's an accounting-integrity bug: the allocation-map's semantics are inconsistent after release.

Suggested fix

Remove the allocation on release — milestone.allocations.remove(issue_id) alongside IssueStatus::Released — so the map reflects outstanding obligations. (If the entries are intentionally kept as history, a separate released flag/counter would preserve the audit-trail without corrupting the outstanding-allocations view.)

Lingua principale
Rust
Stelle
1
Fork
102
Merge medio
4h 12m
PR unite (30g)
30

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 MergeFi/contracts

Tutte le issue di MergeFi/contracts

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.