From 76cd887d2092b2841d15689cc25372ab6ee6d243 Mon Sep 17 00:00:00 2001 From: NC <17676176+ensi321@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:19:24 -0700 Subject: [PATCH] Workaround on params e2e --- .../test/e2e/ensure-config-is-synced.test.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/params/test/e2e/ensure-config-is-synced.test.ts b/packages/params/test/e2e/ensure-config-is-synced.test.ts index eff7b9e33ee..f0ef9fa7503 100644 --- a/packages/params/test/e2e/ensure-config-is-synced.test.ts +++ b/packages/params/test/e2e/ensure-config-is-synced.test.ts @@ -9,6 +9,12 @@ import {loadConfigYaml} from "../yaml.js"; /** https://github.com/ethereum/consensus-specs/releases */ const specConfigCommit = "v1.5.0-alpha.8"; +/** + * Fields that we filter from local config when doing comparison. + * Ideally this should be empty as it is not spec compliant + * For `MAX_BLOBS_PER_BLOCK`, see https://github.com/ChainSafe/lodestar/issues/7172 + */ +const ignoredLocalPresetFields: (keyof BeaconPreset)[] = ["MAX_BLOBS_PER_BLOCK"]; describe("Ensure config is synced", () => { vi.setConfig({testTimeout: 60 * 1000}); @@ -25,12 +31,19 @@ describe("Ensure config is synced", () => { }); function assertCorrectPreset(localPreset: BeaconPreset, remotePreset: BeaconPreset): void { + const filteredLocalPreset: Partial = Object.keys(localPreset) + .filter((key) => !ignoredLocalPresetFields.includes(key as keyof BeaconPreset)) + .reduce((acc, key) => { + acc[key as keyof BeaconPreset] = localPreset[key as keyof BeaconPreset]; + return acc; + }, {} as Partial); + // Check each key for better debuggability for (const key of Object.keys(remotePreset) as (keyof BeaconPreset)[]) { - expect(localPreset[key]).toBe(remotePreset[key]); + expect(filteredLocalPreset[key]).toBe(remotePreset[key]); } - expect(localPreset).toEqual(remotePreset); + expect(filteredLocalPreset).toEqual(remotePreset); } async function downloadRemoteConfig(preset: "mainnet" | "minimal", commit: string): Promise {