Skip to content

Commit

Permalink
deps(dev): bump aegir from 38.1.8 to 39.0.5 (libp2p#468)
Browse files Browse the repository at this point in the history
* deps(dev): bump aegir from 38.1.8 to 39.0.5

Bumps [aegir](https://github.com/ipfs/aegir) from 38.1.8 to 39.0.5.
- [Release notes](https://github.com/ipfs/aegir/releases)
- [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md)
- [Commits](ipfs/aegir@v38.1.8...v39.0.5)

---
updated-dependencies:
- dependency-name: aegir
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: fix linting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Potsides <alex@achingbrain.net>
  • Loading branch information
dependabot[bot] and achingbrain authored May 4, 2023
1 parent d764986 commit dc53728
Show file tree
Hide file tree
Showing 50 changed files with 340 additions and 348 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
"@libp2p/record": "^3.0.0",
"@libp2p/topology": "^4.0.0",
"@multiformats/multiaddr": "^12.0.0",
"@types/sinon": "^10.0.14",
"abortable-iterator": "^5.0.1",
"any-signal": "^4.1.1",
"datastore-core": "^9.0.1",
Expand Down Expand Up @@ -197,7 +198,7 @@
"@types/lodash.range": "^3.2.6",
"@types/varint": "^6.0.0",
"@types/which": "^3.0.0",
"aegir": "^38.1.2",
"aegir": "^39.0.5",
"datastore-level": "^10.0.0",
"delay": "^5.0.0",
"execa": "^7.0.0",
Expand Down
28 changes: 14 additions & 14 deletions src/content-fetching/index.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { CodeError } from '@libp2p/interfaces/errors'
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
import { logger } from '@libp2p/logger'
import { Libp2pRecord } from '@libp2p/record'
import { verifyRecord } from '@libp2p/record/validators'
import { bestRecord } from '@libp2p/record/selectors'
import parallel from 'it-parallel'
import { verifyRecord } from '@libp2p/record/validators'
import map from 'it-map'
import {
valueEvent,
queryErrorEvent
} from '../query/events.js'
import { Message, MESSAGE_TYPE } from '../message/index.js'
import parallel from 'it-parallel'
import { pipe } from 'it-pipe'
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
import {
ALPHA
} from '../constants.js'
import { Message, MESSAGE_TYPE } from '../message/index.js'
import {
valueEvent,
queryErrorEvent
} from '../query/events.js'
import { createPutRecord, convertBuffer, bufferToRecordKey } from '../utils.js'
import { logger } from '@libp2p/logger'
import type { Validators, Selectors, ValueEvent, QueryOptions, QueryEvent } from '@libp2p/interface-dht'
import type { KadDHTComponents } from '../index.js'
import type { Network } from '../network.js'
import type { PeerRouting } from '../peer-routing/index.js'
import type { QueryManager } from '../query/manager.js'
import type { QueryFunc } from '../query/types.js'
import type { RoutingTable } from '../routing-table/index.js'
import type { Network } from '../network.js'
import type { Logger } from '@libp2p/logger'
import type { Validators, Selectors, ValueEvent, QueryOptions, QueryEvent } from '@libp2p/interface-dht'
import type { AbortOptions } from '@libp2p/interfaces'
import type { QueryFunc } from '../query/types.js'
import type { KadDHTComponents } from '../index.js'
import type { Logger } from '@libp2p/logger'

export interface ContentFetchingInit {
validators: Validators
Expand Down
26 changes: 13 additions & 13 deletions src/content-routing/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { Message, MESSAGE_TYPE } from '../message/index.js'
import parallel from 'it-parallel'
import { logger } from '@libp2p/logger'
import map from 'it-map'
import { convertBuffer } from '../utils.js'
import { ALPHA } from '../constants.js'
import parallel from 'it-parallel'
import { pipe } from 'it-pipe'
import { ALPHA } from '../constants.js'
import { Message, MESSAGE_TYPE } from '../message/index.js'
import {
queryErrorEvent,
peerResponseEvent,
providerEvent
} from '../query/events.js'
import { logger } from '@libp2p/logger'
import type { PeerResponseEvent, ProviderEvent, QueryEvent, QueryOptions } from '@libp2p/interface-dht'
import type { PeerRouting } from '../peer-routing/index.js'
import type { QueryManager } from '../query/manager.js'
import type { RoutingTable } from '../routing-table/index.js'
import { convertBuffer } from '../utils.js'
import type { KadDHTComponents } from '../index.js'
import type { Network } from '../network.js'
import type { Logger } from '@libp2p/logger'
import type { PeerRouting } from '../peer-routing/index.js'
import type { Providers } from '../providers.js'
import type { QueryManager } from '../query/manager.js'
import type { QueryFunc } from '../query/types.js'
import type { CID } from 'multiformats/cid'
import type { RoutingTable } from '../routing-table/index.js'
import type { PeerResponseEvent, ProviderEvent, QueryEvent, QueryOptions } from '@libp2p/interface-dht'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { AbortOptions } from '@libp2p/interfaces'
import type { Logger } from '@libp2p/logger'
import type { Multiaddr } from '@multiformats/multiaddr'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { KadDHTComponents } from '../index.js'
import type { CID } from 'multiformats/cid'

export interface ContentRoutingInit {
network: Network
Expand Down
22 changes: 9 additions & 13 deletions src/dual-kad-dht.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { logger } from '@libp2p/logger'
import { symbol } from '@libp2p/interface-peer-discovery'
import { CodeError } from '@libp2p/interfaces/errors'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import { logger } from '@libp2p/logger'
import merge from 'it-merge'
import { queryErrorEvent } from './query/events.js'
import type { KadDHTComponents } from './index.js'
import type { KadDHT } from './kad-dht.js'
import type { DualDHT, QueryEvent, QueryOptions } from '@libp2p/interface-dht'
import type { PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { AbortOptions } from '@libp2p/interfaces'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import type { CID } from 'multiformats'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import { symbol } from '@libp2p/interface-peer-discovery'
import type { KadDHTComponents } from './index.js'

const log = logger('libp2p:kad-dht')

Expand Down Expand Up @@ -43,13 +43,9 @@ export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements Dua
})
}

get [symbol] (): true {
return true
}
readonly [symbol] = true

get [Symbol.toStringTag] (): '@libp2p/dual-kad-dht' {
return '@libp2p/dual-kad-dht'
}
readonly [Symbol.toStringTag] = '@libp2p/dual-kad-dht'

/**
* Is this DHT running.
Expand All @@ -62,7 +58,7 @@ export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements Dua
* If 'server' this node will respond to DHT queries, if 'client' this node will not
*/
async getMode (): Promise<'client' | 'server'> {
return await this.wan.getMode()
return this.wan.getMode()
}

/**
Expand Down
26 changes: 13 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { KadDHT as SingleKadDHT } from './kad-dht.js'
import { DualKadDHT } from './dual-kad-dht.js'
import drain from 'it-drain'
import { type ContentRouting, contentRouting } from '@libp2p/interface-content-routing'
import { type PeerDiscovery, peerDiscovery } from '@libp2p/interface-peer-discovery'
import { type PeerRouting, peerRouting } from '@libp2p/interface-peer-routing'
import { CodeError } from '@libp2p/interfaces/errors'
import type { DHT, DualDHT, Selectors, Validators } from '@libp2p/interface-dht'
import { ContentRouting, contentRouting } from '@libp2p/interface-content-routing'
import type { CID } from 'multiformats/cid'
import type { AbortOptions } from '@libp2p/interfaces'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import drain from 'it-drain'
import { DualKadDHT } from './dual-kad-dht.js'
import { KadDHT as SingleKadDHT } from './kad-dht.js'
import type { ProvidersInit } from './providers.js'
import type { Registrar } from '@libp2p/interface-registrar'
import type { AddressManager } from '@libp2p/interface-address-manager'
import type { PeerStore } from '@libp2p/interface-peer-store'
import type { ConnectionManager } from '@libp2p/interface-connection-manager'
import type { DHT, DualDHT, Selectors, Validators } from '@libp2p/interface-dht'
import type { Metrics } from '@libp2p/interface-metrics'
import type { Datastore } from 'interface-datastore'
import { PeerRouting, peerRouting } from '@libp2p/interface-peer-routing'
import { PeerDiscovery, peerDiscovery } from '@libp2p/interface-peer-discovery'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { PeerStore } from '@libp2p/interface-peer-store'
import type { Registrar } from '@libp2p/interface-registrar'
import type { AbortOptions } from '@libp2p/interfaces'
import type { Datastore } from 'interface-datastore'
import type { CID } from 'multiformats/cid'

export interface KadDHTInit {
/**
Expand Down
36 changes: 16 additions & 20 deletions src/kad-dht.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { RoutingTable } from './routing-table/index.js'
import { RoutingTableRefresh } from './routing-table/refresh.js'
import { Network } from './network.js'
import { symbol } from '@libp2p/interface-peer-discovery'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
import { type Logger, logger } from '@libp2p/logger'
import { selectors as recordSelectors } from '@libp2p/record/selectors'
import { validators as recordValidators } from '@libp2p/record/validators'
import pDefer from 'p-defer'
import { PROTOCOL_DHT, PROTOCOL_PREFIX, LAN_PREFIX } from './constants.js'
import { ContentFetching } from './content-fetching/index.js'
import { ContentRouting } from './content-routing/index.js'
import { Network } from './network.js'
import { PeerRouting } from './peer-routing/index.js'
import { Providers } from './providers.js'
import { QueryManager } from './query/manager.js'
import { QuerySelf } from './query-self.js'
import { RoutingTable } from './routing-table/index.js'
import { RoutingTableRefresh } from './routing-table/refresh.js'
import { RPC } from './rpc/index.js'
import { TopologyListener } from './topology-listener.js'
import { QuerySelf } from './query-self.js'
import {
removePrivateAddresses,
removePublicAddresses
} from './utils.js'
import { Logger, logger } from '@libp2p/logger'
import type { KadDHTComponents, KadDHTInit } from './index.js'
import type { QueryOptions, Validators, Selectors, DHT, QueryEvent } from '@libp2p/interface-dht'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
import type { PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { CID } from 'multiformats/cid'
import type { PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import type { KadDHTComponents, KadDHTInit } from './index.js'
import { validators as recordValidators } from '@libp2p/record/validators'
import { selectors as recordSelectors } from '@libp2p/record/selectors'
import { symbol } from '@libp2p/interface-peer-discovery'
import { PROTOCOL_DHT, PROTOCOL_PREFIX, LAN_PREFIX } from './constants.js'
import pDefer from 'p-defer'

export const DEFAULT_MAX_INBOUND_STREAMS = 32
export const DEFAULT_MAX_OUTBOUND_STREAMS = 64
Expand Down Expand Up @@ -219,13 +219,9 @@ export class KadDHT extends EventEmitter<PeerDiscoveryEvents> implements DHT {
})
}

get [symbol] (): true {
return true
}
readonly [symbol] = true

get [Symbol.toStringTag] (): '@libp2p/kad-dht' {
return '@libp2p/kad-dht'
}
readonly [Symbol.toStringTag] = '@libp2p/kad-dht'

async onPeerConnect (peerData: PeerInfo): Promise<void> {
this.log('peer %p connected with protocols', peerData.id, peerData.protocols)
Expand Down
2 changes: 1 addition & 1 deletion src/message/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { peerIdFromBytes } from '@libp2p/peer-id'
import { multiaddr } from '@multiformats/multiaddr'
import { Libp2pRecord } from '@libp2p/record'
import { multiaddr } from '@multiformats/multiaddr'
import { Message as PBMessage } from './dht.js'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { Uint8ArrayList } from 'uint8arraylist'
Expand Down
18 changes: 9 additions & 9 deletions src/network.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { CodeError } from '@libp2p/interfaces/errors'
import { pipe } from 'it-pipe'
import * as lp from 'it-length-prefixed'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import { logger } from '@libp2p/logger'
import { abortableDuplex } from 'abortable-iterator'
import drain from 'it-drain'
import first from 'it-first'
import * as lp from 'it-length-prefixed'
import { pipe } from 'it-pipe'
import { Message } from './message/index.js'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import {
dialingPeerEvent,
sendingQueryEvent,
peerResponseEvent,
queryErrorEvent
} from './query/events.js'
import { logger } from '@libp2p/logger'
import type { KadDHTComponents } from './index.js'
import type { Stream } from '@libp2p/interface-connection'
import type { QueryEvent } from '@libp2p/interface-dht'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { AbortOptions } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import type { Logger } from '@libp2p/logger'
import type { Duplex, Source } from 'it-stream-types'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { Stream } from '@libp2p/interface-connection'
import { abortableDuplex } from 'abortable-iterator'
import type { Uint8ArrayList } from 'uint8arraylist'
import type { KadDHTComponents } from './index.js'
import type { QueryEvent } from '@libp2p/interface-dht'

export interface NetworkInit {
protocol: string
Expand Down
2 changes: 1 addition & 1 deletion src/peer-list/peer-distance-list.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as utils from '../utils.js'
import { compare as uint8ArrayCompare } from 'uint8arrays/compare'
import { xor as uint8ArrayXor } from 'uint8arrays/xor'
import * as utils from '../utils.js'
import type { PeerId } from '@libp2p/interface-peer-id'

interface PeerDistance {
Expand Down
26 changes: 13 additions & 13 deletions src/peer-routing/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { keys } from '@libp2p/crypto'
import { CodeError } from '@libp2p/interfaces/errors'
import { logger } from '@libp2p/logger'
import { peerIdFromKeys } from '@libp2p/peer-id'
import { Libp2pRecord } from '@libp2p/record'
import { verifyRecord } from '@libp2p/record/validators'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { Message, MESSAGE_TYPE } from '../message/index.js'
import * as utils from '../utils.js'
import { PeerDistanceList } from '../peer-list/peer-distance-list.js'
import {
queryErrorEvent,
finalPeerEvent,
valueEvent
} from '../query/events.js'
import { PeerDistanceList } from '../peer-list/peer-distance-list.js'
import { Libp2pRecord } from '@libp2p/record'
import { logger } from '@libp2p/logger'
import { keys } from '@libp2p/crypto'
import { peerIdFromKeys } from '@libp2p/peer-id'
import type { DHTRecord, DialingPeerEvent, FinalPeerEvent, QueryEvent, Validators } from '@libp2p/interface-dht'
import type { RoutingTable } from '../routing-table/index.js'
import type { QueryManager, QueryOptions } from '../query/manager.js'
import * as utils from '../utils.js'
import type { KadDHTComponents } from '../index.js'
import type { Network } from '../network.js'
import type { Logger } from '@libp2p/logger'
import type { AbortOptions } from '@libp2p/interfaces'
import type { QueryManager, QueryOptions } from '../query/manager.js'
import type { QueryFunc } from '../query/types.js'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { RoutingTable } from '../routing-table/index.js'
import type { DHTRecord, DialingPeerEvent, FinalPeerEvent, QueryEvent, Validators } from '@libp2p/interface-dht'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { KadDHTComponents } from '../index.js'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { AbortOptions } from '@libp2p/interfaces'
import type { Logger } from '@libp2p/logger'

export interface PeerRoutingInit {
routingTable: RoutingTable
Expand Down
14 changes: 7 additions & 7 deletions src/providers.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { logger } from '@libp2p/logger'
import { peerIdFromString } from '@libp2p/peer-id'
import cache from 'hashlru'
import varint from 'varint'
import { Key } from 'interface-datastore/key'
import Queue from 'p-queue'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import varint from 'varint'
import {
PROVIDERS_CLEANUP_INTERVAL,
PROVIDERS_VALIDITY,
PROVIDERS_LRU_CACHE_SIZE,
PROVIDER_KEY_PREFIX
} from './constants.js'
import { logger } from '@libp2p/logger'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { peerIdFromString } from '@libp2p/peer-id'
import type { Datastore } from 'interface-datastore'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { Startable } from '@libp2p/interfaces/startable'
import type { Datastore } from 'interface-datastore'
import type { CID } from 'multiformats'
import type { PeerId } from '@libp2p/interface-peer-id'

const log = logger('libp2p:kad-dht:providers')

Expand Down Expand Up @@ -209,7 +209,7 @@ export class Providers implements Startable {
* Get a list of providers for the given CID
*/
async getProviders (cid: CID): Promise<PeerId[]> {
return await this.syncQueue.add(async () => {
return this.syncQueue.add(async () => {
log('get providers for %s', cid)
const provs = await this._getProvidersMap(cid)

Expand Down
Loading

0 comments on commit dc53728

Please sign in to comment.