From 85ff3cf17e9f8338865cc66f129f9e60e0ec029b Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 11 Jul 2023 02:02:22 +0200 Subject: [PATCH] refactor: increase batch size to get validator indices to 64 (#5743) --- packages/validator/src/services/indices.ts | 4 ++-- packages/validator/src/util/batch.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/validator/src/services/indices.ts b/packages/validator/src/services/indices.ts index 38f2d2a9d1df..a3c29982bf58 100644 --- a/packages/validator/src/services/indices.ts +++ b/packages/validator/src/services/indices.ts @@ -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; diff --git a/packages/validator/src/util/batch.ts b/packages/validator/src/util/batch.ts index f0cfa9c7ee9d..a44d188fbf6b 100644 --- a/packages/validator/src/util/batch.ts +++ b/packages/validator/src/util/batch.ts @@ -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(items: T[], opts: {batchSize: number; maxBatches?: number}): T[][] { const batches: T[][] = [];