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

Use dedicated http client for publishing #608

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Conversation

avalonche
Copy link
Collaborator

πŸ“ Summary

β›± Motivation and Context

πŸ“š References


βœ… I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

beaconclient/prod_beacon_instance.go Show resolved Hide resolved
@@ -179,7 +182,7 @@ func (c *ProdBeaconInstance) SyncStatus() (*SyncStatusPayloadData, error) {
uri := c.beaconURI + "/eth/v1/node/syncing"
timeout := 5 * time.Second
resp := new(SyncStatusPayload)
_, err := fetchBeacon(http.MethodGet, uri, nil, resp, &timeout, http.Header{}, false)
_, err := fetchBeacon(http.MethodGet, uri, nil, resp, &http.Client{Timeout: timeout}, http.Header{}, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

question:

why do we create a new client (and as a result a new TCP connection per each request) only for /eth/v1/node/syncing path?

Copy link
Contributor

Choose a reason for hiding this comment

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

(just to qualify, I think we shouldn't create a new client for this path either. so that there are only 2 clients in use, the default for everything, and one dedicated for publishing only).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just to configure the timeout I think, will update to have 1 client in use for everything with a 5 second timeout (is that enough for the validator request?)

@avalonche avalonche merged commit 256fd3c into main Apr 24, 2024
4 checks passed
@avalonche avalonche deleted the publish-http-client branch April 24, 2024 18:23
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