@waku/core 0.0.29-fd60cc2.0 → 0.0.30-00c77c6.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 +33 -0
- package/bundle/{base_protocol-B8NGoK0E.js → base_protocol-kugTP2Op.js} +2 -2
- package/bundle/{browser-DoQRY-an.js → browser-B9234RhB.js} +5 -0
- package/bundle/{index-DBP1NHED.js → index-egXdK_Fb.js} +6 -14
- package/bundle/index.js +160 -371
- package/bundle/lib/base_protocol.js +3 -3
- package/bundle/lib/message/version_0.js +3 -3
- package/bundle/lib/predefined_bootstrap_nodes.js +1 -1
- package/bundle/{version_0-B6lI5jri.js → version_0-BoLZMvhu.js} +3 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/filter/index.d.ts +13 -2
- package/dist/lib/filter/index.js +151 -273
- package/dist/lib/filter/index.js.map +1 -1
- package/dist/lib/keep_alive_manager.js +1 -1
- package/dist/lib/light_push/index.d.ts +3 -4
- package/dist/lib/light_push/index.js.map +1 -1
- package/dist/lib/metadata/index.js.map +1 -1
- package/dist/lib/wait_for_remote_peer.js +1 -1
- package/dist/lib/wait_for_remote_peer.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/lib/filter/index.ts +223 -481
- package/src/lib/keep_alive_manager.ts +1 -1
- package/src/lib/light_push/index.ts +10 -12
- package/src/lib/metadata/index.ts +6 -4
- package/src/lib/wait_for_remote_peer.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -5,6 +5,39 @@ 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.29](https://github.com/waku-org/js-waku/compare/core-v0.0.28...core-v0.0.29) (2024-04-30)
|
9
|
+
|
10
|
+
|
11
|
+
### ⚠ BREAKING CHANGES
|
12
|
+
|
13
|
+
* use ShardingParams on subscriptions, make Decoder/Encoder auto sharding friendly by default ([#1958](https://github.com/waku-org/js-waku/issues/1958))
|
14
|
+
* **lightpush:** move protocol implementation to `@waku/sdk` (1/n) ([#1964](https://github.com/waku-org/js-waku/issues/1964))
|
15
|
+
|
16
|
+
### Features
|
17
|
+
|
18
|
+
* Use ShardingParams on subscriptions, make Decoder/Encoder auto sharding friendly by default ([#1958](https://github.com/waku-org/js-waku/issues/1958)) ([f3627c4](https://github.com/waku-org/js-waku/commit/f3627c46a4c231013c5ffa4aa6f1ecbe3c06c5e3))
|
19
|
+
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* Only override ping metadata in peer store ([#1984](https://github.com/waku-org/js-waku/issues/1984)) ([fb34b72](https://github.com/waku-org/js-waku/commit/fb34b7262a8d85fdf76cb30774d14bcd3a150f58))
|
24
|
+
* Use correct shard index when creating encoder ([9514653](https://github.com/waku-org/js-waku/commit/95146534288f842ff1cf180fc62850d539937a05))
|
25
|
+
|
26
|
+
|
27
|
+
### Miscellaneous Chores
|
28
|
+
|
29
|
+
* **lightpush:** Move protocol implementation to `@waku/sdk` (1/n) ([#1964](https://github.com/waku-org/js-waku/issues/1964)) ([5fb1006](https://github.com/waku-org/js-waku/commit/5fb100602b347ad13718c85c52d22a932c15aa18))
|
30
|
+
|
31
|
+
|
32
|
+
### Dependencies
|
33
|
+
|
34
|
+
* The following workspace dependencies were updated
|
35
|
+
* dependencies
|
36
|
+
* @waku/enr bumped from ^0.0.22 to ^0.0.23
|
37
|
+
* @waku/interfaces bumped from 0.0.23 to 0.0.24
|
38
|
+
* @waku/proto bumped from 0.0.6 to 0.0.7
|
39
|
+
* @waku/utils bumped from 0.0.16 to 0.0.17
|
40
|
+
|
8
41
|
## [0.0.28](https://github.com/waku-org/js-waku/compare/core-v0.0.27...core-v0.0.28) (2024-04-09)
|
9
42
|
|
10
43
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { T as Tags } from './browser-
|
1
|
+
import { c as bytesToUtf8, L as Logger, e as ensureShardingConfigured } from './index-egXdK_Fb.js';
|
2
|
+
import { T as Tags } from './browser-B9234RhB.js';
|
3
3
|
|
4
4
|
const decodeRelayShard = (bytes) => {
|
5
5
|
// explicitly converting to Uint8Array to avoid Buffer
|
@@ -656,6 +656,11 @@ var ProtocolError;
|
|
656
656
|
* Please ensure that the PubsubTopic is used when initializing the Waku node.
|
657
657
|
*/
|
658
658
|
ProtocolError["TOPIC_NOT_CONFIGURED"] = "Topic not configured";
|
659
|
+
/**
|
660
|
+
* The pubsub topic configured on the decoder does not match the pubsub topic setup on the protocol.
|
661
|
+
* Ensure that the pubsub topic used for decoder creation is the same as the one used for protocol.
|
662
|
+
*/
|
663
|
+
ProtocolError["TOPIC_DECODER_MISMATCH"] = "Topic decoder mismatch";
|
659
664
|
/**
|
660
665
|
* Failure to find a peer with suitable protocols. This may due to a connection issue.
|
661
666
|
* Mitigation can be: retrying after a given time period, display connectivity issue
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { i as identityBase, c as base2, d as base8, e as base10, f as base16, h as base32, j as base36, k as base58, l as base64, m as base256emoji, n as debug } from './browser-
|
1
|
+
import { i as identityBase, c as base2, d as base8, e as base10, f as base16, h as base32, j as base36, k as base58, l as base64, m as base256emoji, n as debug } from './browser-B9234RhB.js';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Returns a `Uint8Array` of the requested size. Referenced memory will
|
@@ -379,7 +379,6 @@ const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256());
|
|
379
379
|
/**
|
380
380
|
* DefaultPubsubTopic is the default gossipsub topic to use for Waku.
|
381
381
|
*/
|
382
|
-
const DefaultPubsubTopic = "/waku/2/default-waku/proto";
|
383
382
|
/**
|
384
383
|
* The default cluster ID for The Waku Network
|
385
384
|
*/
|
@@ -424,9 +423,9 @@ function concat(byteArrays, totalLength) {
|
|
424
423
|
}
|
425
424
|
|
426
425
|
const singleShardInfoToPubsubTopic = (shardInfo) => {
|
427
|
-
if (shardInfo.
|
426
|
+
if (shardInfo.shard === undefined)
|
428
427
|
throw new Error("Invalid shard");
|
429
|
-
return `/waku/2/rs/${shardInfo.clusterId}/${shardInfo.shard}`;
|
428
|
+
return `/waku/2/rs/${shardInfo.clusterId ?? DEFAULT_CLUSTER_ID}/${shardInfo.shard}`;
|
430
429
|
};
|
431
430
|
const shardInfoToPubsubTopics = (shardInfo) => {
|
432
431
|
if ("contentTopics" in shardInfo && shardInfo.contentTopics) {
|
@@ -465,13 +464,6 @@ const pubsubTopicToSingleShardInfo = (pubsubTopics) => {
|
|
465
464
|
shard
|
466
465
|
};
|
467
466
|
};
|
468
|
-
//TODO: move part of BaseProtocol instead of utils
|
469
|
-
// return `ProtocolError.TOPIC_NOT_CONFIGURED` instead of throwing
|
470
|
-
function ensurePubsubTopicIsConfigured(pubsubTopic, configuredTopics) {
|
471
|
-
if (!configuredTopics.includes(pubsubTopic)) {
|
472
|
-
throw new Error(`Pubsub topic ${pubsubTopic} has not been configured on this instance. Configured topics are: ${configuredTopics}. Please update your configuration by passing in the topic during Waku node instantiation.`);
|
473
|
-
}
|
474
|
-
}
|
475
467
|
/**
|
476
468
|
* Given a string, will throw an error if it is not formatted as a valid content topic for autosharding based on https://rfc.vac.dev/spec/51/
|
477
469
|
* @param contentTopic String to validate
|
@@ -543,9 +535,9 @@ function determinePubsubTopic(contentTopic, pubsubTopicShardInfo) {
|
|
543
535
|
if (typeof pubsubTopicShardInfo == "string") {
|
544
536
|
return pubsubTopicShardInfo;
|
545
537
|
}
|
546
|
-
return pubsubTopicShardInfo?.shard
|
538
|
+
return pubsubTopicShardInfo?.shard !== undefined
|
547
539
|
? singleShardInfoToPubsubTopic(pubsubTopicShardInfo)
|
548
|
-
: contentTopicToPubsubTopic(contentTopic, pubsubTopicShardInfo?.clusterId
|
540
|
+
: contentTopicToPubsubTopic(contentTopic, pubsubTopicShardInfo?.clusterId ?? DEFAULT_CLUSTER_ID);
|
549
541
|
}
|
550
542
|
/**
|
551
543
|
* Validates sharding configuration and sets defaults where possible.
|
@@ -619,4 +611,4 @@ class Logger {
|
|
619
611
|
}
|
620
612
|
}
|
621
613
|
|
622
|
-
export {
|
614
|
+
export { Logger as L, allocUnsafe as a, alloc as b, bytesToUtf8 as c, determinePubsubTopic as d, ensureShardingConfigured as e, fromString as f, pubsubTopicToSingleShardInfo as p, shardInfoToPubsubTopics as s, utf8ToBytes as u };
|