Skip to content

Commit e4e1f7e

Browse files
achingbrainmaschadwemeetagain
authored
fix!: remove dialler language (#2143)
Co-authored-by: Chad Nehemiah <[email protected]> Co-authored-by: Cayman <[email protected]>
1 parent 911f153 commit e4e1f7e

File tree

3 files changed

+75
-22
lines changed

3 files changed

+75
-22
lines changed

doc/migrations/v0.46-v1.0.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!--Specify versions for migration below-->
2+
# Migrating to [email protected] <!-- omit in toc -->
3+
4+
A migration guide for refactoring your application code from libp2p v0.46 to v1.0.
5+
6+
## Table of Contents <!-- omit in toc -->
7+
8+
- [API](#api)
9+
- [Module Updates](#module-updates)
10+
- [Metrics](#metrics)
11+
12+
## API
13+
14+
<!--Describe breaking APIs with examples for Before and After
15+
Example:
16+
17+
### Peer Discovery
18+
19+
__Describe__
20+
21+
**Before**
22+
23+
```js
24+
25+
```
26+
27+
**After**
28+
29+
```js
30+
31+
```
32+
33+
-->
34+
35+
## Module Updates
36+
37+
With this release you should update the following libp2p modules if you are relying on them:
38+
39+
<!--Specify module versions in JSON for migration below.
40+
It's recommended to check package.json changes for this:
41+
`git diff <release> <prev> -- package.json`
42+
-->
43+
44+
```json
45+
46+
```
47+
48+
## Metrics
49+
50+
The following metrics were renamed:
51+
52+
`libp2p_dialler_pending_dials` => `libp2p_dial_queue_pending_dials`
53+
`libp2p_dialler_in_progress_dials` => `libp2p_dial_queue_in_progress_dials`

packages/libp2p/src/connection-manager/dial-queue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export class DialQueue {
101101
setMaxListeners?.(Infinity, this.shutDownController.signal)
102102
} catch {}
103103

104-
this.pendingDialCount = components.metrics?.registerMetric('libp2p_dialler_pending_dials')
105-
this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dialler_in_progress_dials')
104+
this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials')
105+
this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials')
106106
this.pendingDials = []
107107

108108
for (const [key, value] of Object.entries(init.resolvers ?? {})) {

packages/libp2p/test/connection-manager/auto-dial.spec.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { PeerStore, Peer } from '@libp2p/interface/peer-store'
2222
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
2323

2424
describe('auto-dial', () => {
25-
let autoDialler: AutoDial
25+
let autoDialer: AutoDial
2626
let events: EventEmitter<Libp2pEvents>
2727
let peerStore: PeerStore
2828
let peerId: PeerId
@@ -38,8 +38,8 @@ describe('auto-dial', () => {
3838
})
3939

4040
afterEach(() => {
41-
if (autoDialler != null) {
42-
autoDialler.stop()
41+
if (autoDialer != null) {
42+
autoDialer.stop()
4343
}
4444
})
4545

@@ -73,16 +73,16 @@ describe('auto-dial', () => {
7373
getDialQueue: []
7474
})
7575

76-
autoDialler = new AutoDial({
76+
autoDialer = new AutoDial({
7777
peerStore,
7878
connectionManager,
7979
events
8080
}, {
8181
minConnections: 10,
8282
autoDialInterval: 10000
8383
})
84-
autoDialler.start()
85-
void autoDialler.autoDial()
84+
autoDialer.start()
85+
void autoDialer.autoDial()
8686

8787
await pWaitFor(() => {
8888
return connectionManager.openConnection.callCount === 1
@@ -127,15 +127,15 @@ describe('auto-dial', () => {
127127
getDialQueue: []
128128
})
129129

130-
autoDialler = new AutoDial({
130+
autoDialer = new AutoDial({
131131
peerStore,
132132
connectionManager,
133133
events
134134
}, {
135135
minConnections: 10
136136
})
137-
autoDialler.start()
138-
await autoDialler.autoDial()
137+
autoDialer.start()
138+
await autoDialer.autoDial()
139139

140140
await pWaitFor(() => connectionManager.openConnection.callCount === 1)
141141
await delay(1000)
@@ -181,15 +181,15 @@ describe('auto-dial', () => {
181181
}]
182182
})
183183

184-
autoDialler = new AutoDial({
184+
autoDialer = new AutoDial({
185185
peerStore,
186186
connectionManager,
187187
events
188188
}, {
189189
minConnections: 10
190190
})
191-
autoDialler.start()
192-
await autoDialler.autoDial()
191+
autoDialer.start()
192+
await autoDialer.autoDial()
193193

194194
await pWaitFor(() => connectionManager.openConnection.callCount === 1)
195195
await delay(1000)
@@ -207,20 +207,20 @@ describe('auto-dial', () => {
207207
getDialQueue: []
208208
})
209209

210-
autoDialler = new AutoDial({
210+
autoDialer = new AutoDial({
211211
peerStore,
212212
connectionManager,
213213
events
214214
}, {
215215
minConnections: 10,
216216
autoDialInterval: 10000
217217
})
218-
autoDialler.start()
218+
autoDialer.start()
219219

220220
// call autodial twice
221221
await Promise.all([
222-
autoDialler.autoDial(),
223-
autoDialler.autoDial()
222+
autoDialer.autoDial(),
223+
autoDialer.autoDial()
224224
])
225225

226226
// should only have queried peer store once
@@ -258,17 +258,17 @@ describe('auto-dial', () => {
258258
getDialQueue: []
259259
})
260260

261-
autoDialler = new AutoDial({
261+
autoDialer = new AutoDial({
262262
peerStore,
263263
connectionManager,
264264
events
265265
}, {
266266
minConnections: 10,
267267
autoDialPeerRetryThreshold: 2000
268268
})
269-
autoDialler.start()
269+
autoDialer.start()
270270

271-
void autoDialler.autoDial()
271+
void autoDialer.autoDial()
272272

273273
await pWaitFor(() => {
274274
return connectionManager.openConnection.callCount === 1
@@ -282,7 +282,7 @@ describe('auto-dial', () => {
282282
await delay(2000)
283283

284284
// autodial again
285-
void autoDialler.autoDial()
285+
void autoDialer.autoDial()
286286

287287
await pWaitFor(() => {
288288
return connectionManager.openConnection.callCount === 3

0 commit comments

Comments
 (0)