Skip to content

Commit

Permalink
feat: remove network proof timeout (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Dec 1, 2024
1 parent 62d36a0 commit ef62b06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions proposer/op/proposer/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ var (
ProofTimeoutFlag = &cli.Uint64Flag{
Name: "proof-timeout",
Usage: "Maximum time in seconds to spend generating a proof before giving up",
// If a proof takes more than 4 hours, assume the cluster failed to set it to failed state.
Value: 14400,
EnvVars: prefixEnvVars("MAX_PROOF_TIME"),
}
Expand Down
13 changes: 3 additions & 10 deletions proposer/op/proposer/prove.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,10 @@ func (l *L2OutputSubmitter) ProcessPendingProofs() error {
continue
}

// TODO: Is this proof timeout logic necessary? Users should be able to count on the proof being fulfilled or unclaimed.
timeout := uint64(time.Now().Unix()) > req.ProofRequestTime+l.DriverSetup.Cfg.ProofTimeout
if timeout || proofStatus.Status == SP1ProofStatusUnclaimed {
if proofStatus.Status == SP1ProofStatusUnclaimed {
// Record the failure reason.
if timeout {
l.Log.Info("Proof timed out", "id", req.ProverRequestID)
l.Metr.RecordProveFailure("Timeout")
} else {
l.Log.Info("Proof unclaimed", "id", req.ProverRequestID, "reason", proofStatus.UnclaimDescription.String())
l.Metr.RecordProveFailure(proofStatus.UnclaimDescription.String())
}
l.Log.Info("Proof unclaimed", "id", req.ProverRequestID, "reason", proofStatus.UnclaimDescription.String())
l.Metr.RecordProveFailure(proofStatus.UnclaimDescription.String())

err = l.RetryRequest(req, proofStatus)
if err != nil {
Expand Down

0 comments on commit ef62b06

Please sign in to comment.