@waku/core 0.0.30-e49e728.0 → 0.0.31-04bd518.0
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 +27 -0
- package/bundle/{base_protocol-DCOj0QWD.js → base_protocol-BM6GbS_d.js} +20 -20
- package/bundle/{browser-zSUobdfj.js → index-DnW8ifxc.js} +616 -5
- package/bundle/index.js +103 -102
- package/bundle/lib/base_protocol.js +2 -3
- package/bundle/lib/message/version_0.js +2 -3
- package/bundle/{version_0-TEIsGmpJ.js → version_0-WhJLc79v.js} +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/base_protocol.d.ts +2 -2
- package/dist/lib/base_protocol.js +1 -1
- package/dist/lib/base_protocol.js.map +1 -1
- package/dist/lib/connection_manager.d.ts +4 -3
- package/dist/lib/connection_manager.js +37 -39
- package/dist/lib/connection_manager.js.map +1 -1
- package/dist/lib/filter/filter_rpc.js.map +1 -1
- package/dist/lib/filter/index.d.ts +2 -2
- package/dist/lib/filter/index.js +34 -30
- package/dist/lib/filter/index.js.map +1 -1
- package/dist/lib/keep_alive_manager.d.ts +13 -7
- package/dist/lib/keep_alive_manager.js +9 -9
- package/dist/lib/keep_alive_manager.js.map +1 -1
- package/dist/lib/light_push/index.js.map +1 -1
- package/dist/lib/light_push/push_rpc.js.map +1 -1
- package/dist/lib/message/version_0.js.map +1 -1
- package/dist/lib/metadata/index.js +18 -18
- package/dist/lib/metadata/index.js.map +1 -1
- package/dist/lib/store/history_rpc.js.map +1 -1
- package/dist/lib/store/index.js.map +1 -1
- package/dist/lib/stream_manager/index.d.ts +1 -0
- package/dist/lib/stream_manager/index.js +2 -0
- package/dist/lib/stream_manager/index.js.map +1 -0
- package/dist/lib/{stream_manager.js → stream_manager/stream_manager.js} +1 -1
- package/dist/lib/stream_manager/stream_manager.js.map +1 -0
- package/dist/lib/stream_manager/utils.d.ts +2 -0
- package/dist/lib/stream_manager/utils.js +19 -0
- package/dist/lib/stream_manager/utils.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/lib/base_protocol.ts +4 -3
- package/src/lib/connection_manager.ts +54 -55
- package/src/lib/filter/filter_rpc.ts +21 -19
- package/src/lib/filter/index.ts +54 -45
- package/src/lib/keep_alive_manager.ts +27 -18
- package/src/lib/light_push/index.ts +2 -2
- package/src/lib/light_push/push_rpc.ts +5 -5
- package/src/lib/message/version_0.ts +17 -15
- package/src/lib/metadata/index.ts +33 -33
- package/src/lib/store/history_rpc.ts +5 -5
- package/src/lib/store/index.ts +2 -2
- package/src/lib/stream_manager/index.ts +1 -0
- package/src/lib/{stream_manager.ts → stream_manager/stream_manager.ts} +3 -2
- package/src/lib/stream_manager/utils.ts +22 -0
- package/bundle/index-BcSodzY4.js +0 -614
- package/bundle/lib/predefined_bootstrap_nodes.js +0 -81
- package/dist/lib/predefined_bootstrap_nodes.d.ts +0 -34
- package/dist/lib/predefined_bootstrap_nodes.js +0 -54
- package/dist/lib/predefined_bootstrap_nodes.js.map +0 -1
- package/dist/lib/stream_manager.js.map +0 -1
- package/src/lib/predefined_bootstrap_nodes.ts +0 -68
- /package/dist/lib/{stream_manager.d.ts → stream_manager/stream_manager.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The file is maintained by [Release Please](https://github.com/googleapis/release-please) based on [Conventional Commits](https://www.conventionalcommits.org) specification,
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.0.30](https://github.com/waku-org/js-waku/compare/core-v0.0.29...core-v0.0.30) (2024-07-10)
|
9
|
+
|
10
|
+
|
11
|
+
### ⚠ BREAKING CHANGES
|
12
|
+
|
13
|
+
* **filter:** return error codes instead of throwing errors ([#1971](https://github.com/waku-org/js-waku/issues/1971))
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
* **filter:** Return error codes instead of throwing errors ([#1971](https://github.com/waku-org/js-waku/issues/1971)) ([4eb06c6](https://github.com/waku-org/js-waku/commit/4eb06c64eb05c015e2f51e3f45a9d7143a934385))
|
18
|
+
* **lightpush:** Peer management for protocols ([#2003](https://github.com/waku-org/js-waku/issues/2003)) ([93e78c3](https://github.com/waku-org/js-waku/commit/93e78c3b876e084ab70e07c64c9b721693b659f8))
|
19
|
+
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* Failing `node_optional` check ([#2025](https://github.com/waku-org/js-waku/issues/2025)) ([984fb94](https://github.com/waku-org/js-waku/commit/984fb94b5b23a0d2f7edebad36170911ce7a2e84))
|
24
|
+
* Increasing maxInboundStreams for lightpush from 32 to 100 ([#2021](https://github.com/waku-org/js-waku/issues/2021)) ([2311a59](https://github.com/waku-org/js-waku/commit/2311a595b28b9e7c99fcd96044cf098ad975c70c))
|
25
|
+
|
26
|
+
|
27
|
+
### Dependencies
|
28
|
+
|
29
|
+
* The following workspace dependencies were updated
|
30
|
+
* dependencies
|
31
|
+
* @waku/enr bumped from ^0.0.23 to ^0.0.24
|
32
|
+
* @waku/interfaces bumped from 0.0.24 to 0.0.25
|
33
|
+
* @waku/utils bumped from 0.0.17 to 0.0.18
|
34
|
+
|
8
35
|
## [0.0.29](https://github.com/waku-org/js-waku/compare/core-v0.0.28...core-v0.0.29) (2024-04-30)
|
9
36
|
|
10
37
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { T as Tags } from './browser-zSUobdfj.js';
|
1
|
+
import { h as bytesToUtf8, T as Tags, L as Logger, i as ensureShardingConfigured } from './index-DnW8ifxc.js';
|
3
2
|
|
4
3
|
const decodeRelayShard = (bytes) => {
|
5
4
|
// explicitly converting to Uint8Array to avoid Buffer
|
@@ -119,24 +118,6 @@ async function getConnectedPeersForProtocolAndShard(connections, peerStore, prot
|
|
119
118
|
const peersWithNulls = await Promise.all(peerPromises);
|
120
119
|
return peersWithNulls.filter((peer) => peer !== null);
|
121
120
|
}
|
122
|
-
function selectConnection(connections) {
|
123
|
-
if (!connections.length)
|
124
|
-
return;
|
125
|
-
if (connections.length === 1)
|
126
|
-
return connections[0];
|
127
|
-
let latestConnection;
|
128
|
-
connections.forEach((connection) => {
|
129
|
-
if (connection.status === "open") {
|
130
|
-
if (!latestConnection) {
|
131
|
-
latestConnection = connection;
|
132
|
-
}
|
133
|
-
else if (connection.timeline.open > latestConnection.timeline.open) {
|
134
|
-
latestConnection = connection;
|
135
|
-
}
|
136
|
-
}
|
137
|
-
});
|
138
|
-
return latestConnection;
|
139
|
-
}
|
140
121
|
|
141
122
|
/**
|
142
123
|
* Retrieves a list of peers based on the specified criteria:
|
@@ -175,6 +156,25 @@ function filterPeersByDiscovery(peers, numPeers, maxBootstrapPeers) {
|
|
175
156
|
return selectedPeers;
|
176
157
|
}
|
177
158
|
|
159
|
+
function selectConnection(connections) {
|
160
|
+
if (!connections.length)
|
161
|
+
return;
|
162
|
+
if (connections.length === 1)
|
163
|
+
return connections[0];
|
164
|
+
let latestConnection;
|
165
|
+
connections.forEach((connection) => {
|
166
|
+
if (connection.status === "open") {
|
167
|
+
if (!latestConnection) {
|
168
|
+
latestConnection = connection;
|
169
|
+
}
|
170
|
+
else if (connection.timeline.open > latestConnection.timeline.open) {
|
171
|
+
latestConnection = connection;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
});
|
175
|
+
return latestConnection;
|
176
|
+
}
|
177
|
+
|
178
178
|
const CONNECTION_TIMEOUT = 5_000;
|
179
179
|
const RETRY_BACKOFF_BASE = 1_000;
|
180
180
|
const MAX_RETRIES = 3;
|