@exodus/ethereum-api 8.71.0 → 8.71.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/package.json +3 -3
- package/src/exodus-eth-server/ws-gateway.js +36 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.71.2](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.71.1...@exodus/ethereum-api@8.71.2) (2026-04-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: update ethereumjs in ethereum-api (#7835)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [8.71.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.71.0...@exodus/ethereum-api@8.71.1) (2026-04-17)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* fix: ETH harden WsGateway reconnect, null-safety, and outbound message queuing (#7812)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [8.71.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.70.2...@exodus/ethereum-api@8.71.0) (2026-04-13)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.71.
|
|
3
|
+
"version": "8.71.2",
|
|
4
4
|
"description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Ethereum and EVM-based blockchains",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@exodus/ethereum-lib": "^5.22.0",
|
|
33
33
|
"@exodus/ethereum-meta": "^2.9.1",
|
|
34
34
|
"@exodus/ethereumholesky-meta": "^2.0.5",
|
|
35
|
-
"@exodus/ethereumjs": "^1.
|
|
35
|
+
"@exodus/ethereumjs": "^1.11.0",
|
|
36
36
|
"@exodus/fetch": "^1.3.0",
|
|
37
37
|
"@exodus/models": "^13.0.0",
|
|
38
38
|
"@exodus/safe-string": "^1.4.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"type": "git",
|
|
69
69
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "f231c77ebb4131fa38df759203a0855ea1e5df61"
|
|
72
72
|
}
|
|
@@ -28,6 +28,7 @@ const parseSubscriptionKey = (subscriptionKey) => {
|
|
|
28
28
|
|
|
29
29
|
export default class WsGateway extends EventEmitter {
|
|
30
30
|
#socket = null
|
|
31
|
+
#pendingOutboundMessages = []
|
|
31
32
|
// Dedup subscriptions to reduce workload on server and resubscribe after closing
|
|
32
33
|
#subscriptions = new Set()
|
|
33
34
|
#reconnectionTimeoutId = null
|
|
@@ -66,6 +67,7 @@ export default class WsGateway extends EventEmitter {
|
|
|
66
67
|
},
|
|
67
68
|
open: ({ target }) => {
|
|
68
69
|
if (target !== this.#socket) return
|
|
70
|
+
this.#flushPendingOutbound()
|
|
69
71
|
this.emit('opened')
|
|
70
72
|
},
|
|
71
73
|
error: ({ target }) => {
|
|
@@ -104,9 +106,17 @@ export default class WsGateway extends EventEmitter {
|
|
|
104
106
|
|
|
105
107
|
this.#clearSocketListeners()
|
|
106
108
|
|
|
107
|
-
if (this.#socket
|
|
109
|
+
if (this.#socket) {
|
|
110
|
+
if ([WebSocket.OPEN, WebSocket.CONNECTING].includes(this.#socket.readyState)) {
|
|
111
|
+
this.#socket.close()
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
this.#socket = null
|
|
115
|
+
}
|
|
116
|
+
|
|
108
117
|
clearTimeout(this.#reconnectionTimeoutId)
|
|
109
118
|
this.#subscriptions.clear()
|
|
119
|
+
this.#pendingOutboundMessages = []
|
|
110
120
|
|
|
111
121
|
this.#reconnectionTimeoutId = setTimeout(() => {
|
|
112
122
|
this.start()
|
|
@@ -190,11 +200,33 @@ export default class WsGateway extends EventEmitter {
|
|
|
190
200
|
}
|
|
191
201
|
|
|
192
202
|
#sendMessage(message) {
|
|
193
|
-
if (this.#socket
|
|
203
|
+
if (!this.#socket) {
|
|
204
|
+
this.start()
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (!this.#socket) {
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (this.#socket.readyState === WebSocket.OPEN) {
|
|
212
|
+
this.#socket.send(JSON.stringify(message))
|
|
194
213
|
return
|
|
195
214
|
}
|
|
196
215
|
|
|
197
|
-
this.#
|
|
216
|
+
this.#pendingOutboundMessages.push(message)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
#flushPendingOutbound() {
|
|
220
|
+
if (!this.#socket || this.#socket.readyState !== WebSocket.OPEN) {
|
|
221
|
+
return
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const pending = this.#pendingOutboundMessages
|
|
225
|
+
this.#pendingOutboundMessages = []
|
|
226
|
+
|
|
227
|
+
for (const message of pending) {
|
|
228
|
+
this.#socket.send(JSON.stringify(message))
|
|
229
|
+
}
|
|
198
230
|
}
|
|
199
231
|
|
|
200
232
|
#handleMessage(message) {
|
|
@@ -261,6 +293,7 @@ export default class WsGateway extends EventEmitter {
|
|
|
261
293
|
return
|
|
262
294
|
}
|
|
263
295
|
|
|
296
|
+
this.#flushPendingOutbound()
|
|
264
297
|
this.#clearSocketListeners()
|
|
265
298
|
|
|
266
299
|
clearTimeout(this.#reconnectionTimeoutId)
|