allocations map retains released issues — phantom ledger drift

Đang mở
#608 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@PINYOPATTANAWASANPORN đang làm issue này rồi.

Từ ngày 30/10/2026.

  • #637 của @yggdrasilworld — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
blockchain

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.)

Ngôn ngữ chính
Rust
Star
1
Fork
102
Merge trung bình
4 giờ 12 phút
Pull request đã merge (30 ngày)
30

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MergeFi/contracts

Tất cả issue của MergeFi/contracts

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.