Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions crates/astria-conductor/src/celestia/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use tower::{
ServiceExt as _,
};
use tracing::{
debug,
info,
instrument,
warn,
Expand Down Expand Up @@ -294,7 +295,7 @@ async fn fetch_commit_with_retry(
) -> Result<VerificationResponse, VerificationMetaError> {
let retry_config = RetryFutureConfig::new(u32::MAX)
.custom_backoff(CometBftRetryStrategy::new(Duration::from_millis(100)))
.max_delay(Duration::from_secs(10))
.max_delay(Duration::from_secs(300))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have XXX: This should probably be configurable comments

Context Used: Rule from dashboard - Hard-coded values that may vary between different networks (local, mocha, mainnet) should be configu... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/astria-conductor/src/celestia/verify.rs
Line: 298:298

Comment:
**style:** hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have `XXX: This should probably be configurable` comments

**Context Used:** Rule from `dashboard` - Hard-coded values that may vary between different networks (local, mocha, mainnet) should be configu... ([source](https://app.greptile.com/review/custom-context?memory=3a7f89a9-1179-4b2d-b733-e3acbebacdde))

How can I resolve this? If you propose a fix, please make it concise.

.on_retry(
|attempt: u32, next_delay: Option<Duration>, error: &tendermint_rpc::Error| {
let wait_duration = next_delay
Expand Down Expand Up @@ -329,7 +330,7 @@ async fn fetch_validators_with_retry(
) -> Result<VerificationResponse, VerificationMetaError> {
let retry_config = RetryFutureConfig::new(u32::MAX)
.custom_backoff(CometBftRetryStrategy::new(Duration::from_millis(100)))
.max_delay(Duration::from_secs(10))
.max_delay(Duration::from_secs(300))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have XXX: This should probably be configurable comments

Context Used: Rule from dashboard - Hard-coded values that may vary between different networks (local, mocha, mainnet) should be configu... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/astria-conductor/src/celestia/verify.rs
Line: 333:333

Comment:
**style:** hard-coded 300s (5min) max delay should be configurable via environment variable, similar to other timeout values in the codebase that have `XXX: This should probably be configurable` comments

**Context Used:** Rule from `dashboard` - Hard-coded values that may vary between different networks (local, mocha, mainnet) should be configu... ([source](https://app.greptile.com/review/custom-context?memory=3a7f89a9-1179-4b2d-b733-e3acbebacdde))

How can I resolve this? If you propose a fix, please make it concise.

.on_retry(
|attempt: u32, next_delay: Option<Duration>, error: &tendermint_rpc::Error| {
let wait_duration = next_delay
Expand Down Expand Up @@ -382,6 +383,10 @@ impl<'a> BackoffStrategy<'a, tendermint_rpc::Error> for CometBftRetryStrategy {
self.delay = self.delay.saturating_mul(2);
RetryPolicy::Delay(prev_delay)
} else {
debug!(
error = error as &dyn std::error::Error,
"not retrying failed request to CometBFT; error is not retryable",
);
RetryPolicy::Break
}
}
Expand Down
Loading