From cae1fa1f056475215186f18edde187e1ffdab99f Mon Sep 17 00:00:00 2001 From: ratankaliani Date: Fri, 13 Dec 2024 20:16:47 +0000 Subject: [PATCH] feat: update witnessgen timeout --- proposer/op/proposer/prove.go | 6 +++--- utils/host/src/witnessgen.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proposer/op/proposer/prove.go b/proposer/op/proposer/prove.go index 2c21f554..f5384c67 100644 --- a/proposer/op/proposer/prove.go +++ b/proposer/op/proposer/prove.go @@ -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. @@ -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) } diff --git a/utils/host/src/witnessgen.rs b/utils/host/src/witnessgen.rs index 0385a0a3..17294e94 100644 --- a/utils/host/src/witnessgen.rs +++ b/utils/host/src/witnessgen.rs @@ -57,7 +57,7 @@ pub fn convert_host_cli_to_args(host_cli: &HostCli) -> Vec { } /// 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,