-
Notifications
You must be signed in to change notification settings - Fork 0
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
app: increase beacon node timeout #42
Conversation
Explicitly set beacon node query timeouts to `(validatorAmount/50)*20 seconds`. This also sets the amount of validator to query in each chunk -- which is done internally by `go-eth2-client` -- to 50. This should allow even the worst-performing beacon nodes to still fetch data.
commit 686d882 Author: Gianguido Sorà <[email protected]> Date: Thu Dec 14 13:00:47 2023 +0100 *: update to go v1.21.5 (#43)
Co-authored-by: Luke Hackett <[email protected]>
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
@@ -16,7 +16,7 @@ jobs: | |||
# Config options can be found in README here: https://github.com/golangci/golangci-lint-action | |||
- uses: actions/setup-go@v4 | |||
with: | |||
go-version: '1.21.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing these!
@@ -377,6 +380,15 @@ func eth2Client(ctx context.Context, bnURL string) (eth2wrap.Client, error) { | |||
return eth2wrap.AdaptEth2HTTP(bnClient, maxBeaconNodeTimeout), nil | |||
} | |||
|
|||
// timeoutByValAmount returns the maximum timeout an eth2http call will have. | |||
// Return a timeout of (valAmount/50)*20, where 20 are the seconds to wait. | |||
func timeoutByValAmount(valAmount uint64) time.Duration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for 100 validators we will timeout after 40s. Useful in debugging but it should fail fast. Can we make this timeout configurable with a CLI flag instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful in debugging but it should fail fast.
Consider that this tool is designed to fetch this data, process and then stop to never be seen again.
Is adding a CLI toggle better than just make it work and forget about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. We can have any timeout as there are no strict timing requirements here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly.
If this was Charon, we could never allow such timeouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I was wondering if the timeout formula (n/50)*20s is the output of an empirical result?
Yes @xenowits, it is the result of testing with Lido operators as well as my local testing. |
Explicitly set beacon node query timeouts to
(validatorAmount/50)*20 seconds
.This also sets the amount of validator to query in each chunk -- which is done internally by
go-eth2-client
-- to 50.This should allow even the worst-performing beacon nodes to still fetch data.
category: bug
ticket: none