security: DinEmission.fundGI lets anyone use up a model's emission schedule on far-future GIs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- solidity
- 領域
- blockchain, security
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 4
- フォーク
- 7
- 平均マージ
- 3日 58分
- マージ済み PR(30日)
- 39
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InfiniteZeroFoundation/DevNet のほかの issue
-
dincli: `task model-owner register-request --manifestCID` fails because the registry contract isn't initialised対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
InfiniteZeroFoundation/DevNet#295 ·
メンテナーはふだん 1 日以内に返信
-
ROADMAP.md: refresh "What is still open for P3" (several items were fixed in October)対応中かも @umermjd11 が 1 日前に担当しました。 オープンdocumentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
InfiniteZeroFoundation/DevNet#285 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
InfiniteZeroFoundation/DevNet#277 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
InfiniteZeroFoundation/DevNet#266 ·
メンテナーはふだん 1 日以内に返信
-
Approved documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
InfiniteZeroFoundation/DevNet#248 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
InfiniteZeroFoundation/DevNet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistencies対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
admission-deferred priority: medium status: ready work-class: scoped
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
melodic-software/claude-code-plugins#10887 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
backend bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
PoCInnovation/Distribox#255 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
google/langextract#598 ·
メンテナーはふだん 1 日以内に返信