@libp2p/gossipsub 16.0.0 → 16.0.1
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/dist/index.min.js +1 -1
- package/dist/index.min.js.map +4 -4
- package/dist/src/score/message-deliveries.js +1 -1
- package/dist/src/score/peer-score-params.js +1 -1
- package/dist/src/score/peer-score-thresholds.js +1 -1
- package/dist/src/score/peer-score.d.ts +4 -4
- package/dist/src/score/peer-score.js +2 -2
- package/dist/src/score/peer-stats.d.ts +1 -1
- package/dist/src/utils/buildRawMessage.d.ts +4 -4
- package/dist/src/utils/buildRawMessage.d.ts.map +1 -1
- package/dist/src/utils/buildRawMessage.js +2 -2
- package/dist/src/utils/create-gossip-rpc.d.ts +1 -1
- package/dist/src/utils/msgIdFn.d.ts +1 -1
- package/dist/src/utils/publishConfig.d.ts +1 -1
- package/dist/src/utils/publishConfig.js +1 -1
- package/package.json +17 -16
- package/src/score/message-deliveries.ts +1 -1
- package/src/score/peer-score-params.ts +1 -1
- package/src/score/peer-score-thresholds.ts +1 -1
- package/src/score/peer-score.ts +4 -4
- package/src/score/peer-stats.ts +1 -1
- package/src/utils/buildRawMessage.ts +3 -3
- package/src/utils/create-gossip-rpc.ts +1 -1
- package/src/utils/msgIdFn.ts +1 -1
- package/src/utils/publishConfig.ts +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RejectReason } from '../types.
|
|
2
|
-
import { MapDef } from '../utils/set.
|
|
1
|
+
import { RejectReason } from '../types.ts';
|
|
2
|
+
import { MapDef } from '../utils/set.ts';
|
|
3
3
|
import { computeScore } from './compute-score.ts';
|
|
4
4
|
import { MessageDeliveries } from './message-deliveries.ts';
|
|
5
|
-
import type { MsgIdStr, PeerIdStr, TopicStr } from '../types.
|
|
5
|
+
import type { MsgIdStr, PeerIdStr, TopicStr } from '../types.ts';
|
|
6
6
|
import type { PeerScoreParams } from './peer-score-params.ts';
|
|
7
7
|
import type { PeerStats } from './peer-stats.ts';
|
|
8
|
-
import type { Metrics, ScorePenalty } from '../metrics.
|
|
8
|
+
import type { Metrics, ScorePenalty } from '../metrics.ts';
|
|
9
9
|
import type { ComponentLogger } from '@libp2p/interface';
|
|
10
10
|
interface PeerScoreOpts {
|
|
11
11
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RejectReason } from
|
|
2
|
-
import { MapDef } from
|
|
1
|
+
import { RejectReason } from "../types.js";
|
|
2
|
+
import { MapDef } from "../utils/set.js";
|
|
3
3
|
import { computeScore } from "./compute-score.js";
|
|
4
4
|
import { MessageDeliveries, DeliveryRecordStatus } from "./message-deliveries.js";
|
|
5
5
|
import { validatePeerScoreParams } from "./peer-score-params.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StrictSign, StrictNoSign } from '../index.ts';
|
|
2
|
-
import { RPC } from '../message/rpc.
|
|
3
|
-
import { ValidateError } from '../types.
|
|
2
|
+
import { RPC } from '../message/rpc.ts';
|
|
3
|
+
import { ValidateError } from '../types.ts';
|
|
4
4
|
import type { Message } from '../index.ts';
|
|
5
|
-
import type { PublishConfig, TopicStr } from '../types.
|
|
6
|
-
export declare const SignPrefix: Uint8Array<
|
|
5
|
+
import type { PublishConfig, TopicStr } from '../types.ts';
|
|
6
|
+
export declare const SignPrefix: Uint8Array<ArrayBuffer>;
|
|
7
7
|
export interface RawMessageAndMessage {
|
|
8
8
|
raw: RPC.Message;
|
|
9
9
|
msg: Message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRawMessage.d.ts","sourceRoot":"","sources":["../../../src/utils/buildRawMessage.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"buildRawMessage.d.ts","sourceRoot":"","sources":["../../../src/utils/buildRawMessage.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG1D,eAAO,MAAM,UAAU,yBAAyC,CAAA;AAgBhE,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;CACb;AAED,wBAAsB,eAAe,CACnC,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,QAAQ,EACf,YAAY,EAAE,UAAU,EACxB,eAAe,EAAE,UAAU,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAuD/B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAA;AAEzG,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,OAAO,YAAY,GAAG,OAAO,UAAU,EACxD,GAAG,EAAE,GAAG,CAAC,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC,CAqF3B"}
|
|
@@ -5,8 +5,8 @@ import { concat as uint8ArrayConcat } from 'uint8arrays/concat';
|
|
|
5
5
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
|
|
6
6
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
7
7
|
import { StrictSign, StrictNoSign } from "../index.js";
|
|
8
|
-
import { RPC } from
|
|
9
|
-
import { PublishConfigType, ValidateError } from
|
|
8
|
+
import { RPC } from "../message/rpc.js";
|
|
9
|
+
import { PublishConfigType, ValidateError } from "../types.js";
|
|
10
10
|
export const SignPrefix = uint8ArrayFromString('libp2p-pubsub:');
|
|
11
11
|
// Monotonic seqno counter seeded from the wall clock in nanoseconds, matching
|
|
12
12
|
// go-libp2p-pubsub and rust-libp2p. The pubsub spec requires a "linearly
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StrictSign, StrictNoSign } from '../index.ts';
|
|
2
|
-
import type { PublishConfig } from '../types.
|
|
2
|
+
import type { PublishConfig } from '../types.ts';
|
|
3
3
|
import type { PeerId, PrivateKey } from '@libp2p/interface';
|
|
4
4
|
/**
|
|
5
5
|
* Prepare a PublishConfig object from a PeerId.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publicKeyToProtobuf } from '@libp2p/crypto/keys';
|
|
2
2
|
import { StrictSign, StrictNoSign } from "../index.js";
|
|
3
|
-
import { PublishConfigType } from
|
|
3
|
+
import { PublishConfigType } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Prepare a PublishConfig object from a PeerId.
|
|
6
6
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/gossipsub",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"description": "A typescript implementation of gossipsub",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"release": "aegir release --no-types",
|
|
53
53
|
"build": "aegir build",
|
|
54
54
|
"generate": "protons ./src/message/rpc.proto",
|
|
55
|
-
"benchmark": "
|
|
56
|
-
"benchmark:files": "NODE_OPTIONS='--max-old-space-size=4096
|
|
55
|
+
"benchmark": "npm run benchmark:files -- 'dist/test/benchmark/**/*.test.js' -- --exit",
|
|
56
|
+
"benchmark:files": "NODE_OPTIONS='--max-old-space-size=4096' aegir test -t node --timeout 0 -f",
|
|
57
57
|
"test": "aegir test -f dist/test/*.spec.js",
|
|
58
58
|
"test:node": "aegir test -t node -f dist/test/*.spec.js -f dist/test/unit/*.spec.js -f dist/test/e2e/*.spec.js",
|
|
59
59
|
"test:chrome": "aegir test -f dist/test/*.spec.js -t browser",
|
|
@@ -79,31 +79,32 @@
|
|
|
79
79
|
},
|
|
80
80
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/gossipsub#readme",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@libp2p/crypto": "^5.1.
|
|
83
|
-
"@libp2p/interface": "^3.2.
|
|
84
|
-
"@libp2p/interface-internal": "^3.1.
|
|
85
|
-
"@libp2p/peer-id": "^6.0.
|
|
86
|
-
"@libp2p/utils": "^7.2.
|
|
87
|
-
"@multiformats/multiaddr": "^13.0.
|
|
82
|
+
"@libp2p/crypto": "^5.1.19",
|
|
83
|
+
"@libp2p/interface": "^3.2.3",
|
|
84
|
+
"@libp2p/interface-internal": "^3.1.6",
|
|
85
|
+
"@libp2p/peer-id": "^6.0.10",
|
|
86
|
+
"@libp2p/utils": "^7.2.2",
|
|
87
|
+
"@multiformats/multiaddr": "^13.0.3",
|
|
88
88
|
"denque": "^2.1.0",
|
|
89
89
|
"it-length-prefixed": "^10.0.1",
|
|
90
90
|
"it-pipe": "^3.0.1",
|
|
91
91
|
"it-pushable": "^3.2.3",
|
|
92
|
-
"multiformats": "^
|
|
92
|
+
"multiformats": "^14.0.0",
|
|
93
93
|
"protons-runtime": "^6.0.1",
|
|
94
94
|
"uint8arraylist": "^2.4.8",
|
|
95
|
-
"uint8arrays": "^
|
|
95
|
+
"uint8arrays": "^6.1.1"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
99
|
-
"@
|
|
100
|
-
"@libp2p/
|
|
101
|
-
"@libp2p/
|
|
102
|
-
"@
|
|
99
|
+
"@libp2p/floodsub": "^11.0.23",
|
|
100
|
+
"@libp2p/logger": "^6.2.8",
|
|
101
|
+
"@libp2p/peer-store": "^12.0.21",
|
|
102
|
+
"@types/benchmark": "^2.1.5",
|
|
103
103
|
"@types/node": "^22.18.1",
|
|
104
104
|
"@types/sinon": "^21.0.1",
|
|
105
105
|
"abortable-iterator": "^5.1.0",
|
|
106
|
-
"aegir": "^
|
|
106
|
+
"aegir": "^48.0.11",
|
|
107
|
+
"benchmark": "^2.1.4",
|
|
107
108
|
"datastore-core": "^11.0.1",
|
|
108
109
|
"delay": "^7.0.0",
|
|
109
110
|
"it-all": "^3.0.6",
|
package/src/score/peer-score.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { RejectReason } from '../types.
|
|
2
|
-
import { MapDef } from '../utils/set.
|
|
1
|
+
import { RejectReason } from '../types.ts'
|
|
2
|
+
import { MapDef } from '../utils/set.ts'
|
|
3
3
|
import { computeScore } from './compute-score.ts'
|
|
4
4
|
import { MessageDeliveries, DeliveryRecordStatus } from './message-deliveries.ts'
|
|
5
5
|
import { validatePeerScoreParams } from './peer-score-params.ts'
|
|
6
|
-
import type { MsgIdStr, PeerIdStr, TopicStr, IPStr } from '../types.
|
|
6
|
+
import type { MsgIdStr, PeerIdStr, TopicStr, IPStr } from '../types.ts'
|
|
7
7
|
import type { PeerScoreParams } from './peer-score-params.ts'
|
|
8
8
|
import type { PeerStats, TopicStats } from './peer-stats.ts'
|
|
9
|
-
import type { Metrics, ScorePenalty } from '../metrics.
|
|
9
|
+
import type { Metrics, ScorePenalty } from '../metrics.ts'
|
|
10
10
|
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
11
11
|
|
|
12
12
|
interface PeerScoreOpts {
|
package/src/score/peer-stats.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
|
|
|
5
5
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
6
6
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
7
7
|
import { StrictSign, StrictNoSign } from '../index.ts'
|
|
8
|
-
import { RPC } from '../message/rpc.
|
|
9
|
-
import { PublishConfigType, ValidateError } from '../types.
|
|
8
|
+
import { RPC } from '../message/rpc.ts'
|
|
9
|
+
import { PublishConfigType, ValidateError } from '../types.ts'
|
|
10
10
|
import type { Message } from '../index.ts'
|
|
11
|
-
import type { PublishConfig, TopicStr } from '../types.
|
|
11
|
+
import type { PublishConfig, TopicStr } from '../types.ts'
|
|
12
12
|
import type { PublicKey, PeerId } from '@libp2p/interface'
|
|
13
13
|
|
|
14
14
|
export const SignPrefix = uint8ArrayFromString('libp2p-pubsub:')
|
package/src/utils/msgIdFn.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { publicKeyToProtobuf } from '@libp2p/crypto/keys'
|
|
2
2
|
import { sha256 } from 'multiformats/hashes/sha2'
|
|
3
3
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
4
|
-
import type { Message } from '../index.
|
|
4
|
+
import type { Message } from '../index.ts'
|
|
5
5
|
import type { PublicKey } from '@libp2p/interface'
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { publicKeyToProtobuf } from '@libp2p/crypto/keys'
|
|
2
2
|
import { StrictSign, StrictNoSign } from '../index.ts'
|
|
3
|
-
import { PublishConfigType } from '../types.
|
|
4
|
-
import type { PublishConfig } from '../types.
|
|
3
|
+
import { PublishConfigType } from '../types.ts'
|
|
4
|
+
import type { PublishConfig } from '../types.ts'
|
|
5
5
|
import type { PeerId, PrivateKey } from '@libp2p/interface'
|
|
6
6
|
|
|
7
7
|
/**
|