@libp2p/gossipsub 17.1.3 → 17.1.4-2d4c93ed6
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/utils/buildRawMessage.d.ts.map +1 -1
- package/dist/src/utils/buildRawMessage.js +7 -25
- package/dist/src/utils/buildRawMessage.js.map +1 -1
- package/package.json +10 -10
- package/src/utils/buildRawMessage.ts +7 -26
- package/dist/typedoc-urls.json +0 -40
|
@@ -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,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,
|
|
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,CAmF3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { publicKeyFromProtobuf } from '@libp2p/crypto/keys';
|
|
1
|
+
import { publicKeyForPeer, publicKeyFromProtobuf } from '@libp2p/crypto/keys';
|
|
2
2
|
import { peerIdFromMultihash } from '@libp2p/peer-id';
|
|
3
3
|
import * as Digest from 'multiformats/hashes/digest';
|
|
4
4
|
import { concat as uint8ArrayConcat } from 'uint8arrays/concat';
|
|
@@ -108,32 +108,14 @@ export async function validateToRawMessage(signaturePolicy, msg) {
|
|
|
108
108
|
catch (e) {
|
|
109
109
|
return { valid: false, error: ValidateError.InvalidPeerId };
|
|
110
110
|
}
|
|
111
|
-
// - check from defined
|
|
112
|
-
// - transform source to PeerId
|
|
113
|
-
// - parse signature
|
|
114
|
-
// - get .key, else from source
|
|
115
|
-
// - check key == source if present
|
|
116
|
-
// - verify sig
|
|
117
111
|
let publicKey;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// sending them is still scored as delivering an invalid message
|
|
121
|
-
try {
|
|
122
|
-
publicKey = publicKeyFromProtobuf(msg.key);
|
|
123
|
-
}
|
|
124
|
-
catch {
|
|
125
|
-
return { valid: false, error: ValidateError.InvalidPeerId };
|
|
126
|
-
}
|
|
127
|
-
// the message key must derive to the `from` peer id
|
|
128
|
-
if (!fromPeerId.equals(publicKey.toMultihash().bytes)) {
|
|
129
|
-
return { valid: false, error: ValidateError.InvalidPeerId };
|
|
130
|
-
}
|
|
112
|
+
try {
|
|
113
|
+
publicKey = await publicKeyForPeer(fromPeerId, msg.key);
|
|
131
114
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
publicKey = fromPeerId.publicKey;
|
|
115
|
+
catch {
|
|
116
|
+
// mismatched, missing or malformed keys are invalid, not thrown, so the
|
|
117
|
+
// peer is still scored
|
|
118
|
+
return { valid: false, error: ValidateError.InvalidPeerId };
|
|
137
119
|
}
|
|
138
120
|
const rpcMsgPreSign = {
|
|
139
121
|
from: msg.from,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRawMessage.js","sourceRoot":"","sources":["../../../src/utils/buildR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AAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/gossipsub",
|
|
3
|
-
"version": "17.1.
|
|
3
|
+
"version": "17.1.4-2d4c93ed6",
|
|
4
4
|
"description": "A typescript implementation of gossipsub",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
},
|
|
85
85
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/gossipsub#readme",
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@libp2p/crypto": "
|
|
88
|
-
"@libp2p/interface": "
|
|
89
|
-
"@libp2p/interface-internal": "
|
|
90
|
-
"@libp2p/peer-id": "
|
|
91
|
-
"@libp2p/utils": "
|
|
87
|
+
"@libp2p/crypto": "5.1.25-2d4c93ed6",
|
|
88
|
+
"@libp2p/interface": "3.4.0-2d4c93ed6",
|
|
89
|
+
"@libp2p/interface-internal": "3.2.0-2d4c93ed6",
|
|
90
|
+
"@libp2p/peer-id": "6.0.17-2d4c93ed6",
|
|
91
|
+
"@libp2p/utils": "7.4.3-2d4c93ed6",
|
|
92
92
|
"@multiformats/multiaddr": "^13.0.3",
|
|
93
93
|
"denque": "^2.1.0",
|
|
94
94
|
"it-length-prefixed": "^11.0.1",
|
|
@@ -101,9 +101,9 @@
|
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
104
|
-
"@libp2p/floodsub": "
|
|
105
|
-
"@libp2p/logger": "
|
|
106
|
-
"@libp2p/peer-store": "
|
|
104
|
+
"@libp2p/floodsub": "11.0.32-2d4c93ed6",
|
|
105
|
+
"@libp2p/logger": "6.2.15-2d4c93ed6",
|
|
106
|
+
"@libp2p/peer-store": "12.0.30-2d4c93ed6",
|
|
107
107
|
"@types/benchmark": "^2.1.5",
|
|
108
108
|
"@types/sinon": "^22.0.0",
|
|
109
109
|
"abortable-iterator": "^5.1.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"it-all": "^3.0.9",
|
|
115
115
|
"mkdirp": "^3.0.1",
|
|
116
116
|
"p-defer": "^4.0.1",
|
|
117
|
-
"p-event": "^
|
|
117
|
+
"p-event": "^8.0.1",
|
|
118
118
|
"p-retry": "^8.0.0",
|
|
119
119
|
"p-wait-for": "^6.0.0",
|
|
120
120
|
"protons": "^9.0.1",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { publicKeyFromProtobuf } from '@libp2p/crypto/keys'
|
|
1
|
+
import { publicKeyForPeer, publicKeyFromProtobuf } from '@libp2p/crypto/keys'
|
|
2
2
|
import { peerIdFromMultihash } from '@libp2p/peer-id'
|
|
3
3
|
import * as Digest from 'multiformats/hashes/digest'
|
|
4
4
|
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
|
|
@@ -129,32 +129,13 @@ export async function validateToRawMessage (
|
|
|
129
129
|
return { valid: false, error: ValidateError.InvalidPeerId }
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
// - check from defined
|
|
133
|
-
// - transform source to PeerId
|
|
134
|
-
// - parse signature
|
|
135
|
-
// - get .key, else from source
|
|
136
|
-
// - check key == source if present
|
|
137
|
-
// - verify sig
|
|
138
|
-
|
|
139
132
|
let publicKey: PublicKey
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return { valid: false, error: ValidateError.InvalidPeerId }
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// the message key must derive to the `from` peer id
|
|
150
|
-
if (!fromPeerId.equals(publicKey.toMultihash().bytes)) {
|
|
151
|
-
return { valid: false, error: ValidateError.InvalidPeerId }
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
154
|
-
if (fromPeerId.publicKey == null) {
|
|
155
|
-
return { valid: false, error: ValidateError.InvalidPeerId }
|
|
156
|
-
}
|
|
157
|
-
publicKey = fromPeerId.publicKey
|
|
133
|
+
try {
|
|
134
|
+
publicKey = await publicKeyForPeer(fromPeerId, msg.key)
|
|
135
|
+
} catch {
|
|
136
|
+
// mismatched, missing or malformed keys are invalid, not thrown, so the
|
|
137
|
+
// peer is still scored
|
|
138
|
+
return { valid: false, error: ValidateError.InvalidPeerId }
|
|
158
139
|
}
|
|
159
140
|
|
|
160
141
|
const rpcMsgPreSign: RPC.Message = {
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.TopicValidatorResult.html",
|
|
3
|
-
".:TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.TopicValidatorResult.html",
|
|
4
|
-
"GossipSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipSub.html",
|
|
5
|
-
".:GossipSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipSub.html",
|
|
6
|
-
"GossipSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipSubComponents.html",
|
|
7
|
-
".:GossipSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipSubComponents.html",
|
|
8
|
-
"GossipSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipSubEvents.html",
|
|
9
|
-
".:GossipSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipSubEvents.html",
|
|
10
|
-
"GossipsubMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipsubMessage.html",
|
|
11
|
-
".:GossipsubMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipsubMessage.html",
|
|
12
|
-
"GossipsubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipsubOpts.html",
|
|
13
|
-
".:GossipsubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.GossipsubOpts.html",
|
|
14
|
-
"MeshPeer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.MeshPeer.html",
|
|
15
|
-
".:MeshPeer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.MeshPeer.html",
|
|
16
|
-
"PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.PublishResult.html",
|
|
17
|
-
".:PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.PublishResult.html",
|
|
18
|
-
"SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.SignedMessage.html",
|
|
19
|
-
".:SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.SignedMessage.html",
|
|
20
|
-
"Subscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.Subscription.html",
|
|
21
|
-
".:Subscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.Subscription.html",
|
|
22
|
-
"SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.SubscriptionChangeData.html",
|
|
23
|
-
".:SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.SubscriptionChangeData.html",
|
|
24
|
-
"TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.TopicValidatorFn.html",
|
|
25
|
-
".:TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.TopicValidatorFn.html",
|
|
26
|
-
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.UnsignedMessage.html",
|
|
27
|
-
".:UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.UnsignedMessage.html",
|
|
28
|
-
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.Message.html",
|
|
29
|
-
".:Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.Message.html",
|
|
30
|
-
"SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.SignaturePolicy.html",
|
|
31
|
-
".:SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.SignaturePolicy.html",
|
|
32
|
-
"multicodec": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.multicodec.html",
|
|
33
|
-
".:multicodec": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.multicodec.html",
|
|
34
|
-
"StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.StrictNoSign.html",
|
|
35
|
-
".:StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.StrictNoSign.html",
|
|
36
|
-
"StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.StrictSign.html",
|
|
37
|
-
".:StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.StrictSign.html",
|
|
38
|
-
"gossipsub": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.gossipsub.html",
|
|
39
|
-
".:gossipsub": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.gossipsub.html"
|
|
40
|
-
}
|