Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forge): set script verification retries at 5 with a 5 second delay #2739

Merged
merged 2 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/src/cmd/forge/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use serde_json::json;
use std::{path::PathBuf, sync::Arc};
use tracing::log::trace;

pub const RETRY_VERIFY_ON_CREATE: RetryArgs = RetryArgs { retries: 15, delay: Some(3) };
pub const RETRY_VERIFY_ON_CREATE: RetryArgs = RetryArgs { retries: 15, delay: 3 };

#[derive(Debug, Clone, Parser)]
pub struct CreateArgs {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cmd/forge/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use tracing::{trace, warn};
pub static RE_BUILD_COMMIT: Lazy<Regex> =
Lazy::new(|| Regex::new(r#"(?P<commit>commit\.[0-9,a-f]{8})"#).unwrap());

pub const RETRY_CHECK_ON_VERIFY: RetryArgs = RetryArgs { retries: 6, delay: Some(10) };
pub const RETRY_CHECK_ON_VERIFY: RetryArgs = RetryArgs { retries: 6, delay: 10 };

/// Verification arguments
#[derive(Debug, Clone, Parser)]
Expand Down
7 changes: 4 additions & 3 deletions cli/src/cmd/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub struct RetryArgs {
#[clap(
long,
help = "Number of attempts for retrying verification",
default_value = "1",
default_value = "5",
validator = u32_validator(1, 10),
value_name = "RETRIES"
)]
Expand All @@ -127,10 +127,11 @@ pub struct RetryArgs {
#[clap(
long,
help = "Optional delay to apply inbetween verification attempts in seconds.",
default_value = "5",
validator = u32_validator(0, 30),
value_name = "DELAY"
)]
pub delay: Option<u32>,
pub delay: u32,
}

fn u32_validator(min: u32, max: u32) -> impl FnMut(&str) -> eyre::Result<()> {
Expand All @@ -146,7 +147,7 @@ fn u32_validator(min: u32, max: u32) -> impl FnMut(&str) -> eyre::Result<()> {

impl From<RetryArgs> for Retry {
fn from(r: RetryArgs) -> Self {
Retry::new(r.retries, r.delay)
Retry::new(r.retries, Some(r.delay))
}
}

Expand Down