dincli: create-testdataset --submit sets the one-shot TestDataAssignedFlag even when a batch's assignment tx failed
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 72/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- python, solidity
- Domaine
- blockchain, cli
Piste de recherche
Start in dincli/cli/modelownerd/auditor_batches.py around lines 198-253 and check how build_and_send_tx reports success or failure. Trace the one-shot flag behavior in foundry/src/DINTaskAuditor.sol around lines 1033-1046. Done means failed batch IDs are reported and the flag is set only after every assignment succeeds; run the relevant CLI tests if available.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
model-owner auditor-batches create-testdataset --submit loops over every auditor batch sending assignAuditTestDataset, never checks whether any individual batch's transaction actually succeeded, and then unconditionally sets a one-shot "all test data assigned" flag on-chain regardless. If one batch's assignment silently failed, the contract is left permanently asserting something that isn't true, with no way to go back and fix just that batch.
Where
dincli/cli/modelownerd/auditor_batches.py (~lines 198-253), verified against develop (fetched fresh):
for batch_id in range(audtor_batch_count):
...
build_and_send_tx(
ctx,
taskauditor_contract.functions.assignAuditTestDataset(
curr_GI, batch_id, encrypted_cid, encrypted_keys, commitment
),
f"Assigning test dataset for auditor batch {batch_id}",
f"Test dataset assigned for auditor batch : {batch_id}",
f"Failed to assign test dataset for auditor batch : {batch_id}",
exit_on_failure=False, # return value discarded, loop continues regardless
)
time.sleep(5)
build_and_send_tx(
ctx,
taskCoordinator_contract.functions.setTestDataAssignedFlag(curr_GI, True), # unconditional
"Setting test dataset assigned flag",
"Test dataset assigned for auditor batches",
"Failed to set test dataset assigned flag",
exit_on_failure=False,
)
setTestDataAssignedFlag (foundry/src/DINTaskAuditor.sol:1033-1046) is one-shot — TA_FlagAlreadySet on any second call:
function setTestDataAssignedFlag(uint _GI, bool flag) external onlyTaskCoordinator onlyCurrentGI(_GI) returns (bool) {
if (dintaskcoordinatorContract.GIstate() != GIstates.AuditorsBatchesCreated)
revert TA_CannotSetTestDataAssignedFlag();
if (!flag) revert TA_FlagMustBeTrue();
if (Is_testdataCIDs_Assigned[_GI]) revert TA_FlagAlreadySet(); // <-- no way back
Is_testdataCIDs_Assigned[_GI] = flag;
return true;
}
Failure sequence
- Batch 0's
assignAuditTestDatasetsucceeds. Batch 1's fails (RPC hiccup, gas, anythingbuild_and_send_txcatches internally) — it prints a red error line and returnsNone, but the loop just moves on to batch 2 since the return value is never inspected. - The loop finishes anyway.
setTestDataAssignedFlag(curr_GI, True)still runs and succeeds — nothing on-chain or in the CLI ties that flag to whether every batch's assignment actually landed. - Auditors assigned to batch 1 later call
encryptedTestDataKey(gi, 1, their_address)during evaluation (dincli/cli/auditor.py:477-479) and get empty bytes back, soBox(...).decrypt(...)throws — caught generically atauditor.py:498-500as "failed to decrypt test data." The auditor has no way to tell the real cause is an incomplete assignment on the model owner's side, not something wrong on their end. - No recovery path exists. Even after noticing and fixing/retrying batch 1's
assignAuditTestDataset(which itself has no on-chain one-shot guard, so it CAN be retried), the CLI only exposes it bundled inside this all-or-nothing loop — no--batchoption to retry a single one — andsetTestDataAssignedFlagcan't be called again to "re-confirm" since it's alreadyTrue. The on-chain record permanently asserts "test data fully assigned for this GI" when it isn't.
Impact
Any auditor assigned to the batch that silently failed is unable to evaluate for that entire GI, with a misleading error message, and the model owner has no way to detect or fix the gap after the fact — the flag already says everything's fine.
Suggested fix
Collect each batch's build_and_send_tx return value in the loop; only call setTestDataAssignedFlag if every batch succeeded. On partial failure, report exactly which batch IDs failed and exit before setting the flag, so the operator can retry (ideally via a --batch <id> option to resubmit just the failed one(s) without re-running the whole loop) before the one-shot flag gets set.
- Langage dominant
- Python
- Étoiles
- 4
- Forks
- 7
- Merge moyen
- 3 j 4 h
- PR mergées (30 j)
- 34
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de InfiniteZeroFoundation/DevNet
-
ROADMAP.md: refresh "What is still open for P3" (several items were fixed in October)Peut-être pris @umermjd11 l’a pris il y a 2 jours. Ouvertedocumentation good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
InfiniteZeroFoundation/DevNet#285 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Update the 25 translated organisation READMEs to match the English versionPeut-être pris @mrCabez l’a pris aujourd’hui. Ouvertegood first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
InfiniteZeroFoundation/DevNet#277 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Update the client-service guide to explain training and uploading separatelyPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
InfiniteZeroFoundation/DevNet#266 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
InfiniteZeroFoundation/DevNet#299 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Long run
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
InfiniteZeroFoundation/DevNet#298 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de InfiniteZeroFoundation/DevNet
Issues similaires
-
priority middle
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
KATO-Hiro/AtCoderClans#12940 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 76/100
huggingface/huggingface_hub#5283 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
ccxt/ccxt#31045 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug example
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 1 jour