Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

dincli model-owner: deploy sends stale constructor args (broken); no command for releaseGIRegistrationSlots (BL-27, BL-28)

未关闭
#223 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@umermjd11 已经在做这个了。

开始于 2026年10月29日。

  • #302 来自 @umermjd11 —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python, solidity

调研方向

Read dincli/cli/modelownerd/deploy.py alongside the constructors in foundry/src/DINTaskCoordinator.sol and foundry/src/DINTaskAuditor.sol to understand the missing modelId_ and when the registry assigns it. Then inspect the model registration flow to determine how that value can be supplied. For slot release, start with releaseGIRegistrationSlots in the coordinator contract and the model-owner CLI commands; done means deployment handles the constructor arguments and an available CLI command can release slots after a GI ends.

由索引模型根据 Issue 内容生成。

描述

bug good first issue

Two separate, both-confirmed gaps in the model-owner tooling, batched here since they're the same area of the codebase (dincli/cli/modelownerd/) and the same root-cause category (dincli not kept in sync with a foundry/src contract change).

Part 1 (BL-27): dincli model-owner deploy is broken against current contracts

dincli/cli/modelownerd/deploy.py calls:

DINTaskCoordinator_contract.constructor(din_validator_stake_address)                         # 1 arg
DINTaskAuditor_contract.constructor(din_validator_stake_address, task_coordinator_address)    # 2 args

but the actual constructors (foundry/src/DINTaskCoordinator.sol:290, foundry/src/DINTaskAuditor.sol:406-410, verified against develop @ 740a613) are:

constructor(address dinvalidatorStakeContract_address, uint256 modelId_)
constructor(address _dinvalidatorStakeContract_address, address _dintaskcoordinator_contract_address, uint256 modelId_)

Both calls are missing modelId_. Verified by inspection against the current ABI — dincli model-owner deploy task-coordinator/task-auditor will fail at ABI encoding today. This is hidden in testing because tests/ deploys task contracts from stale hardhat artifacts, not the bundled foundry-derived ABIs.

This isn't a one-line fix — DINModelRegistry only assigns modelId at approveModel() time, after the task contracts must already exist (the registration flow requires already-deployed, already-owned taskCoordinator/taskAuditor addresses as input). So deploy-time modelId_ doesn't exist yet when these constructors run. Needs a decision: a placeholder/sentinel modelId at deploy time later reconciled at approval, a registry-side pre-assignment step before deploy, or a constructor change removing the dependency — out of scope for me to prescribe here, flagging for whoever picks this up.

Part 2 (BL-28): no dincli command for releaseGIRegistrationSlots

DINTaskCoordinator.releaseGIRegistrationSlots(gi) (L1287-1299) is the only function that decrements validators' activeRegistrationCount after a GI ends — endGI deliberately doesn't, to stay O(1) (BL-10). It's present in the bundled ABI (dincli/abis/DINTaskCoordinator.json) but grepping all of dincli/ turns up zero callers.

Currently harmless: maxConcurrentRegistrationsPerStakeUnit (DinValidatorStake.sol:115) defaults to 0, so the cap it would otherwise enforce (TC_ConcurrentRegistrationCapReached/TA_ConcurrentRegistrationCapReached) never fires. But the moment any network sets that cap above 0, every ended GI permanently consumes its validators' concurrent-registration slots until they hit the cap — with no dincli path to call the one function that frees them.

Suggested approach

  • Part 1: fix the constructor args once the modelId sourcing decision is made; add a dincli-level smoke test that actually deploys against the real foundry artifact (not hardhat) to catch this class of drift going forward.
  • Part 2: add dincli model-owner release-gi-slots <gi> (or fold into an existing model-owner gi ... subcommand), callable any time after the target GI reaches GIended.

References

  • Developer/BACK_LOG.md BL-27, BL-28
  • PR #204 review (source of both findings)
  • BL-10 (why endGI doesn't release slots inline)
主要语言
Python
星标
4
派生
7
平均合并
3 天 5 小时
30 天内合并 PR
34

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

InfiniteZeroFoundation/DevNet 的其他 Issue

查看 InfiniteZeroFoundation/DevNet 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。