Repository navigation
fix: let a failed operator or watchtower proof task restart, and tell the node when it never will - #535
Open
KSlashh wants to merge 2 commits into
Open
fix: let a failed operator or watchtower proof task restart, and tell the node when it never will#535KSlashh wants to merge 2 commits into
KSlashh wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit items M35, L62, L64, L65. Open against
dev.Failed tasks (M35). An operator or watchtower task that failed was final: every later submission got HTTP 200 and "not ready, state 3", and the node polled every 60 seconds until the assert window had passed, with no alert. Now:
MAX_TASK_RESETS).invalid_reason). The same inputs do not restart it; new inputs do.state:pending,proven,failedorcancelled.failedcomes only when no restart is left, anderrorsays why.failed, the node logs an error, raisesoperator_proof_failed/watchtower_proof_failedthrough the instance alert metric, and stops resubmitting: the assert or challenge job ends.cancelled, a watchtower stops quietly: its own timeout means the operator already asserted.Request errors (L64). Bad watchtower lists in an operator task (length mismatch, bad or duplicate keys, a txid disagreeing with its included flag) were checked only while writing the task and came back as HTTP 500, which the node retries. They are now checked with the other request checks and return 400. The node treats a 400 from the proof builder as final, like
failed. Other 4xx codes and 5xx are still retried.One operator task per graph (L62).
operator_proofgets a unique index on(instance_id, graph_id), and the migration keeps one row per graph: a proven task first, then an unfinished one, then the oldest. A racing second submission now fails its transaction, and the retry finds the stored task. Watchtower rows already have their own unique key.Cancelled state (L65).
ProofState::Cancelled(4).Cancelled, notFailed, so they no longer count as failed watchtower proofs.Cancelledas well.bitvm_proof_builder_tasksreports these asstate="cancelled".Newstraight to the result. AProvingstep would race with the timeout, which only applies toNewtasks.Migration.
20261111000000_on_demand_proof_reset.sqlrebuilds both tables, because SQLite cannot change theirCHECK (proof_state IN (...))in place. It addsreset_countandinvalid_reasonto both, andinput_hashtooperator_proof. Existing rows keep their state.Review notes
ProofDesc.statecan now beCancelled, and an operator task'sFailedcan return toNewafter a resubmission.statefield, and an older proof builder does not send it.Tests: a failed operator task restarts twice on the same inputs, is refused the third time and restarts again on new inputs; a task with inputs that can never be proven restarts only on new inputs; a watchtower task restarts the same way; missing watchtower slots are cancelled; a second operator task for a graph is refused; a bad watchtower list is a 400; the node treats only a 400 and a failed task as final.
The test coverage and validation notes above are from the zkm PR notes. Branch scope and diff formatting were checked locally; builds and tests were not rerun during publication.