Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Developer/tasks/task_061026_21.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dincli and the full-GI integration suite never caught up:
- batches created vs test data assigned
- aggregation seed waiting vs locked

Worse, `startLMsubmissionsEvaluation` (`DINTaskCoordinator.sol:532-538`) **doesn't check** that test data was assigned. The auditor-side flag (`DINTaskAuditor.sol:1017-1029`) is one-way, but it's only the owner's own claim; nothing checks that every batch actually has test data.
Worse, `startLMsubmissionsEvaluation` (`DINTaskCoordinator.sol:532-538`) **doesn't check** that test data was assigned. The auditor-side flag (`DINTaskAuditor.sol:1033-1045`) is one-way, but it's only the owner's own claim; nothing checks that every batch actually has test data.
- **The public GI docs are stale**: wrong command names, and the funding, key, seed and reveal steps are missing.

### Discussion #216 follow-ups
Expand Down Expand Up @@ -86,11 +86,13 @@ This is a read-only pass over every owner and role GI function in `DINTaskCoordi
|---|---|---|
| `modelId` constructor argument on both task contracts | `DINTaskCoordinator.sol:290`, `DINTaskAuditor.sol:406` | Deploy fails at ABI encoding (BL-27) |
| `setDinToken` on the auditor (and the coordinator, for dispute bonds) | `DINTaskAuditor.sol:440`, `DINTaskCoordinator.sol:1307` | `depositRewards`, claims and bonds can't move DIN |
| The GI's reward pool funded before each `startGI` | `DINTaskCoordinator.sol:379` → `DINTaskAuditor.depositRewards` (`:481`) or `DinEmission.fundGI` (`DinEmission.sol:174`) | `TC_GIRewardPoolNotFunded` |
| Every batch auditor has an X25519 key on `DinValidatorStake` | `registerEncryptionKey` (`DinValidatorStake.sol:501`), checked at `DINTaskAuditor.sol:1000-1001` | `TA_AuditorEncryptionKeyNotRegistered` when test data is assigned |
| Seed blocks get mined | `disputeSeedDelay` = 7 blocks; dincli polls (`utils.py:998-1080`); anvil `--block-time 2` mines | The seed lock hangs |
| The GI's reward pool funded before each `startGI` | `DINTaskCoordinator.sol:380` → `DINTaskAuditor.depositRewards` (`:481`) or `DinEmission.fundGI` (`DinEmission.sol:212`) | `TC_GIRewardPoolNotFunded` |
| Every batch auditor has an X25519 key on `DinValidatorStake` | `registerEncryptionKey` (`DinValidatorStake.sol:509`), checked at `DINTaskAuditor.sol:1018-1019` | `TA_AuditorEncryptionKeyNotRegistered` when test data is assigned |
| Seed blocks get mined | `disputeSeedDelay` = 7 blocks; dincli polls (`utils.py:1029-1143`); anvil `--block-time 2` mines | The seed lock hangs |
| The owner opens each of the three reveal windows | `start*Reveal` | `close` / `finalize` revert |

**Re-checked at `eb8085d` (PR 1's base):** the preconditions hold, and line references in this spec are updated to that commit. The coverage table below is unchanged: every row marked **missing** is still missing.

**dincli coverage at `a1fcce2`:**

| GI step | Contract function | dincli command |
Expand Down Expand Up @@ -135,7 +137,7 @@ Each new state is **set by the function that already does the step**, so a GI ne
| New state (lifecycle / enum order) | Inserted | Set by | Gate change |
|---|---|---|---|
| `AuditSeedLocked` | between `LMSclosed` and `AuditorsBatchesCreated` | `lockAuditSeed` (`DINTaskCoordinator.sol:1483`, anyone). Only on a successful lock, never on a re-anchor | `createAuditorsBatches` requires `AuditSeedLocked` |
| `AuditTestDataAssigned` | between `AuditorsBatchesCreated` and `LMSevaluationStarted` | `setTestDataAssignedFlag` (`:519`) | `startLMsubmissionsEvaluation` requires it. **The auditor side (`DINTaskAuditor.sol:1017-1029`) checks that every batch of the GI has a stored commitment** (`testDataCommitments[gi][b] != 0`, written by `assignAuditTestDataset`), else it reverts with a new `TA_TestDataNotAssigned`. The flag is already one-way (`TA_FlagMustBeTrue`, `TA_FlagAlreadySet`) |
| `AuditTestDataAssigned` | between `AuditorsBatchesCreated` and `LMSevaluationStarted` | `setTestDataAssignedFlag` (`:519`) | `startLMsubmissionsEvaluation` requires it. **The auditor side (`DINTaskAuditor.sol:1033-1045`) checks that every batch of the GI has a stored commitment** (`testDataCommitments[gi][b] != 0`, written by `assignAuditTestDataset`), else it reverts with a new `TA_TestDataNotAssigned`. The flag is already one-way (`TA_FlagMustBeTrue`, `TA_FlagAlreadySet`) |
| `AggSeedLocked` | between `LMSevaluationClosed` and `T1nT2Bcreated` | `lockAggSeed` (`:1459`) | `autoCreateTier1AndTier2` requires `AggSeedLocked` |

**Not added**, and why:
Expand Down Expand Up @@ -196,15 +198,15 @@ Each new state is **set by the function that already does the step**, so a GI ne
| `dincli rewards claim <model_id> --gi N` / `dincli rewards withdraw <model_id>` | `claimReward(gi)` / `claimRewards()` | All roles. First checks `giRewardSnapshot(gi).settled` and `rewardClaimed` |
| `dincli auditor register-encryption-key` | `DinValidatorStake.registerEncryptionKey` | Generates the X25519 key **per wallet** (e.g. `auditor_x25519_<address>.key`, chmod 600), replacing today's single shared `auditor_x25519.key`, which breaks several `--demokey` auditors on one machine. Updates `_load_auditor_x25519_key` (`auditor.py:33-41`) to match. The owner key (`auditor_batches.py:170-177`) also gets chmod 600 |
| `dincli model-owner gi release-slots <model_id> --gi N` | `releaseGIRegistrationSlots` | BL-28 |
| `dincli auditor dispute-test-data`, `dincli model-owner disputes resolve-test-data / reassign-test-data`, `… disputes close-expired` | `openTestDataDispute` (`DINTaskAuditor.sol:1480`), `resolveTestDataDispute` (`:1524`), `closeExpiredDispute` (`:1557`), `reassignAuditTestDataset` (`:1601`) | **Decision 4: in this task.** Built against the PR #215 shape: only batch auditors open a dispute, only the owner resolves, an unanswered dispute is upheld on expiry, there's no penalty after settlement, and `TA_RewardsAlreadySettled` applies. Bond approval comes first |
| `dincli auditor dispute-test-data`, `dincli model-owner disputes resolve-test-data / reassign-test-data`, `… disputes close-expired` | `openTestDataDispute` (`DINTaskAuditor.sol:1496`), `resolveTestDataDispute` (`:1540`), `closeExpiredDispute` (`:1573`), `reassignAuditTestDataset` (`:1617`) | **Decision 4: in this task.** Built against the PR #215 shape: only batch auditors open a dispute, only the owner resolves, an unanswered dispute is upheld on expiry, there's no penalty after settlement, and `TA_RewardsAlreadySettled` applies. Bond approval comes first |
| `dincli aggregator dispute`, `dincli model-owner disputes resolve-aggregation / settle-recomputation`, `… expire`, `… claim-bond` | `openDispute` (`DINTaskCoordinator.sol:1368`), `resolveDispute` (`:1535`), `settleRecomputation` (`:1609`), `expireDispute` (`:1671`), `claimDisputeBond` (`:1583`) | S4 |

**Fail fast instead of reverting:**
- `gi start` checks `giRewardPool(next GI) > 0` and points to `rewards deposit`.
- `create-testdataset --submit` checks every batch auditor's key and names any that are missing.

**Reuse:**
- `build_and_send_tx` (`dincli/cli/utils.py:947`)
- `build_and_send_tx` (`dincli/cli/utils.py:978`)
- the `ctx.obj.get_deployed_din_task_*_contract(model_id)` lookups (`cli/context.py:339`, `:357`)
- a new `approve_din(ctx, spender, amount)` helper, taken from the inline approve in `dintoken.stake_dintokens` (`dincli/cli/dintoken.py:71-128`)

Expand Down
Loading
Loading