From 80fdc45ccd3993e96a57849bd3acae75cf46eb76 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 11 Jul 2023 02:42:54 -0400 Subject: [PATCH] fix: fix usage of deserializeSyncCommittee --- src/util.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index d15b10e..8bea121 100644 --- a/src/util.ts +++ b/src/util.ts @@ -9,6 +9,7 @@ import axiosRetry from "axios-retry"; import axios from "axios"; import { digest } from "@chainsafe/as-sha256"; import { concatBytes } from "@noble/hashes/utils"; +import { deserializeSyncCommittee } from "@lodestar/light-client/utils"; export function getDefaultClientConfig() { const chainConfig = createBeaconConfig( @@ -38,7 +39,14 @@ export async function optimisticUpdateVerify( const headerBlockRoot = phase0.ssz.BeaconBlockHeader.hashTreeRoot( header.beacon, ); - const committeeFast = this.deserializeSyncCommittee(committee); + + const committeeFast = deserializeSyncCommittee({ + pubkeys: committee, + aggregatePubkey: bls.PublicKey.aggregate( + deserializePubkeys(committee), + ).toBytes(), + }); + try { assertValidSignedHeader( this.config.chainConfig,