From 4261288b3bc4e52912f01da0bd267cf5d80e82dc Mon Sep 17 00:00:00 2001 From: ejMina226 <118474890+ejMina226@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:13:50 +0000 Subject: [PATCH] Remove unneeded code --- .../merkle/CachedLinkedMerkleTreeStore.ts | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/packages/sequencer/src/state/merkle/CachedLinkedMerkleTreeStore.ts b/packages/sequencer/src/state/merkle/CachedLinkedMerkleTreeStore.ts index 69514cb97..5ddae4fd8 100644 --- a/packages/sequencer/src/state/merkle/CachedLinkedMerkleTreeStore.ts +++ b/packages/sequencer/src/state/merkle/CachedLinkedMerkleTreeStore.ts @@ -153,31 +153,6 @@ export class CachedLinkedMerkleTreeStore return Object.values(this.writeCache.leaves); } - // This ensures all the keys needed to be loaded - // to find the closest path are loaded. - // A bit repetitive as we basically repeat the process - // (without the loading) when we find the closest leaf. - // TODO: see how we could use a returned value. - public async loadUpKeysForClosestPath(path: bigint): Promise { - let largestLeaf = this.getLeaf(0n); - if (largestLeaf === undefined) { - throw Error("Path 0n should be defined."); - } - while (largestLeaf.leaf.nextPath <= path) { - let nextLeaf = this.getLeaf(largestLeaf.leaf.nextPath); - // This means the nextPath wasn't preloaded and we have to load it. - if (nextLeaf === undefined) { - // eslint-disable-next-line no-await-in-loop - await this.preloadKey(largestLeaf.leaf.nextPath); - nextLeaf = this.getLeaf(largestLeaf.leaf.nextPath); - if (nextLeaf === undefined) { - throw Error(" Next Path is defined but not fetched"); - } - } - largestLeaf = nextLeaf; - } - } - // This resets the cache (not the in memory tree). public resetWrittenTree() { this.writeCache = { nodes: {}, leaves: {} };