Skip to content

Commit

Permalink
feat: update witnessgen timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Dec 13, 2024
1 parent 784abd9 commit cae1fa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions proposer/op/proposer/prove.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const PROOF_STATUS_TIMEOUT = 30 * time.Second
const WITNESS_GEN_TIMEOUT = 40 * time.Minute
const WITNESSGEN_TIMEOUT = 60 * 60 * time.Second

// This limit is set to prevent overloading the witness generation server. Until Kona improves their native I/O API (https://github.com/anton-rs/kona/issues/553)
// the maximum number of concurrent witness generation requests is roughly num_cpu / 2. Set it to 5 for now to be safe.
Expand Down Expand Up @@ -321,13 +321,13 @@ func (l *L2OutputSubmitter) makeProofRequest(proofType proofrequest.Type, jsonBo
}
req.Header.Set("Content-Type", "application/json")

client := &http.Client{Timeout: WITNESS_GEN_TIMEOUT}
client := &http.Client{Timeout: WITNESSGEN_TIMEOUT}
resp, err := client.Do(req)
if err != nil {
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
l.Log.Error("Witness generation request timed out", "err", err)
l.Metr.RecordWitnessGenFailure("Timeout")
return nil, fmt.Errorf("request timed out after %s: %w", WITNESS_GEN_TIMEOUT, err)
return nil, fmt.Errorf("request timed out after %s: %w", WITNESSGEN_TIMEOUT, err)
}
return nil, fmt.Errorf("failed to send request: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion utils/host/src/witnessgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn convert_host_cli_to_args(host_cli: &HostCli) -> Vec<String> {
}

/// Default timeout for witness generation.
pub const WITNESSGEN_TIMEOUT: Duration = Duration::from_secs(60 * 20);
pub const WITNESSGEN_TIMEOUT: Duration = Duration::from_secs(60 * 60);

struct WitnessGenProcess {
child: tokio::process::Child,
Expand Down

0 comments on commit cae1fa1

Please sign in to comment.