Skip to content

Commit

Permalink
refactor: increase batch size to get validator indices to 64 (#5743)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Jul 11, 2023
1 parent 7fc999e commit 85ff3cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/validator/src/services/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {Metrics} from "../metrics.js";

/**
* URLs have a limitation on size, adding an unbounded num of pubkeys will break the request.
* For reasoning on the specific number see: https://github.com/ChainSafe/lodestar/pull/2730#issuecomment-866749083
* For reasoning on the specific number see: https://github.com/ethereum/beacon-APIs/pull/328
*/
const PUBKEYS_PER_REQUEST = 10;
const PUBKEYS_PER_REQUEST = 64;

// To assist with readability
type PubkeyHex = string;
Expand Down
3 changes: 1 addition & 2 deletions packages/validator/src/util/batch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Divide pubkeys into batches, each batch contains at most 5 http requests,
* each request can work on at most 40 pubkeys.
* Convert array of items into array of batched item arrays
*/
export function batchItems<T>(items: T[], opts: {batchSize: number; maxBatches?: number}): T[][] {
const batches: T[][] = [];
Expand Down

0 comments on commit 85ff3cf

Please sign in to comment.