Skip to content

Commit 4cbeaad

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

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
@@ -103,8 +103,8 @@ export class DialQueue {
103103

104104
setMaxListeners(Infinity, this.shutDownController.signal)
105105

106-
this.pendingDialCount = components.metrics?.registerMetric('libp2p_dialler_pending_dials')
107-
this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dialler_in_progress_dials')
106+
this.pendingDialCount = components.metrics?.registerMetric('libp2p_dial_queue_pending_dials')
107+
this.inProgressDialCount = components.metrics?.registerMetric('libp2p_dial_queue_in_progress_dials')
108108
this.pendingDials = []
109109

110110
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
@@ -23,7 +23,7 @@ import type { PeerStore, Peer } from '@libp2p/interface/peer-store'
2323
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
2424

2525
describe('auto-dial', () => {
26-
let autoDialler: AutoDial
26+
let autoDialer: AutoDial
2727
let events: TypedEventTarget<Libp2pEvents>
2828
let peerStore: PeerStore
2929
let peerId: PeerId
@@ -39,8 +39,8 @@ describe('auto-dial', () => {
3939
})
4040

4141
afterEach(() => {
42-
if (autoDialler != null) {
43-
autoDialler.stop()
42+
if (autoDialer != null) {
43+
autoDialer.stop()
4444
}
4545
})
4646

@@ -74,16 +74,16 @@ describe('auto-dial', () => {
7474
getDialQueue: Sinon.stub().returns([])
7575
})
7676

77-
autoDialler = new AutoDial(defaultComponents({
77+
autoDialer = new AutoDial(defaultComponents({
7878
peerStore,
7979
connectionManager,
8080
events
8181
}), {
8282
minConnections: 10,
8383
autoDialInterval: 10000
8484
})
85-
autoDialler.start()
86-
void autoDialler.autoDial()
85+
autoDialer.start()
86+
void autoDialer.autoDial()
8787

8888
await pWaitFor(() => {
8989
return connectionManager.openConnection.callCount === 1
@@ -128,15 +128,15 @@ describe('auto-dial', () => {
128128
getDialQueue: Sinon.stub().returns([])
129129
})
130130

131-
autoDialler = new AutoDial(defaultComponents({
131+
autoDialer = new AutoDial(defaultComponents({
132132
peerStore,
133133
connectionManager,
134134
events
135135
}), {
136136
minConnections: 10
137137
})
138-
autoDialler.start()
139-
await autoDialler.autoDial()
138+
autoDialer.start()
139+
await autoDialer.autoDial()
140140

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

185-
autoDialler = new AutoDial(defaultComponents({
185+
autoDialer = new AutoDial(defaultComponents({
186186
peerStore,
187187
connectionManager,
188188
events
189189
}), {
190190
minConnections: 10
191191
})
192-
autoDialler.start()
193-
await autoDialler.autoDial()
192+
autoDialer.start()
193+
await autoDialer.autoDial()
194194

195195
await pWaitFor(() => connectionManager.openConnection.callCount === 1)
196196
await delay(1000)
@@ -208,20 +208,20 @@ describe('auto-dial', () => {
208208
getDialQueue: Sinon.stub().returns([])
209209
})
210210

211-
autoDialler = new AutoDial(defaultComponents({
211+
autoDialer = new AutoDial(defaultComponents({
212212
peerStore,
213213
connectionManager,
214214
events
215215
}), {
216216
minConnections: 10,
217217
autoDialInterval: 10000
218218
})
219-
autoDialler.start()
219+
autoDialer.start()
220220

221221
// call autodial twice
222222
await Promise.all([
223-
autoDialler.autoDial(),
224-
autoDialler.autoDial()
223+
autoDialer.autoDial(),
224+
autoDialer.autoDial()
225225
])
226226

227227
// should only have queried peer store once
@@ -259,17 +259,17 @@ describe('auto-dial', () => {
259259
getDialQueue: Sinon.stub().returns([])
260260
})
261261

262-
autoDialler = new AutoDial(defaultComponents({
262+
autoDialer = new AutoDial(defaultComponents({
263263
peerStore,
264264
connectionManager,
265265
events
266266
}), {
267267
minConnections: 10,
268268
autoDialPeerRetryThreshold: 2000
269269
})
270-
autoDialler.start()
270+
autoDialer.start()
271271

272-
void autoDialler.autoDial()
272+
void autoDialer.autoDial()
273273

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

285285
// autodial again
286-
void autoDialler.autoDial()
286+
void autoDialer.autoDial()
287287

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

0 commit comments

Comments
 (0)