DinFeeRouter: validatorPool/storage/publicGoods shares accrue with no withdrawal path (BL-29)

Đang mở
#221 1 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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
solidity
Lĩnh vực
backend, blockchain

Hướng nghiên cứu

Start with foundry/src/DinFeeRouter.sol and the BL-29 entry in Developer/BACK_LOG.md; read the bucket accounting and routeFeeDIN/routeFeeETH alongside the operator note in Documentation/public/roles/dinrep.md. The issue says a design decision is needed about who can withdraw each bucket and where validatorPool funds go. Once that is decided, done means the accrued balances have a withdrawal path for the affected buckets.

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

Mô tả

bug

Summary

DinFeeRouter.routeFeeETH/routeFeeDIN split every fee into five buckets (validatorPool, treasury, burn, storage, publicGoods), but only the treasury share is ever actually moved out of the contract — paid immediately via a direct transfer/call. The other three buckets are only counted in accruedEth/accruedDin (keyed by bucket-name hash); there is no function anywhere in the contract that reads or spends those balances.

Where

foundry/src/DinFeeRouter.sol (verified against develop @ 740a613):

  • accruedDin/accruedEth mappings, L65-66 — the code itself comments them as "Buckets with no live consumer yet"
  • routeFeeDIN() L172-190, routeFeeETH() L194-211 — only treasuryAmt is ever transferred out
  • Full function list (initialize, addFeeSource, removeFeeSource, setTreasury, setTreasuryBpsCeiling, setDinSplit, setEthSplit, routeFeeDIN, routeFeeETH) — confirmed no withdraw/sweep function exists anywhere in the contract

Impact

With the default split (validatorPool=95%, treasury=5%), 95% of every fee swept through this router is permanently stuck the moment it's routed — not hypothetical, this is the live default on every network including the current devnet. Documentation/public/roles/dinrep.md:259 already warns operators about this ("nothing can withdraw them yet... treat swept non-Treasury ETH as locked"), so the team is aware of the behavior, but there's no dedicated engineering ticket for the fix itself — the only references are the ROADMAP's P3-5.3 row and Developer/BACK_LOG.md's BL-29 entry.

Relationship to #43

#43 ("P3 fees & treasury") is the broad mechanism-design umbrella this falls under, but its scope is MECHANISM_DESIGN-level (fee lines, denomination, burn policy) rather than this specific, already-shipped-in-principle engineering gap — the split itself and its bps values already work; only the withdrawal path for 3 of the 5 buckets is missing. This issue is the concrete, scoped sub-task; #43 should link here rather than absorb it.

Suggested approach

Needs a design decision first (who can pull each bucket, and where the validatorPool share specifically goes — straight to DinValidatorStake reward pools? DinEmission? a claim-pull contract?), per BL-29's own open question in the backlog. Candidate shapes, not prescribing one:

  1. A role-gated withdraw(bytes32 bucket, address to, uint256 amount) per asset type, with the consuming contract(s) added as a known recipient once P3-5.2 (emission/reward pool) ships.
  2. A sweepBucket(bytes32 bucket) that forwards the full accrued balance to a configured per-bucket destination address (mirrors the sweepFeesToRouter pattern already used elsewhere in the codebase).

References

  • Developer/BACK_LOG.md BL-29
  • Documentation/public/roles/dinrep.md:259
  • Developer/ROADMAP.md P3-5.3 row
  • #43 (parent/umbrella)
Ngôn ngữ chính
Python
Star
4
Fork
7
Merge trung bình
3 ngày 7 giờ
Pull request đã merge (30 ngày)
33

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 InfiniteZeroFoundation/DevNet

Tất cả issue của InfiniteZeroFoundation/DevNet

Issue tương tự

Thêm issue về Python

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.