From 00747822666c352325231fdbd1975369009a336e Mon Sep 17 00:00:00 2001 From: Tuyen Nguyen Date: Wed, 11 May 2022 12:42:18 +0700 Subject: [PATCH] Lightclient e2e: increase validator client --- packages/lodestar/test/e2e/chain/lightclient.test.ts | 5 +++-- packages/lodestar/test/utils/node/validator.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/lodestar/test/e2e/chain/lightclient.test.ts b/packages/lodestar/test/e2e/chain/lightclient.test.ts index f29ec5f4c928..1cb7fae1d851 100644 --- a/packages/lodestar/test/e2e/chain/lightclient.test.ts +++ b/packages/lodestar/test/e2e/chain/lightclient.test.ts @@ -20,6 +20,7 @@ describe("chain / lightclient", function () { */ const maxLcHeadTrackingDiffSlots = 4; const validatorCount = 8; + const validatorClientCount = 4; const targetSyncCommittee = 3; /** N sync committee periods + 1 epoch of margin */ const finalizedEpochToReach = targetSyncCommittee * EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1; @@ -72,7 +73,7 @@ describe("chain / lightclient", function () { network: {allowPublishToZeroPeers: true}, api: {rest: {enabled: true, api: ["lightclient"], port: restPort}}, }, - validatorCount, + validatorCount: validatorCount * validatorClientCount, genesisTime, logger: loggerNodeA, }); @@ -84,7 +85,7 @@ describe("chain / lightclient", function () { const {validators} = await getAndInitDevValidators({ node: bn, validatorsPerClient: validatorCount, - validatorClientCount: 1, + validatorClientCount, startIndex: 0, useRestApi: false, testLoggerOpts: {...testLoggerOpts, logLevel: LogLevel.error}, diff --git a/packages/lodestar/test/utils/node/validator.ts b/packages/lodestar/test/utils/node/validator.ts index 86776af8518c..e90752334a8b 100644 --- a/packages/lodestar/test/utils/node/validator.ts +++ b/packages/lodestar/test/utils/node/validator.ts @@ -127,8 +127,8 @@ export async function getAndInitDevValidators({ const validators: Promise[] = []; const secretKeys: SecretKey[] = []; - for (let i = 0; i < validatorClientCount; i++) { - const startIndexVc = startIndex + i * validatorClientCount; + for (let clientIndex = 0; clientIndex < validatorClientCount; clientIndex++) { + const startIndexVc = startIndex + clientIndex * validatorsPerClient; const endIndex = startIndexVc + validatorsPerClient - 1; const logger = testLogger(`Vali ${startIndexVc}-${endIndex}`, testLoggerOpts); const tmpDir = tmp.dirSync({unsafeCleanup: true});