From 6ef18dbc05b5b5801a6b05cea5056d631e8a094d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 13 Jul 2023 10:40:18 -0400 Subject: [PATCH] fix: Revert "fix: create fixSerializedUint8Array helper method to deal with weird quirk of ssz serialize" This reverts commit d8430b4a11f99f38f33cf14abfc9ed841e5226e1. --- src/store.ts | 13 ++++--------- src/util.ts | 3 --- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/store.ts b/src/store.ts index 8cc8f95..d49b34e 100644 --- a/src/store.ts +++ b/src/store.ts @@ -5,7 +5,6 @@ import { concatBytes } from "@noble/hashes/utils"; import { LightClientUpdate } from "#types.js"; import * as capella from "@lodestar/types/capella"; import NodeCache from "node-cache"; -import { fixSerializedUint8Array } from "#util.js"; export interface StoreItem { update: Uint8Array; @@ -23,14 +22,10 @@ export default class Store implements IStore { addUpdate(period: number, update: LightClientUpdate) { try { this.store.set(period, { - update: fixSerializedUint8Array( - capella.ssz.LightClientUpdate.serialize(update), - ), - nextCommittee: fixSerializedUint8Array( - CommitteeSSZ.serialize(update.nextSyncCommittee.pubkeys), - ), - nextCommitteeHash: fixSerializedUint8Array( - digest(concatBytes(...update.nextSyncCommittee.pubkeys)), + update: capella.ssz.LightClientUpdate.serialize(update), + nextCommittee: CommitteeSSZ.serialize(update.nextSyncCommittee.pubkeys), + nextCommitteeHash: digest( + concatBytes(...update.nextSyncCommittee.pubkeys), ), }); } catch (e) { diff --git a/src/util.ts b/src/util.ts index a8887c6..97349ff 100644 --- a/src/util.ts +++ b/src/util.ts @@ -131,6 +131,3 @@ function isValidLightClientHeader( header.beacon.bodyRoot, ); } -export function fixSerializedUint8Array(arr: Uint8Array) { - return new Uint8Array(Object.values(arr)); -}