From 8b1191165addc8bd981b57a62e3870e54bb6c0ea Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 11 Jul 2023 03:16:39 -0400 Subject: [PATCH] fix: further chainConfig fixes --- src/util.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util.ts b/src/util.ts index 29595f4..d474468 100644 --- a/src/util.ts +++ b/src/util.ts @@ -41,6 +41,8 @@ export async function optimisticUpdateVerify( header.beacon, ); + const chainConfig = getDefaultClientConfig().chainConfig; + const committeeFast = deserializeSyncCommittee({ pubkeys: committee, aggregatePubkey: bls.PublicKey.aggregate( @@ -50,7 +52,7 @@ export async function optimisticUpdateVerify( try { assertValidSignedHeader( - getDefaultClientConfig().chainConfig, + chainConfig, committeeFast, syncAggregate, headerBlockRoot, @@ -66,7 +68,7 @@ export async function optimisticUpdateVerify( return { correct: false, reason: "insufficient signatures" }; } - if (!this.isValidLightClientHeader(this.config.chainConfig, header)) { + if (!this.isValidLightClientHeader(chainConfig, header)) { return { correct: false, reason: "invalid header" }; }