From b67ac5f16eca1df5534c985045250bdb334a85cf Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Tue, 9 Apr 2024 19:59:08 +0100 Subject: [PATCH] fix: wrap blockstore in identity blockstore (#493) Wraps blockstore to prevent writing identity blocks --- packages/utils/package.json | 2 +- packages/utils/src/utils/networked-storage.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/utils/package.json b/packages/utils/package.json index 32dbde232..5a0491a7f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -62,7 +62,7 @@ "@libp2p/utils": "^5.2.6", "@multiformats/dns": "^1.0.1", "any-signal": "^4.1.1", - "blockstore-core": "^4.4.0", + "blockstore-core": "^4.4.1", "cborg": "^4.0.9", "interface-blockstore": "^5.2.10", "interface-datastore": "^8.2.11", diff --git a/packages/utils/src/utils/networked-storage.ts b/packages/utils/src/utils/networked-storage.ts index 97527c0cf..845aa93c4 100644 --- a/packages/utils/src/utils/networked-storage.ts +++ b/packages/utils/src/utils/networked-storage.ts @@ -1,7 +1,6 @@ import { CodeError, setMaxListeners, start, stop } from '@libp2p/interface' import { anySignal } from 'any-signal' import { IdentityBlockstore } from 'blockstore-core/identity' -import { TieredBlockstore } from 'blockstore-core/tiered' import filter from 'it-filter' import forEach from 'it-foreach' import { CustomProgressEvent, type ProgressOptions } from 'progress-events' @@ -47,10 +46,7 @@ export class NetworkedStorage implements Blocks, Startable { this.log = components.logger.forComponent(`helia:networked-storage${init.root == null ? '' : `:${init.root}`}`) this.logger = components.logger this.components = components - this.child = new TieredBlockstore([ - new IdentityBlockstore(), - components.blockstore - ]) + this.child = new IdentityBlockstore(components.blockstore) this.hashers = components.hashers ?? {} this.started = false }