diff --git a/packages/cli/src/rpc/modules/ultralight.ts b/packages/cli/src/rpc/modules/ultralight.ts index c904d5ae0..6d955827f 100644 --- a/packages/cli/src/rpc/modules/ultralight.ts +++ b/packages/cli/src/rpc/modules/ultralight.ts @@ -53,7 +53,9 @@ export class ultralight { const [contentKey, value] = params const type: number = parseInt(contentKey.slice(0, 4)) - this.logger(`ultralight_addContentToDB request received for ${HistoryNetworkContentType[type]} ${contentKey}`) + this.logger( + `ultralight_addContentToDB request received for ${HistoryNetworkContentType[type]} ${contentKey}`, + ) try { this._history.store(type, '0x' + contentKey.slice(4), fromHexString(value)) this.logger(`${type} value for 0x${contentKey.slice(4)} added to content DB`) diff --git a/packages/portalnetwork/src/client/client.ts b/packages/portalnetwork/src/client/client.ts index be98d7a59..7d9e7942b 100644 --- a/packages/portalnetwork/src/client/client.ts +++ b/packages/portalnetwork/src/client/client.ts @@ -305,8 +305,8 @@ export class PortalNetwork extends (EventEmitter as { new (): PortalNetworkEvent value: JSON.stringify(peers), }, ]) - } catch (err) { - console.log('error', err) + } catch (err: any) { + this.logger.log('error: ', err.message) } } diff --git a/packages/portalnetwork/src/subprotocols/beacon/beacon.ts b/packages/portalnetwork/src/subprotocols/beacon/beacon.ts index d5cef941f..c6ffa17f3 100644 --- a/packages/portalnetwork/src/subprotocols/beacon/beacon.ts +++ b/packages/portalnetwork/src/subprotocols/beacon/beacon.ts @@ -7,19 +7,13 @@ import { Union } from '@chainsafe/ssz/lib/interface.js' import { fromHexString, toHexString } from '@chainsafe/ssz' import { shortId } from '../../util/util.js' import { createBeaconConfig, defaultChainConfig, BeaconConfig } from '@lodestar/config' -import { - MainnetGenesisValidatorsRoot, - BeaconLightClientNetworkContentType, - LightClientUpdatesByRange, -} from './types.js' +import { MainnetGenesisValidatorsRoot, BeaconLightClientNetworkContentType } from './types.js' import { ContentMessageType, FindContentMessage, MessageCodes, PortalWireMessageType, } from '../../wire/types.js' -import { ssz } from '@lodestar/types' -import { getBeaconContentKey } from './util.js' import { bytesToInt } from '@ethereumjs/util' import { RequestCode } from '../../wire/index.js' diff --git a/packages/portalnetwork/src/subprotocols/contentLookup.ts b/packages/portalnetwork/src/subprotocols/contentLookup.ts index c712bc64d..7c8131eea 100644 --- a/packages/portalnetwork/src/subprotocols/contentLookup.ts +++ b/packages/portalnetwork/src/subprotocols/contentLookup.ts @@ -4,7 +4,6 @@ import { Debugger } from 'debug' import { serializedContentKeyToContentId, shortId } from '../util/index.js' import { HistoryNetworkContentType } from './history/types.js' import { BaseProtocol } from './protocol.js' -import { Uint8 } from '@lodestar/types' type lookupPeer = { nodeId: NodeId diff --git a/packages/portalnetwork/src/subprotocols/history/history.ts b/packages/portalnetwork/src/subprotocols/history/history.ts index 343f5ab16..f890e9b1e 100644 --- a/packages/portalnetwork/src/subprotocols/history/history.ts +++ b/packages/portalnetwork/src/subprotocols/history/history.ts @@ -209,7 +209,6 @@ export class HistoryProtocol extends BaseProtocol { } public async addBlockBody(value: Uint8Array, hashKey: string) { - const bodyKey = getContentKey(HistoryNetworkContentType.BlockBody, fromHexString(hashKey)) if (value.length === 0) { // Occurs when `getBlockByHash` called `includeTransactions` === false return diff --git a/packages/portalnetwork/src/subprotocols/state/state.ts b/packages/portalnetwork/src/subprotocols/state/state.ts index 2b4c860f7..8971cab55 100644 --- a/packages/portalnetwork/src/subprotocols/state/state.ts +++ b/packages/portalnetwork/src/subprotocols/state/state.ts @@ -14,11 +14,11 @@ export class StateProtocol extends BaseProtocol { this.routingTable.setLogger(this.logger) } - public sendFindContent = async (dstId: string, key: Uint8Array) => { + public sendFindContent = async (_dstId: string, _key: Uint8Array) => { return undefined } - public findContentLocally = async (contentKey: Uint8Array): Promise => { + public findContentLocally = async (_contentKey: Uint8Array): Promise => { return undefined } diff --git a/packages/portalnetwork/src/transports/capacitorUdp.ts b/packages/portalnetwork/src/transports/capacitorUdp.ts index 2f332c539..2939c48d1 100644 --- a/packages/portalnetwork/src/transports/capacitorUdp.ts +++ b/packages/portalnetwork/src/transports/capacitorUdp.ts @@ -83,7 +83,7 @@ export class CapacitorUDPTransportService } } - getContactableAddr(enr: BaseENR): SocketAddress | undefined { + getContactableAddr(_enr: BaseENR): SocketAddress | undefined { const nodeAddr = this.bindAddrs[0].tuples() return { port: this.bindAddrs[0].nodeAddress().port, diff --git a/packages/portalnetwork/src/transports/websockets.ts b/packages/portalnetwork/src/transports/websockets.ts index af968872e..a0d1462eb 100644 --- a/packages/portalnetwork/src/transports/websockets.ts +++ b/packages/portalnetwork/src/transports/websockets.ts @@ -114,7 +114,7 @@ export class WebSocketTransportService } } - getContactableAddr(enr: BaseENR): SocketAddress | undefined { + getContactableAddr(_enr: BaseENR): SocketAddress | undefined { const nodeAddr = this.bindAddrs[0].tuples() return { port: this.bindAddrs[0].nodeAddress().port, diff --git a/packages/portalnetwork/src/wire/utp/Socket/UtpSocket.ts b/packages/portalnetwork/src/wire/utp/Socket/UtpSocket.ts index bca227bbf..4e7cec146 100644 --- a/packages/portalnetwork/src/wire/utp/Socket/UtpSocket.ts +++ b/packages/portalnetwork/src/wire/utp/Socket/UtpSocket.ts @@ -2,7 +2,6 @@ import { Packet, PacketType, ConnectionState, - ICreate, ICreatePacketOpts, UtpSocketOptions, UtpSocketType, diff --git a/packages/portalnetwork/test/subprotocols/protocol.spec.ts b/packages/portalnetwork/test/subprotocols/protocol.spec.ts index d757518a7..7ae20efdc 100644 --- a/packages/portalnetwork/test/subprotocols/protocol.spec.ts +++ b/packages/portalnetwork/test/subprotocols/protocol.spec.ts @@ -17,7 +17,7 @@ import { } from '../../src/index.js' import { createSecp256k1PeerId } from '@libp2p/peer-id-factory' import { INodeAddress } from '@chainsafe/discv5/lib/session/nodeInfo.js' -import { BitArray, fromHexString, toHexString } from '@chainsafe/ssz' +import { BitArray, fromHexString } from '@chainsafe/ssz' tape('protocol wire message tests', async (t) => { const node = await PortalNetwork.create({ diff --git a/packages/portalnetwork/test/wire/utp/utp.spec.ts b/packages/portalnetwork/test/wire/utp/utp.spec.ts index ace353862..7b6fa8c32 100644 --- a/packages/portalnetwork/test/wire/utp/utp.spec.ts +++ b/packages/portalnetwork/test/wire/utp/utp.spec.ts @@ -321,7 +321,6 @@ tape('PortalNetworkUTP test', (t) => { }) t.test('handleNewRequest', async (st) => { const connectionId = randUint16() - const socketIds = utp.startingIdNrs(connectionId) let params: INewRequest = { protocolId: ProtocolId.HistoryNetwork, contentKeys: [randomBytes(33)],