Repository navigation
Description
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 argsbut 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
modelIdsourcing 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 existingmodel-owner gi ...subcommand), callable any time after the target GI reachesGIended.
References
Developer/BACK_LOG.mdBL-27, BL-28- PR fix(cli): remove broken non-proxy
dinrep deploy, fix add-slasher crash; refresh contract docs (#203) #204 review (source of both findings) - BL-10 (why
endGIdoesn't release slots inline)
Activity
umeradl commentedon Oct 6, 2026
Status update: confirmed; covered by task-plan-051026-2 TP-3
Checked against
develop@a1fcce2. Both halves hold:dincli/cli/modelownerd/deploy.py:35sendsDINTaskCoordinator.constructor(stake)and:77sendsDINTaskAuditor.constructor(stake, coordinator).foundry/srctakes(stake, modelId_)(DINTaskCoordinator.sol:290) and(stake, coordinator, modelId_)(DINTaskAuditor.sol:406), so ABI encoding fails against the bundled foundry ABIs. There's also a latentNameErrorwhendin_infohas nostakeentry (:27-28,:61-62).releaseGIRegistrationSlots.Can be done now: yes, but it's already planned. Both are in umermjd11's task-plan-051026-2 (PR No. 229) TP-3:
--model-idon both deploys, defaulting toDINModelRegistry.totalModels()with a warning;modelId();setDinToken;NameErroris fixed;dincli model-owner gi release-slotscommand is added;modelIdmismatch.The PR No. 229 review asks the plan to name this issue as closed by TP-3. It stays open until that PR lands, and isn't part of task_061026_22.
docs(backlog,audit): link BL-27..31 to new issues, mark stale finding…
abrahamnash commentedon Oct 26, 2026
Note for when this lands:
Documentation/public/workflows/model-workflow.md(lines 43 and 52) currently points model owners tohardhat/artifacts/...task contracts, presumably because of this bug, and to match the live DevNet 2.0 contracts. Once #223 is fixed and develop's Foundry contracts are deployed (DevNet 3.0), that guide should switch to the Foundry artifacts, and the Foundry-only decision inDeveloper/discussion/migrate_to_foundy.mdcan be closed out.abrahamnash commentedon Oct 26, 2026
This overlaps with #246, which PR #261 fixes. Once #261 merges, both can be closed.
umeradl commentedon Oct 29, 2026
@abrahamnash checked against
develop@6e73dcaand PR No. 261's head (8dd6311). PR No. 261 closes issue No. 246 and Part 1 of this issue, but not all of it:developnowdincli/cli/modelownerd/deploy.py:35/:77still omitmodelId_--model-id, passes it to both constructors, and checks the auditor's against the coordinator'smodelId()cache_model_0/abis/cache_model_0/manifest.jsonreleaseGIRegistrationSlotsdincli/clidincli model-owner gi release-slots <model_id> --gi Nin task-plan-051026-2 TP-3 (task_061026_21)model-workflow.mdL43/L52 point tohardhat/artifacts/...Documentation/So once PR No. 261 merges (Santiago's changes-requested review is still open on it), issue No. 246 can close. This issue stays open for Part 2 and the
model-workflow.mdartifact paths, which I'll add to TP-3. (PR No. 232's "Closes" on this issue was the task-spec PR, so it never delivered code.)umeradl commentedon Nov 2, 2026
@Santiagocetran, could you run the closing check on this issue (
din-close-issue 223)? I can't do it:din_peer_check.pyrefuses me because I wrote PRs No. 229 and No. 232, which implement part of it (MAINTAINING No. 5.2). Robbert wrote PR No. 261 and Similoluwa wrote PR No. 225, so you're the eligible peer.Pointers for the check:
model-owner deploy): PR No. 261 (merged asd6f537bctoday) fixed the deploy constructors, andDeveloper/BACK_LOG.mdmarks BL-27 "✅ Fixed — PR No. 261".releaseGIRegistrationSlots): I don't think this is ondevelopyet. My open PR No. 302 adds the release-slots command. If that's right, this needs a status update rather than a close.Santiagocetran commentedon Nov 2, 2026
Closing check: not ready to close
Checked the latest upstream
developatcf802168.d6f537bc. Both deploy calls passmodel_idand match the bundled constructor ABIs. Auditor deployment also rejects a coordinator/model-ID mismatch.releaseGIRegistrationSlotsexists in the Foundry contract, but there is no caller underdincli/cliondevelop. PR No. 302 addsmodel-owner gi release-slotsbut remains open and unmerged.Documentation/public/workflows/model-workflow.md:43,52still uses Hardhat artifact paths and omits the now-required--model-id.Verification: the peer eligibility check passed for
Santiagocetran. Static checks confirmed constructor argument counts against both bundled ABI sets and the missing release-slots caller. Deployment smoke tests were not run because the required tools and Python dependencies were unavailable.Verdict: leave this issue open. Recheck once the release-slots implementation lands and the workflow documentation is updated. PR No. 261 resolves Part 1 only.
feat(dincli): rewards, encryption-key, release-slots and dispute comm…