-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Poll node in batch to get validator indices #2730
Conversation
Code Climate has analyzed commit 906d49c and detected 0 issues on this pull request. View more on Code Climate. |
Looks good! What numbers do Teku use? We could base ours on them |
@dapplion it's 10 per batch https://github.com/ConsenSys/teku/blob/79e49c48e0a6a78eac5b7760860d680a046e78af/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandler.java#L75 I think it's quite conservative there, I used to be able to query 80 validator indices successfully, the issue only happened with 160 validators per batch. So
|
Teku may be going off of this: https://stackoverflow.com/questions/3091485/what-is-the-limit-on-querystring-get-url-parameters#answer-56527673 I've seen this answer copy/pasted around, tho I can't find the original Also related, I just posted this, maybe this can be more definitely resolved at the standards level: ethereum/beacon-APIs#153 |
0ac8f8c
to
08dfc71
Compare
08dfc71
to
3ce3cf6
Compare
export function pubkeysToBatches( | ||
pubkeysHex: string[], | ||
maxPubkeysPerRequest: number = PUBKEYS_PER_REQUEST, | ||
maxRequesPerBatch: number = REQUESTS_PER_BATCH |
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.
typo maxRequestsPerBatch
|
||
const pubkeysPerBatch = maxPubkeysPerRequest * maxRequesPerBatch; | ||
let batch: Batch = []; | ||
let pubkeysPerRequest: string[]; |
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.
Can find a similar approach without mutating scoped variables? You could have two for loops and scope the arrays inside them only with const
Performance Report✔️ no performance regression detected Full benchmark results
|
Motivation
Description
Let me know if we want to tweak the above numbers.
Closes #2727
Tested in contabo-1