security: DinEmission.fundGI lets anyone use up a model's emission schedule on far-future GIs
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ó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ 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
- blockchain, security
Hướng nghiên cứu
Read foundry/src/DinEmission.sol around fundGI and _advanceEpoch, then foundry/src/DINTaskAuditor.sol around depositRewards and the coordinator’s startGI check. The issue lists three possible fixes; first compare how each preserves permissionless funding while preventing far-future GIs from advancing the schedule. Add regression tests for far-future rejection, normal funding and the 1,000-call exhaustion case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
DinEmission.fundGI(gi, taskAuditor) is permissionless, and it accepts any gi. The only bound is DINTaskAuditor.depositRewards's check that gi >= coordinator.GI(). The decay schedule advances once per call, not per real GI, so anyone can use up a registered model's entire emission schedule by funding GIs that will never run. Real GIs then get nothing from emission.
This is the follow-up to the PR No. 234 review (finding No. 3). It existed before that PR. #226's fix limits which auditor can be funded, not which GI.
Where
foundry/src/DinEmission.sol:
fundGI(:212): checks the zero address, registry membership, disabled model and the funded-GI flag, thenEmissionExhausted(:224). Nothing relatesgito the model's actual progress._advanceEpoch(:295): incrementsgisInCurrentEpochon every successfulfundGIand moves to the next, decayed epoch afterepochLengthcalls.
foundry/src/DINTaskAuditor.sol:
depositRewards(:481):if (gi == 0 || gi < dintaskcoordinatorContract.GI()) revert TA_InvalidRewardGI();. This sets a lower bound only.
Impact
- Any address calls
fundGI(1e12 + i, auditor)fori < epochLength × maxEpochs. With the deploy defaults (EMISSION_EPOCH_LENGTH=100,EMISSION_MAX_EPOCHS=10) that is 1,000 calls, gas only. - Afterwards
fundGI(realGI, auditor)revertsEmissionExhausted. The model's whole subsidy sits ingiRewardPool[1e12 + i]for GIs that will never start. - Nothing is stolen: the DIN stays in the model's own auditor. This is griefing, not theft. It still permanently removes the protocol subsidy for that model and inflates
totalEmittedand DIN supply with tokens nobody can reach. - A smaller version needs no far-future GIs: funding the next N real GIs early front-loads the undecayed epochs. That is mostly harmless, since those GIs do run.
Verified during the PR No. 234 review with a scratch test on the PR head (50 calls with the test fixture's epochLength × maxEpochs). The test passes, so the griefing works today.
The NatSpec argument doesn't cover gi
fundGI's NatSpec says there's "no benefit to restricting the caller" because the amount is schedule-deterministic. That holds for the amount. It doesn't hold for gi, which the caller picks freely, and the schedule only moves forward.
Possible fixes (for discussion)
- Bound
gito the model's real progress. Requiregi == C.GI()orgi == C.GI() + 1, whereC = IDINTaskAuditor(taskAuditor).dintaskcoordinatorContract().startGI(DINTaskCoordinator.sol:379) checksgiRewardPoolof the GI it is about to start, soGI() + 1is the one that needs funding. This keepsfundGIpermissionless. The new auditor call is safe because the auditor is now registry-validated (#226). - Restrict the caller to the model owner, or the DIN-Representative, for that
taskAuditor's model. This is simpler to reason about, but drops the "anyone can trigger the subsidy" property. - Key the schedule by GI number instead of call count, so the epoch is
(gi − 1) / epochLength. This removes the incentive entirely. It is a larger change toEmissionState(adds storage; keep__gapat 50 perstorage_layout.mdCore rules).
Option 1 looks like the smallest change. Whichever is chosen, the planned dincli model-owner rewards fund-emission <model_id> --gi N command (task_061026_21) should follow it.
Tests to add
- An arbitrary caller's
fundGI(far-future gi, registeredAuditor)reverts, and the schedule is untouched. fundGI(GI() + 1, …)still succeeds, andstartGIthen passesTC_GIRewardPoolNotFunded.- The full 1,000-call exhaustion PoC (deploy defaults) as a regression test.
- Ngôn ngữ chính
- Python
- Star
- 4
- Fork
- 7
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 34
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của InfiniteZeroFoundation/DevNet
-
ROADMAP.md: refresh "What is still open for P3" (several items were fixed in October)Có thể đã có người làm @umermjd11 đã nhận 2 ngày trước. Đang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
InfiniteZeroFoundation/DevNet#285 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update the 25 translated organisation READMEs to match the English versionCó thể đã có người làm @mrCabez đã nhận hôm nay. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InfiniteZeroFoundation/DevNet#277 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update the client-service guide to explain training and uploading separatelyCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InfiniteZeroFoundation/DevNet#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
InfiniteZeroFoundation/DevNet#299 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Long run
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
InfiniteZeroFoundation/DevNet#298 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InfiniteZeroFoundation/DevNet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Validate finite output clamping limits in StepPredictor.prepare_clamping_params to prevent silent NaN/Inf propagationCó thể đã có người làm @muskan-creates352 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mllam/neural-lam#848 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
infra
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
fab-geocommuns/RNB-coeur#1166 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepspeedai/DeepSpeed#8951 ·
Maintainer thường phản hồi trong vòng 2 ngày