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

feat(bridge): add http request timeout to prevent requests over 6 minutes #1147

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

KolbyML
Copy link
Member

@KolbyML KolbyML commented Feb 8, 2024

What was wrong?

image
Yesterday when testing the bridge we found that a surf http request took 6 minutes to respond. We assume this is becase the provider took forever to respond. Either way we don't want to wait 6 minutes + to timeout if a provider can't respond in a responsible about of time we should give up and log it, so we aren't confused why we aren't seeing logs.

How was it fixed?

by setting a 20 second timeout in surf.

I choose 20 seconds to be conservative. I don't believe any provider request should take over 1s and if that does happens the provider is overloaded.

@KolbyML KolbyML requested a review from njgheorghita February 8, 2024 07:03
@KolbyML KolbyML self-assigned this Feb 8, 2024
@KolbyML KolbyML requested a review from ogenev February 8, 2024 07:03
Copy link
Member

@ogenev ogenev left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -14,3 +16,7 @@ pub const BEACON_GENESIS_TIME: u64 = 1606824023;

pub const PROVIDER_DAILY_REQUEST_LIMIT: f64 = 1_000_000.0;
pub const SECONDS_IN_A_DAY: f64 = 86400.0;

// This is a very conservative timeout if a provider takes longer then even 1 second it is probably
Copy link
Collaborator

Choose a reason for hiding this comment

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

than even 1 second

@KolbyML KolbyML merged commit 0cd2e06 into ethereum:master Feb 8, 2024
8 checks passed
@KolbyML KolbyML deleted the make-it-so-latest-always-prints branch January 22, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants