@streamr/trackerless-network 100.0.0-testnet-three.2 → 100.0.0-testnet-three.3

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.
Files changed (47) hide show
  1. package/dist/src/logic/Layer1Node.d.ts +2 -2
  2. package/dist/src/logic/RandomGraphNode.d.ts +4 -4
  3. package/dist/src/logic/RandomGraphNode.js +11 -11
  4. package/dist/src/logic/RandomGraphNode.js.map +1 -1
  5. package/dist/src/logic/createRandomGraphNode.js +2 -1
  6. package/dist/src/logic/createRandomGraphNode.js.map +1 -1
  7. package/dist/src/logic/inspect/InspectSession.d.ts +1 -0
  8. package/dist/src/logic/inspect/InspectSession.js +3 -0
  9. package/dist/src/logic/inspect/InspectSession.js.map +1 -1
  10. package/dist/src/logic/inspect/Inspector.js +1 -1
  11. package/dist/src/logic/inspect/Inspector.js.map +1 -1
  12. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.d.ts +2 -1
  13. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.js +1 -0
  14. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.js.map +1 -1
  15. package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.d.ts +2 -1
  16. package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js +1 -0
  17. package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js.map +1 -1
  18. package/dist/src/logic/proxy/ProxyClient.js +8 -6
  19. package/dist/src/logic/proxy/ProxyClient.js.map +1 -1
  20. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.d.ts +1 -0
  21. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js +3 -0
  22. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js.map +1 -1
  23. package/dist/test/utils/utils.d.ts +1 -2
  24. package/dist/test/utils/utils.js +2 -7
  25. package/dist/test/utils/utils.js.map +1 -1
  26. package/package.json +6 -6
  27. package/src/logic/Layer1Node.ts +2 -2
  28. package/src/logic/RandomGraphNode.ts +13 -13
  29. package/src/logic/createRandomGraphNode.ts +2 -1
  30. package/src/logic/inspect/InspectSession.ts +4 -0
  31. package/src/logic/inspect/Inspector.ts +1 -1
  32. package/src/logic/neighbor-discovery/NeighborUpdateManager.ts +3 -1
  33. package/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.ts +3 -1
  34. package/src/logic/proxy/ProxyClient.ts +14 -7
  35. package/src/logic/temporary-connection/TemporaryConnectionRpcLocal.ts +4 -0
  36. package/test/end-to-end/random-graph-with-real-connections.test.ts +4 -6
  37. package/test/integration/NetworkNode.test.ts +4 -9
  38. package/test/integration/StreamrNode.test.ts +4 -16
  39. package/test/integration/joining-streams-on-offline-peers.test.ts +7 -31
  40. package/test/integration/stream-without-default-entrypoints.test.ts +2 -6
  41. package/test/unit/InspectSession.test.ts +3 -4
  42. package/test/unit/Inspector.test.ts +3 -3
  43. package/test/unit/NeighborFinder.test.ts +3 -3
  44. package/test/unit/NeighborUpdateRpcLocal.test.ts +5 -1
  45. package/test/unit/NodeList.test.ts +4 -3
  46. package/test/unit/RandomGraphNode.test.ts +5 -5
  47. package/test/utils/utils.ts +2 -8
@@ -1,8 +1,8 @@
1
1
  import { DhtAddress, PeerDescriptor } from '@streamr/dht';
2
2
  export interface Layer1NodeEvents {
3
- newContact: (peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => void;
3
+ contactAdded: (peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => void;
4
4
  contactRemoved: (peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => void;
5
- newRandomContact: (peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => void;
5
+ randomContactAdded: (peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => void;
6
6
  randomContactRemoved: (peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => void;
7
7
  }
8
8
  export interface Layer1Node {
@@ -47,11 +47,11 @@ export declare class RandomGraphNode extends EventEmitter<Events> {
47
47
  constructor(config: StrictRandomGraphNodeConfig);
48
48
  start(): Promise<void>;
49
49
  private registerDefaultServerMethods;
50
- private newContact;
51
- private removedContact;
50
+ private onContactAdded;
51
+ private onContactRemoved;
52
52
  private updateNearbyNodeView;
53
- private newRandomContact;
54
- private removedRandomContact;
53
+ private onRandomContactAdded;
54
+ private onRandomContactRemoved;
55
55
  private onNodeDisconnected;
56
56
  private getNeighborCandidatesFromLayer1;
57
57
  hasProxyConnection(nodeId: DhtAddress): boolean;
@@ -54,10 +54,10 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
54
54
  async start() {
55
55
  this.started = true;
56
56
  this.registerDefaultServerMethods();
57
- (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'newContact', (_peerDescriptor, closestPeers) => this.newContact(closestPeers), this.abortController.signal);
58
- (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'contactRemoved', (_peerDescriptor, closestPeers) => this.removedContact(closestPeers), this.abortController.signal);
59
- (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'newRandomContact', (_peerDescriptor, randomPeers) => this.newRandomContact(randomPeers), this.abortController.signal);
60
- (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'randomContactRemoved', (_peerDescriptor, randomPeers) => this.removedRandomContact(randomPeers), this.abortController.signal);
57
+ (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'contactAdded', (_peerDescriptor, closestPeers) => this.onContactAdded(closestPeers), this.abortController.signal);
58
+ (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'contactRemoved', (_peerDescriptor, closestPeers) => this.onContactRemoved(closestPeers), this.abortController.signal);
59
+ (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'randomContactAdded', (_peerDescriptor, randomPeers) => this.onRandomContactAdded(randomPeers), this.abortController.signal);
60
+ (0, utils_1.addManagedEventListener)(this.config.layer1Node, 'randomContactRemoved', (_peerDescriptor, randomPeers) => this.onRandomContactRemoved(randomPeers), this.abortController.signal);
61
61
  (0, utils_1.addManagedEventListener)(this.config.transport, 'disconnected', (peerDescriptor) => this.onNodeDisconnected(peerDescriptor), this.abortController.signal);
62
62
  (0, utils_1.addManagedEventListener)(this.config.neighbors, 'nodeAdded', (id, _remote) => {
63
63
  this.config.propagation.onNeighborJoined(id);
@@ -68,7 +68,7 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
68
68
  }
69
69
  const candidates = this.getNeighborCandidatesFromLayer1();
70
70
  if (candidates.length > 0) {
71
- this.newContact(candidates);
71
+ this.onContactAdded(candidates);
72
72
  }
73
73
  this.config.neighborFinder.start();
74
74
  await this.config.neighborUpdateManager.start();
@@ -79,7 +79,7 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
79
79
  this.config.rpcCommunicator.registerRpcMethod(NetworkRpc_1.TemporaryConnectionRequest, NetworkRpc_1.TemporaryConnectionResponse, 'openConnection', (req, context) => this.config.temporaryConnectionRpcLocal.openConnection(req, context));
80
80
  this.config.rpcCommunicator.registerRpcNotification(NetworkRpc_1.CloseTemporaryConnection, 'closeConnection', (req, context) => this.config.temporaryConnectionRpcLocal.closeConnection(req, context));
81
81
  }
82
- newContact(closestNodes) {
82
+ onContactAdded(closestNodes) {
83
83
  logger.trace(`New nearby contact found`);
84
84
  if (this.isStopped()) {
85
85
  return;
@@ -89,7 +89,7 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
89
89
  this.config.neighborFinder.start();
90
90
  }
91
91
  }
92
- removedContact(closestNodes) {
92
+ onContactRemoved(closestNodes) {
93
93
  logger.trace(`Nearby contact removed`);
94
94
  if (this.isStopped()) {
95
95
  return;
@@ -105,7 +105,7 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
105
105
  this.config.nearbyNodeView.add(new DeliveryRpcRemote_1.DeliveryRpcRemote(this.config.localPeerDescriptor, descriptor, this.config.rpcCommunicator, NetworkRpc_client_1.DeliveryRpcClient, this.config.rpcRequestTimeout));
106
106
  }
107
107
  }
108
- newRandomContact(randomNodes) {
108
+ onRandomContactAdded(randomNodes) {
109
109
  if (this.isStopped()) {
110
110
  return;
111
111
  }
@@ -114,7 +114,7 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
114
114
  this.config.neighborFinder.start();
115
115
  }
116
116
  }
117
- removedRandomContact(randomNodes) {
117
+ onRandomContactRemoved(randomNodes) {
118
118
  logger.trace(`New nearby contact found`);
119
119
  if (this.isStopped()) {
120
120
  return;
@@ -167,7 +167,8 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
167
167
  (0, utils_2.markAndCheckDuplicate)(this.duplicateDetectors, msg.messageId, msg.previousMessageRef);
168
168
  }
169
169
  this.emit('message', msg);
170
- this.config.propagation.feedUnseenMessage(msg, this.getPropagationTargets(msg), previousNode ?? null);
170
+ const skipBackPropagation = previousNode !== undefined && !this.config.temporaryConnectionRpcLocal.hasNode(previousNode);
171
+ this.config.propagation.feedUnseenMessage(msg, this.getPropagationTargets(msg), skipBackPropagation ? previousNode : null);
171
172
  }
172
173
  inspect(peerDescriptor) {
173
174
  return this.config.inspector.inspect(peerDescriptor);
@@ -177,7 +178,6 @@ class RandomGraphNode extends eventemitter3_1.EventEmitter {
177
178
  if (this.config.proxyConnectionRpcLocal) {
178
179
  propagationTargets = propagationTargets.concat(this.config.proxyConnectionRpcLocal.getPropagationTargets(msg));
179
180
  }
180
- propagationTargets = propagationTargets.filter((target) => !this.config.inspector.isInspected(target));
181
181
  propagationTargets = propagationTargets.concat(this.config.temporaryConnectionRpcLocal.getNodes().getIds());
182
182
  return propagationTargets;
183
183
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RandomGraphNode.js","sourceRoot":"","sources":["../../../src/logic/RandomGraphNode.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,sCAOqB;AACrB,wFAQgE;AAEhE,sGAAkG;AAClG,2DAAuD;AAGvD,0CAAgE;AAKhE,yDAAqD;AAIrD,mCAA+C;AAG/C,mCAA+B;AAgC/B,MAAM,MAA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ighborUpdateInterval,
76
- neighborTargetCount
76
+ neighborTargetCount,
77
+ connectionLocker: config.connectionLocker
77
78
  });
78
79
  const inspector = config.inspector ?? new Inspector_1.Inspector({
79
80
  localPeerDescriptor: config.localPeerDescriptor,
@@ -1 +1 @@
1
- {"version":3,"file":"createRandomGraphNode.js","sourceRoot":"","sources":["../../../src/logic/createRandomGraphNode.ts"],"names":[],"mappings":";;;AAAA,sCAAgG;AAChG,gEAA4D;AAC5D,wEAAoE;AACpE,sFAAkF;AAClF,uDAAgF;AAChF,yCAAqC;AACrC,2DAAuD;AAGvD,6EAAyE;AACzE,mDAA+C;AAC/C,oGAAgG;AAChG,uFAAmF;AAanF,MAAM,wBAAwB,GAAG,CAAC,MAA6B,EAA+B,EAAE;IAC5F,MAAM,SAAS,GAAG,IAAA,iCAA2B,EAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;IACzE,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,IAAI,8BAAwB,CAC1E,IAAA,iEAA+B,EAAC,MAAM,CAAC,YAAY,CAAC,EACpD,MAAM,CAAC,SAAS,CACnB,CAAA;IACD,MAAM,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,IAAI,CAAC,CAAA;IAC3D,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAA;IACpD,MAAM,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,IAAI,CAAC,CAAA;IAC/D,MAAM,sBAAsB,GAAG,MAAM,CAAC,sBAAsB,IAAI,KAAK,CAAA;IACrE,MAAM,sBAAsB,GAAG,MAAM,CAAC,sBAAsB,IAAI,KAAK,CAAA;IACrE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,mBAAQ,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;IACxF,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,mBAAQ,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;IACxF,MAAM,SAAS,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AAG,MAAM,CAAC,cAAc,IAAI,IAAI,+BAAc,CAAC;QAC/D,SAAS;QACT,cAAc;QACd,eAAe,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,UAAU,CAAC,2BAA2B,CAAC,WAAW,CAAC;QACrF,QAAQ,EAAE,mBAAmB;KAChC,CAAC,CAAA;IACF,MAAM,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,IAAI,IAAI,6CAAqB,CAAC;QACpF,SAAS;QACT,cAAc;QACd,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,cAAc;QACd,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,eAAe;QACf,sBAAsB;QACtB,mBAAmB;QACnB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;KAC5C,CAAC,CAAA;IACF,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,IAAI,qBAAS,CAAC;QAChD,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,eAAe;QACf,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;KAC5C,CAAC,CAAA;IACF,OAAO;QACH,GAAG,MAAM;QACT,cAAc;QACd,cAAc;QACd,SAAS;QACT,eAAe;QACf,UAAU;QACV,cAAc;QACd,qBAAqB;QACrB,WAAW;QACX,mBAAmB;QACnB,YAAY,EAAE,eAAe;QAC7B,uBAAuB;QACvB,SAAS;QACT,2BAA2B;KAC9B,CAAA;AACL,CAAC,CAAA;AAEM,MAAM,qBAAqB,GAAG,CAAC,MAA6B,EAAmB,EAAE;IACpF,OAAO,IAAI,iCAAe,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAA;AAChE,CAAC,CAAA;AAFY,QAAA,qBAAqB,yBAEjC"}
@@ -13,6 +13,7 @@ export declare class InspectSession extends EventEmitter<Events> {
13
13
  constructor(config: InspectSessionConfig);
14
14
  markMessage(senderId: DhtAddress, messageId: MessageID): void;
15
15
  getInspectedMessageCount(): number;
16
+ onlyMarkedByInspectedNode(): boolean;
16
17
  stop(): void;
17
18
  }
18
19
  export {};
@@ -32,6 +32,9 @@ class InspectSession extends eventemitter3_1.EventEmitter {
32
32
  getInspectedMessageCount() {
33
33
  return this.inspectionMessages.size;
34
34
  }
35
+ onlyMarkedByInspectedNode() {
36
+ return Array.from(this.inspectionMessages.values()).every((value) => value === true);
37
+ }
35
38
  stop() {
36
39
  this.emit('done');
37
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InspectSession.js","sourceRoot":"","sources":["../../../../src/logic/inspect/InspectSession.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,0CAA4C;AAW5C,MAAM,gBAAgB,GAAG,CAAC,SAAoB,EAAU,EAAE;IACtD,OAAO,GAAG,IAAA,mBAAW,EAAC,SAAS,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC,cAAc,IAAI,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,cAAc,EAAE,CAAA;AACjI,CAAC,CAAA;AACD,MAAa,cAAe,SAAQ,4BAAoB;IAEpD,2EAA2E;IAC1D,kBAAkB,GAAyB,IAAI,GAAG,EAAE,CAAA;IACpD,aAAa,CAAY;IAE1C,YAAY,MAA4B;QACpC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;IAC7C,CAAC;IAED,WAAW,CAAC,QAAoB,EAAE,SAAoB;QAClD,MAAM,UAAU,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAC9C,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,aAAa,CAAC,CAAA;QAC5E,CAAC;aAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC;eAC3C,IAAI,CAAC,kBAAkB,CAA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,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,aAAa,CAAC,CAAA;QAC5E,CAAC;aAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC;eAC3C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,KAAK;eACjD,QAAQ,KAAK,IAAI,CAAC,aAAa,EACpC,CAAC;YACC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrB,CAAC;aAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC;eAC3C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC;YACtD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrB,CAAC;IACL,CAAC;IAED,wBAAwB;QACpB,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAA;IACvC,CAAC;IAED,yBAAyB;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAA;IACxF,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC;CACJ;AArCD,wCAqCC"}
@@ -56,7 +56,7 @@ class Inspector {
56
56
  await this.closeInspectConnection(peerDescriptor, lockId);
57
57
  this.sessions.delete(nodeId);
58
58
  }
59
- return success || session.getInspectedMessageCount() < 1;
59
+ return success || session.getInspectedMessageCount() < 1 || session.onlyMarkedByInspectedNode();
60
60
  }
61
61
  markMessage(sender, messageId) {
62
62
  this.sessions.forEach((session) => session.markMessage(sender, messageId));
@@ -1 +1 @@
1
- {"version":3,"file":"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  import { NeighborFinder } from './NeighborFinder';
3
3
  import { NodeList } from '../NodeList';
4
4
  import { StreamPartID } from '@streamr/protocol';
@@ -7,6 +7,7 @@ interface NeighborUpdateManagerConfig {
7
7
  neighbors: NodeList;
8
8
  nearbyNodeView: NodeList;
9
9
  neighborFinder: NeighborFinder;
10
+ connectionLocker: ConnectionLocker;
10
11
  streamPartId: StreamPartID;
11
12
  rpcCommunicator: ListeningRpcCommunicator;
12
13
  neighborUpdateInterval: number;
@@ -32,6 +32,7 @@ class NeighborUpdateManager {
32
32
  if (res.removeMe) {
33
33
  const nodeId = (0, dht_1.getNodeIdFromPeerDescriptor)(neighbor.getPeerDescriptor());
34
34
  this.config.neighbors.remove(nodeId);
35
+ this.config.connectionLocker.unlockConnection(neighbor.getPeerDescriptor(), this.config.streamPartId);
35
36
  this.config.neighborFinder.start([nodeId]);
36
37
  }
37
38
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"NeighborUpdateManager.js","sourceRoot":"","sources":["../../../../src/logic/neighbor-discovery/NeighborUpdateManager.ts"],"names":[],"mappings":";;;AAAA,2FAA2F;AAC3F,sCAAoG;AACpG,yGAA2G;AAC3G,0CAA2D;AAG3D,uEAAmE;AACnE,qEAAiE;AAcjE,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,MAAa,qBAAqB;IAEb,eAAe,CAAiB;IAChC,MAAM,CAA6B;IACnC,QAAQ,CAAwB;IAEjD,YAAY,MAAmC;QAC3C,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA;QAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,+CAAsB,CAAC,MAAM,CAAC,CAAA;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,2BAAc,EAAE,2BAAc,EAAE,gBAAgB,EAC1F,CAAC,GAAmB,EAAE,OAAO,EAAE,EAAE,CAAC,IA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DA4CC"}
@@ -1,5 +1,5 @@
1
1
  import { ServerCallContext } from '@protobuf-ts/runtime-rpc';
2
- import { ListeningRpcCommunicator, PeerDescriptor } from '@streamr/dht';
2
+ import { ConnectionLocker, ListeningRpcCommunicator, PeerDescriptor } from '@streamr/dht';
3
3
  import { NeighborUpdate } from '../../proto/packages/trackerless-network/protos/NetworkRpc';
4
4
  import { INeighborUpdateRpc } from '../../proto/packages/trackerless-network/protos/NetworkRpc.server';
5
5
  import { NodeList } from '../NodeList';
@@ -11,6 +11,7 @@ interface NeighborUpdateRpcLocalConfig {
11
11
  neighbors: NodeList;
12
12
  nearbyNodeView: NodeList;
13
13
  neighborFinder: NeighborFinder;
14
+ connectionLocker: ConnectionLocker;
14
15
  rpcCommunicator: ListeningRpcCommunicator;
15
16
  neighborTargetCount: number;
16
17
  }
@@ -43,6 +43,7 @@ class NeighborUpdateRpcLocal {
43
43
  }
44
44
  else {
45
45
  this.config.neighbors.remove(senderId);
46
+ this.config.connectionLocker.unlockConnection(senderPeerDescriptor, this.config.streamPartId);
46
47
  }
47
48
  return this.createResponse(isOverNeighborCount);
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NeighborUpdateRpcLocal.js","sourceRoot":"","sources":["../../../../src/logic/neighbor-discovery/NeighborUpdateRpcLocal.ts"],"names":[],"mappings":";;;AACA,sCAAoH;AAEpH,yGAAqG;AAGrG,4DAAwD;AAcxD,MAAa,sBAAsB;IAEd,MAAM,CAA8B;IAErD,YAAY,MAAoC;QAC5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAEO,cAAc,CAAC,mBAAqC;QACxD,MAAM,SAAS,GAAG,IAAA,iCAA2B,EAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;QAC9E,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,cAAc,EAAE,EAAE;YACrE,MAAM,MAAM,GAAG,IAAA,iCAA2B,EAAC,cAAc,CAA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S,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;gBACtC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;YACjG,CAAC;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAA;QACnD,CAAC;IACL,CAAC;CACJ;AAtDD,wDAsDC"}
@@ -115,7 +115,7 @@ class ProxyClient extends eventemitter3_1.EventEmitter {
115
115
  getInvalidConnections() {
116
116
  return Array.from(this.connections.keys()).filter((id) => {
117
117
  return !this.definition.nodes.has(id)
118
- || this.definition.direction !== this.connections.get(id);
118
+ || this.definition.direction !== this.connections.get(id).direction;
119
119
  });
120
120
  }
121
121
  async openRandomConnections(connectionCount) {
@@ -128,7 +128,7 @@ class ProxyClient extends eventemitter3_1.EventEmitter {
128
128
  const accepted = await rpcRemote.requestConnection(direction, userId);
129
129
  if (accepted) {
130
130
  this.config.connectionLocker.lockConnection(peerDescriptor, SERVICE_ID);
131
- this.connections.set(nodeId, direction);
131
+ this.connections.set(nodeId, { peerDescriptor, direction });
132
132
  const remote = new DeliveryRpcRemote_1.DeliveryRpcRemote(this.config.localPeerDescriptor, peerDescriptor, this.rpcCommunicator, NetworkRpc_client_1.DeliveryRpcClient);
133
133
  this.neighbors.add(remote);
134
134
  this.propagation.onNeighborJoined(nodeId);
@@ -155,12 +155,14 @@ class ProxyClient extends eventemitter3_1.EventEmitter {
155
155
  });
156
156
  const server = this.neighbors.get(nodeId);
157
157
  server?.leaveStreamPartNotice(this.config.streamPartId, false);
158
- this.removeConnection(nodeId);
158
+ this.removeConnection(this.connections.get(nodeId).peerDescriptor);
159
159
  }
160
160
  }
161
- removeConnection(nodeId) {
161
+ removeConnection(peerDescriptor) {
162
+ const nodeId = (0, dht_1.getNodeIdFromPeerDescriptor)(peerDescriptor);
162
163
  this.connections.delete(nodeId);
163
164
  this.neighbors.remove(nodeId);
165
+ this.config.connectionLocker.unlockConnection(peerDescriptor, SERVICE_ID);
164
166
  }
165
167
  broadcast(msg, previousNode) {
166
168
  if (!previousNode) {
@@ -170,7 +172,7 @@ class ProxyClient extends eventemitter3_1.EventEmitter {
170
172
  this.propagation.feedUnseenMessage(msg, this.neighbors.getIds(), previousNode ?? null);
171
173
  }
172
174
  hasConnection(nodeId, direction) {
173
- return this.connections.has(nodeId) && this.connections.get(nodeId) === direction;
175
+ return this.connections.has(nodeId) && this.connections.get(nodeId).direction === direction;
174
176
  }
175
177
  getDirection() {
176
178
  return this.definition.direction;
@@ -179,7 +181,7 @@ class ProxyClient extends eventemitter3_1.EventEmitter {
179
181
  const nodeId = (0, dht_1.getNodeIdFromPeerDescriptor)(peerDescriptor);
180
182
  if (this.connections.has(nodeId)) {
181
183
  this.config.connectionLocker.unlockConnection(peerDescriptor, SERVICE_ID);
182
- this.removeConnection(nodeId);
184
+ this.removeConnection(peerDescriptor);
183
185
  await (0, exports.retry)(() => this.updateConnections(), 'updating proxy connections', this.abortController.signal);
184
186
  }
185
187
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ProxyClient.js","sourceRoot":"","sources":["../../../../src/logic/proxy/ProxyClient.ts"],"names":[],"mappings":";;;AAAA,sCAOqB;AAErB,0CAAuF;AACvF,iDAA4C;AAC5C,mCAAmC;AACnC,2FAMmE;AACnE,yGAA+H;AAE/H,0CAAsC;AACtC,4DAAwD;AACxD,0DAAsD;AACtD,4DAAwD;AACxD,oCAAgD;AAChD,yEAAqE;AACrE,wFAAoF;AAEpF,4CAA4C;AACrC,MAAM,KAAK,GAAG,KAAK,EAAK,IAAsB,EAAE,WAAmB,EAAE,WAAwB,EAAE,KAAK,GAAG,KAAK,EAAc,EAAE;IAC/H,iDAAiD;IACjD,OAAO,IAAI,EAAE,CAAC;QACV,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAA;YAC3B,OAAO,MAAM,CAAA;QACjB,CAAC;QAAC,OAAO,C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,EAAE,KAAK,CAAC,CAAA;QACjE,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;QACrB,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAA;QAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAA;IAChC,CAAC;CAEJ;AAhND,kCAgNC"}
@@ -14,6 +14,7 @@ export declare class TemporaryConnectionRpcLocal implements ITemporaryConnection
14
14
  private readonly temporaryNodes;
15
15
  constructor(config: TemporaryConnectionRpcLocalConfig);
16
16
  getNodes(): NodeList;
17
+ hasNode(node: DhtAddress): boolean;
17
18
  removeNode(nodeId: DhtAddress): void;
18
19
  openConnection(_request: TemporaryConnectionRequest, context: ServerCallContext): Promise<TemporaryConnectionResponse>;
19
20
  closeConnection(_request: CloseTemporaryConnection, context: ServerCallContext): Promise<Empty>;
@@ -16,6 +16,9 @@ class TemporaryConnectionRpcLocal {
16
16
  getNodes() {
17
17
  return this.temporaryNodes;
18
18
  }
19
+ hasNode(node) {
20
+ return this.temporaryNodes.has(node);
21
+ }
19
22
  removeNode(nodeId) {
20
23
  this.temporaryNodes.remove(nodeId);
21
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TemporaryConnectionRpcLocal.js","sourceRoot":"","sources":["../../../../src/logic/temporary-connection/TemporaryConnectionRpcLocal.ts"],"names":[],"mappings":";;;AAOA,sCAAgH;AAChH,yGAAqG;AACrG,0CAAsC;AACtC,4DAAwD;AASxD,MAAa,2BAA2B;IAEnB,MAAM,CAAmC;IACzC,cAAc,CAAU;IAEzC,YAAY,MAAyC;QACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,4CAA4C;QAC5C,IAAI,CAAC,cAAc,GAAG,IAAI,mBAAQ,CAAC,IAAA,iCAA2B,EAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC,CAAA;IACnG,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,cAAc,CAAA;IAC9B,CAAC;IAED,UAAU,CAAC,MAAkB;QACzB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,QAAoC,EACpC,OAA0B;QAE1B,MAAM,MAAM,GAAI,OAA0B,CAAC,wBAAyB,CAAA;QACpE,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAChC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAC/B,MAAM,EACN,IAAI,CAAC,MAAM,CAAC,eAAe,EAC3B,qCAAiB,CACpB,CAAA;QACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC/B,OAAO;YACH,QAAQ,EAAE,IAAI;SACjB,CAAA;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,QAAkC,EAAE,OAA0B;QAChF,MAAM,QAAQ,GAAG,IAAA,iCAA2B,EAAE,OAA0B,CAAC,wBAAyB,CAAC,CAAA;QACnG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QACzB,OAAO,EAAE,CAAA;IACb,CAAC;CACJ;AAzCD,kEAyCC"}
1
+ {"version":3,"file":"TemporaryConnectionRpcLocal.js","sourceRoot":"","sources":["../../../../src/logic/temporary-connection/TemporaryConnectionRpcLocal.ts"],"names":[],"mappings":";;;AAOA,sCAAgH;AAChH,yGAAqG;AACrG,0CAAsC;AACtC,4DAAwD;AASxD,MAAa,2BAA2B;IAEnB,MAAM,CAAmC;IACzC,cAAc,CAAU;IAEzC,YAAY,MAAyC;QACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,4CAA4C;QAC5C,IAAI,CAAC,cAAc,GAAG,IAAI,mBAAQ,CAAC,IAAA,iCAA2B,EAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC,CAAA;IACnG,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,cAAc,CAAA;IAC9B,CAAC;IAED,OAAO,CAAC,IAAgB;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;IAED,UAAU,CAAC,MAAkB;QACzB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,QAAoC,EACpC,OAA0B;QAE1B,MAAM,MAAM,GAAI,OAA0B,CAAC,wBAAyB,CAAA;QACpE,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAChC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAC/B,MAAM,EACN,IAAI,CAAC,MAAM,CAAC,eAAe,EAC3B,qCAAiB,CACpB,CAAA;QACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC/B,OAAO;YACH,QAAQ,EAAE,IAAI;SACjB,CAAA;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,QAAkC,EAAE,OAA0B;QAChF,MAAM,QAAQ,GAAG,IAAA,iCAA2B,EAAE,OAA0B,CAAC,wBAAyB,CAAC,CAAA;QACnG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QACzB,OAAO,EAAE,CAAA;IACb,CAAC;CACJ;AA7CD,kEA6CC"}
@@ -1,4 +1,4 @@
1
- import { ConnectionLocker, DhtAddress, PeerDescriptor, Simulator } from '@streamr/dht';
1
+ import { ConnectionLocker, PeerDescriptor, Simulator } from '@streamr/dht';
2
2
  import { RandomGraphNode } from '../../src/logic/RandomGraphNode';
3
3
  import { StreamMessage } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc';
4
4
  import { DeliveryRpcRemote } from '../../src/logic/DeliveryRpcRemote';
@@ -10,7 +10,6 @@ import { Layer1Node } from '../../src/logic/Layer1Node';
10
10
  export declare const mockConnectionLocker: ConnectionLocker;
11
11
  export declare const createMockRandomGraphNodeAndDhtNode: (localPeerDescriptor: PeerDescriptor, entryPointDescriptor: PeerDescriptor, streamPartId: StreamPartID, simulator: Simulator) => Promise<[Layer1Node, RandomGraphNode]>;
12
12
  export declare const createStreamMessage: (content: string, streamPartId: StreamPartID, publisherId: EthereumAddress, timestamp?: number, sequenceNumber?: number) => StreamMessage;
13
- export declare const createRandomNodeId: () => DhtAddress;
14
13
  export declare const createMockPeerDescriptor: (opts?: Omit<Partial<PeerDescriptor>, 'nodeId' | 'type'>) => PeerDescriptor;
15
14
  export declare const createMockDeliveryRpcRemote: (remotePeerDescriptor?: PeerDescriptor) => DeliveryRpcRemote;
16
15
  export declare const createMockHandshakeRpcRemote: () => HandshakeRpcRemote;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNetworkNodeWithSimulator = exports.createMockHandshakeRpcRemote = exports.createMockDeliveryRpcRemote = exports.createMockPeerDescriptor = exports.createRandomNodeId = exports.createStreamMessage = exports.createMockRandomGraphNodeAndDhtNode = exports.mockConnectionLocker = void 0;
4
- const crypto_1 = require("crypto");
3
+ exports.createNetworkNodeWithSimulator = exports.createMockHandshakeRpcRemote = exports.createMockDeliveryRpcRemote = exports.createMockPeerDescriptor = exports.createStreamMessage = exports.createMockRandomGraphNodeAndDhtNode = exports.mockConnectionLocker = void 0;
5
4
  const dht_1 = require("@streamr/dht");
6
5
  const NetworkRpc_1 = require("../../src/proto/packages/trackerless-network/protos/NetworkRpc");
7
6
  const DeliveryRpcRemote_1 = require("../../src/logic/DeliveryRpcRemote");
@@ -61,14 +60,10 @@ const createStreamMessage = (content, streamPartId, publisherId, timestamp, sequ
61
60
  return msg;
62
61
  };
63
62
  exports.createStreamMessage = createStreamMessage;
64
- const createRandomNodeId = () => {
65
- return (0, dht_1.getDhtAddressFromRaw)((0, crypto_1.randomBytes)(10));
66
- };
67
- exports.createRandomNodeId = createRandomNodeId;
68
63
  const createMockPeerDescriptor = (opts) => {
69
64
  return {
70
65
  ...opts,
71
- nodeId: (0, dht_1.getRawFromDhtAddress)((0, exports.createRandomNodeId)()),
66
+ nodeId: (0, dht_1.getRawFromDhtAddress)((0, dht_1.createRandomDhtAddress)()),
72
67
  type: dht_1.NodeType.NODEJS,
73
68
  region: (0, dht_1.getRandomRegion)()
74
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/utils/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,sCAWqB;AAErB,+FAOuE;AACvE,yEAAqE;AACrE,iFAA6E;AAC7E,8FAA0F;AAC1F,uDAAsE;AACtE,0CAA2E;AAC3E,gDAAmE;AAEnE,6GAA6H;AAC7H,kDAAoD;AAEvC,QAAA,oBAAoB,GAAqB;IAClD,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1B,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC5B,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;CACjC,CAAA;AAEM,MAAM,mCAAmC,GAAG,KAAK,EACpD,mBAAmC,EACnC,oBAAoC,EACpC,YAA0B,EAC1B,SAAoB,EACoB,EAAE;IAC1C,MAAM,MAAM,GAAG,IAAI,wBAAkB,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;IACrE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACpB,MAAM,UAAU,GAAG,IAAI,aAAO,CAAC;QAC3B,SAAS,EAAE,MAAM;QACjB,cAAc,EAAE,mBAAmB;QACnC,uBAAuB,EAAE,CAAC;QAC1B,WAAW,EAAE,CAAC,oBAAoB,CAAC;QACnC,iBAAiB,EAAE,IAAI;KAC1B,CAAC,CAAA;IACF,MAAM,eAAe,GAAG,IAAA,6CAAqB,EAAC;QAC1C,YAAY;QACZ,SAAS,EAAE,MAAM;QACjB,UAAU;QACV,gBAAgB,EAAE,MAAM;QACxB,mBAAmB;Q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B,GAAE,EAC1B,IAAI,2BAAe,EAAE,EACrB,sCAAkB,CACrB,CAAA;AACL,CAAC,CAAA;AAPY,QAAA,4BAA4B,gCAOxC;AAEM,MAAM,8BAA8B,GAAG,KAAK,EAC/C,cAA8B,EAC9B,SAAoB,EACpB,WAA6B,EACT,EAAE;IACtB,MAAM,SAAS,GAAG,IAAI,wBAAkB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;IACnE,MAAM,SAAS,CAAC,KAAK,EAAE,CAAA;IACvB,OAAO,IAAA,+BAAiB,EAAC;QACrB,MAAM,EAAE;YACJ,cAAc;YACd,WAAW;YACX,SAAS;YACT,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,MAAM;YACvB,WAAW,EAAE,MAAM;SACtB;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAjBY,QAAA,8BAA8B,kCAiB1C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamr/trackerless-network",
3
- "version": "100.0.0-testnet-three.2",
3
+ "version": "100.0.0-testnet-three.3",
4
4
  "description": "Minimal and extendable implementation of the Streamr Network node.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,11 +30,11 @@
30
30
  "dependencies": {
31
31
  "@protobuf-ts/runtime": "^2.8.2",
32
32
  "@protobuf-ts/runtime-rpc": "^2.8.2",
33
- "@streamr/dht": "100.0.0-testnet-three.2",
34
- "@streamr/proto-rpc": "100.0.0-testnet-three.2",
35
- "@streamr/protocol": "100.0.0-testnet-three.2",
36
- "@streamr/test-utils": "100.0.0-testnet-three.2",
37
- "@streamr/utils": "100.0.0-testnet-three.2",
33
+ "@streamr/dht": "100.0.0-testnet-three.3",
34
+ "@streamr/proto-rpc": "100.0.0-testnet-three.3",
35
+ "@streamr/protocol": "100.0.0-testnet-three.3",
36
+ "@streamr/test-utils": "100.0.0-testnet-three.3",
37
+ "@streamr/utils": "100.0.0-testnet-three.3",
38
38
  "eventemitter3": "^5.0.0",
39
39
  "lodash": "^4.17.21",
40
40
  "uuid": "^9.0.1",
@@ -1,9 +1,9 @@
1
1
  import { DhtAddress, PeerDescriptor } from '@streamr/dht'
2
2
 
3
3
  export interface Layer1NodeEvents {
4
- newContact: (peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => void
4
+ contactAdded: (peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => void
5
5
  contactRemoved: (peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => void
6
- newRandomContact: (peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => void
6
+ randomContactAdded: (peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => void
7
7
  randomContactRemoved: (peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => void
8
8
  }
9
9
 
@@ -115,26 +115,26 @@ export class RandomGraphNode extends EventEmitter<Events> {
115
115
  this.registerDefaultServerMethods()
116
116
  addManagedEventListener<any, any>(
117
117
  this.config.layer1Node as any,
118
- 'newContact',
119
- (_peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => this.newContact(closestPeers),
118
+ 'contactAdded',
119
+ (_peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => this.onContactAdded(closestPeers),
120
120
  this.abortController.signal
121
121
  )
122
122
  addManagedEventListener<any, any>(
123
123
  this.config.layer1Node as any,
124
124
  'contactRemoved',
125
- (_peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => this.removedContact(closestPeers),
125
+ (_peerDescriptor: PeerDescriptor, closestPeers: PeerDescriptor[]) => this.onContactRemoved(closestPeers),
126
126
  this.abortController.signal
127
127
  )
128
128
  addManagedEventListener<any, any>(
129
129
  this.config.layer1Node as any,
130
- 'newRandomContact',
131
- (_peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => this.newRandomContact(randomPeers),
130
+ 'randomContactAdded',
131
+ (_peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => this.onRandomContactAdded(randomPeers),
132
132
  this.abortController.signal
133
133
  )
134
134
  addManagedEventListener<any, any>(
135
135
  this.config.layer1Node as any,
136
136
  'randomContactRemoved',
137
- (_peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => this.removedRandomContact(randomPeers),
137
+ (_peerDescriptor: PeerDescriptor, randomPeers: PeerDescriptor[]) => this.onRandomContactRemoved(randomPeers),
138
138
  this.abortController.signal
139
139
  )
140
140
  addManagedEventListener<any, any>(
@@ -162,7 +162,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
162
162
  }
163
163
  const candidates = this.getNeighborCandidatesFromLayer1()
164
164
  if (candidates.length > 0) {
165
- this.newContact(candidates)
165
+ this.onContactAdded(candidates)
166
166
  }
167
167
  this.config.neighborFinder.start()
168
168
  await this.config.neighborUpdateManager.start()
@@ -179,7 +179,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
179
179
  (req: TemporaryConnectionRequest, context) => this.config.temporaryConnectionRpcLocal.closeConnection(req, context))
180
180
  }
181
181
 
182
- private newContact(closestNodes: PeerDescriptor[]): void {
182
+ private onContactAdded(closestNodes: PeerDescriptor[]): void {
183
183
  logger.trace(`New nearby contact found`)
184
184
  if (this.isStopped()) {
185
185
  return
@@ -190,7 +190,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
190
190
  }
191
191
  }
192
192
 
193
- private removedContact(closestNodes: PeerDescriptor[]): void {
193
+ private onContactRemoved(closestNodes: PeerDescriptor[]): void {
194
194
  logger.trace(`Nearby contact removed`)
195
195
  if (this.isStopped()) {
196
196
  return
@@ -225,7 +225,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
225
225
  }
226
226
  }
227
227
 
228
- private newRandomContact(randomNodes: PeerDescriptor[]): void {
228
+ private onRandomContactAdded(randomNodes: PeerDescriptor[]): void {
229
229
  if (this.isStopped()) {
230
230
  return
231
231
  }
@@ -243,7 +243,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
243
243
  }
244
244
  }
245
245
 
246
- private removedRandomContact(randomNodes: PeerDescriptor[]): void {
246
+ private onRandomContactRemoved(randomNodes: PeerDescriptor[]): void {
247
247
  logger.trace(`New nearby contact found`)
248
248
  if (this.isStopped()) {
249
249
  return
@@ -311,7 +311,8 @@ export class RandomGraphNode extends EventEmitter<Events> {
311
311
  markAndCheckDuplicate(this.duplicateDetectors, msg.messageId!, msg.previousMessageRef)
312
312
  }
313
313
  this.emit('message', msg)
314
- this.config.propagation.feedUnseenMessage(msg, this.getPropagationTargets(msg), previousNode ?? null)
314
+ const skipBackPropagation = previousNode !== undefined && !this.config.temporaryConnectionRpcLocal.hasNode(previousNode)
315
+ this.config.propagation.feedUnseenMessage(msg, this.getPropagationTargets(msg), skipBackPropagation ? previousNode : null)
315
316
  }
316
317
 
317
318
  inspect(peerDescriptor: PeerDescriptor): Promise<boolean> {
@@ -323,7 +324,6 @@ export class RandomGraphNode extends EventEmitter<Events> {
323
324
  if (this.config.proxyConnectionRpcLocal) {
324
325
  propagationTargets = propagationTargets.concat(this.config.proxyConnectionRpcLocal.getPropagationTargets(msg))
325
326
  }
326
- propagationTargets = propagationTargets.filter((target) => !this.config.inspector.isInspected(target ))
327
327
  propagationTargets = propagationTargets.concat(this.config.temporaryConnectionRpcLocal.getNodes().getIds())
328
328
  return propagationTargets
329
329
  }
@@ -86,7 +86,8 @@ const createConfigWithDefaults = (config: RandomGraphNodeConfig): StrictRandomGr
86
86
  streamPartId: config.streamPartId,
87
87
  rpcCommunicator,
88
88
  neighborUpdateInterval,
89
- neighborTargetCount
89
+ neighborTargetCount,
90
+ connectionLocker: config.connectionLocker
90
91
  })
91
92
  const inspector = config.inspector ?? new Inspector({
92
93
  localPeerDescriptor: config.localPeerDescriptor,
@@ -44,6 +44,10 @@ export class InspectSession extends EventEmitter<Events> {
44
44
  return this.inspectionMessages.size
45
45
  }
46
46
 
47
+ onlyMarkedByInspectedNode(): boolean {
48
+ return Array.from(this.inspectionMessages.values()).every((value) => value === true)
49
+ }
50
+
47
51
  stop(): void {
48
52
  this.emit('done')
49
53
  }
@@ -80,7 +80,7 @@ export class Inspector {
80
80
  await this.closeInspectConnection(peerDescriptor, lockId)
81
81
  this.sessions.delete(nodeId)
82
82
  }
83
- return success || session.getInspectedMessageCount() < 1
83
+ return success || session.getInspectedMessageCount() < 1 || session.onlyMarkedByInspectedNode()
84
84
  }
85
85
 
86
86
  markMessage(sender: DhtAddress, messageId: MessageID): void {
@@ -1,5 +1,5 @@
1
1
  import { NeighborUpdate } from '../../proto/packages/trackerless-network/protos/NetworkRpc'
2
- import { ListeningRpcCommunicator, PeerDescriptor, getNodeIdFromPeerDescriptor } from '@streamr/dht'
2
+ import { ConnectionLocker, ListeningRpcCommunicator, PeerDescriptor, getNodeIdFromPeerDescriptor } from '@streamr/dht'
3
3
  import { NeighborUpdateRpcClient } from '../../proto/packages/trackerless-network/protos/NetworkRpc.client'
4
4
  import { Logger, scheduleAtInterval } from '@streamr/utils'
5
5
  import { NeighborFinder } from './NeighborFinder'
@@ -13,6 +13,7 @@ interface NeighborUpdateManagerConfig {
13
13
  neighbors: NodeList
14
14
  nearbyNodeView: NodeList
15
15
  neighborFinder: NeighborFinder
16
+ connectionLocker: ConnectionLocker
16
17
  streamPartId: StreamPartID
17
18
  rpcCommunicator: ListeningRpcCommunicator
18
19
  neighborUpdateInterval: number
@@ -51,6 +52,7 @@ export class NeighborUpdateManager {
51
52
  if (res.removeMe) {
52
53
  const nodeId = getNodeIdFromPeerDescriptor(neighbor.getPeerDescriptor())
53
54
  this.config.neighbors.remove(nodeId)
55
+ this.config.connectionLocker.unlockConnection(neighbor.getPeerDescriptor(), this.config.streamPartId)
54
56
  this.config.neighborFinder.start([nodeId])
55
57
  }
56
58
  }))
@@ -1,5 +1,5 @@
1
1
  import { ServerCallContext } from '@protobuf-ts/runtime-rpc'
2
- import { DhtCallContext, ListeningRpcCommunicator, PeerDescriptor, getNodeIdFromPeerDescriptor } from '@streamr/dht'
2
+ import { ConnectionLocker, DhtCallContext, ListeningRpcCommunicator, PeerDescriptor, getNodeIdFromPeerDescriptor } from '@streamr/dht'
3
3
  import { NeighborUpdate } from '../../proto/packages/trackerless-network/protos/NetworkRpc'
4
4
  import { DeliveryRpcClient } from '../../proto/packages/trackerless-network/protos/NetworkRpc.client'
5
5
  import { INeighborUpdateRpc } from '../../proto/packages/trackerless-network/protos/NetworkRpc.server'
@@ -14,6 +14,7 @@ interface NeighborUpdateRpcLocalConfig {
14
14
  neighbors: NodeList
15
15
  nearbyNodeView: NodeList
16
16
  neighborFinder: NeighborFinder
17
+ connectionLocker: ConnectionLocker
17
18
  rpcCommunicator: ListeningRpcCommunicator
18
19
  neighborTargetCount: number
19
20
  }
@@ -67,6 +68,7 @@ export class NeighborUpdateRpcLocal implements INeighborUpdateRpc {
67
68
  this.config.neighborFinder.start()
68
69
  } else {
69
70
  this.config.neighbors.remove(senderId)
71
+ this.config.connectionLocker.unlockConnection(senderPeerDescriptor, this.config.streamPartId)
70
72
  }
71
73
  return this.createResponse(isOverNeighborCount)
72
74
  }
@@ -58,6 +58,11 @@ interface ProxyDefinition {
58
58
  userId: EthereumAddress
59
59
  }
60
60
 
61
+ interface ProxyConnection {
62
+ peerDescriptor: PeerDescriptor
63
+ direction: ProxyDirection
64
+ }
65
+
61
66
  interface Events {
62
67
  message: (message: StreamMessage) => void
63
68
  }
@@ -73,7 +78,7 @@ export class ProxyClient extends EventEmitter<Events> {
73
78
  private readonly config: ProxyClientConfig
74
79
  private readonly duplicateDetectors: Map<string, DuplicateMessageDetector> = new Map()
75
80
  private definition?: ProxyDefinition
76
- private readonly connections: Map<DhtAddress, ProxyDirection> = new Map()
81
+ private readonly connections: Map<DhtAddress, ProxyConnection> = new Map()
77
82
  private readonly propagation: Propagation
78
83
  private readonly neighbors: NodeList
79
84
  private readonly abortController: AbortController
@@ -159,7 +164,7 @@ export class ProxyClient extends EventEmitter<Events> {
159
164
  private getInvalidConnections(): DhtAddress[] {
160
165
  return Array.from(this.connections.keys()).filter((id) => {
161
166
  return !this.definition!.nodes.has(id)
162
- || this.definition!.direction !== this.connections.get(id)
167
+ || this.definition!.direction !== this.connections.get(id)!.direction
163
168
  })
164
169
  }
165
170
 
@@ -183,7 +188,7 @@ export class ProxyClient extends EventEmitter<Events> {
183
188
  const accepted = await rpcRemote.requestConnection(direction, userId)
184
189
  if (accepted) {
185
190
  this.config.connectionLocker.lockConnection(peerDescriptor, SERVICE_ID)
186
- this.connections.set(nodeId, direction)
191
+ this.connections.set(nodeId, { peerDescriptor, direction })
187
192
  const remote = new DeliveryRpcRemote(
188
193
  this.config.localPeerDescriptor,
189
194
  peerDescriptor,
@@ -216,13 +221,15 @@ export class ProxyClient extends EventEmitter<Events> {
216
221
  })
217
222
  const server = this.neighbors.get(nodeId)
218
223
  server?.leaveStreamPartNotice(this.config.streamPartId, false)
219
- this.removeConnection(nodeId)
224
+ this.removeConnection(this.connections.get(nodeId)!.peerDescriptor)
220
225
  }
221
226
  }
222
227
 
223
- private removeConnection(nodeId: DhtAddress): void {
228
+ private removeConnection(peerDescriptor: PeerDescriptor): void {
229
+ const nodeId = getNodeIdFromPeerDescriptor(peerDescriptor)
224
230
  this.connections.delete(nodeId)
225
231
  this.neighbors.remove(nodeId)
232
+ this.config.connectionLocker.unlockConnection(peerDescriptor, SERVICE_ID)
226
233
  }
227
234
 
228
235
  broadcast(msg: StreamMessage, previousNode?: DhtAddress): void {
@@ -234,7 +241,7 @@ export class ProxyClient extends EventEmitter<Events> {
234
241
  }
235
242
 
236
243
  hasConnection(nodeId: DhtAddress, direction: ProxyDirection): boolean {
237
- return this.connections.has(nodeId) && this.connections.get(nodeId) === direction
244
+ return this.connections.has(nodeId) && this.connections.get(nodeId)!.direction === direction
238
245
  }
239
246
 
240
247
  getDirection(): ProxyDirection {
@@ -245,7 +252,7 @@ export class ProxyClient extends EventEmitter<Events> {
245
252
  const nodeId = getNodeIdFromPeerDescriptor(peerDescriptor)
246
253
  if (this.connections.has(nodeId)) {
247
254
  this.config.connectionLocker.unlockConnection(peerDescriptor, SERVICE_ID)
248
- this.removeConnection(nodeId)
255
+ this.removeConnection(peerDescriptor)
249
256
  await retry(() => this.updateConnections(), 'updating proxy connections', this.abortController.signal)
250
257
  }
251
258
  }
@@ -32,6 +32,10 @@ export class TemporaryConnectionRpcLocal implements ITemporaryConnectionRpc {
32
32
  return this.temporaryNodes
33
33
  }
34
34
 
35
+ hasNode(node: DhtAddress): boolean {
36
+ return this.temporaryNodes.has(node)
37
+ }
38
+
35
39
  removeNode(nodeId: DhtAddress): void {
36
40
  this.temporaryNodes.remove(nodeId)
37
41
  }
@@ -1,7 +1,7 @@
1
- import { ConnectionManager, DhtNode, PeerDescriptor, NodeType } from '@streamr/dht'
1
+ import { ConnectionManager, DhtNode, PeerDescriptor } from '@streamr/dht'
2
2
  import { RandomGraphNode } from '../../src/logic/RandomGraphNode'
3
3
  import { waitForCondition } from '@streamr/utils'
4
- import { createStreamMessage } from '../utils/utils'
4
+ import { createMockPeerDescriptor, createStreamMessage } from '../utils/utils'
5
5
  import { createRandomGraphNode } from '../../src/logic/createRandomGraphNode'
6
6
  import { StreamPartIDUtils } from '@streamr/protocol'
7
7
  import { randomEthereumAddress } from '@streamr/test-utils'
@@ -10,11 +10,9 @@ import { Layer1Node } from '../../src/logic/Layer1Node'
10
10
 
11
11
  describe('random graph with real connections', () => {
12
12
 
13
- const epPeerDescriptor: PeerDescriptor = {
14
- nodeId: Uint8Array.from([1, 2, 3]),
15
- type: NodeType.NODEJS,
13
+ const epPeerDescriptor: PeerDescriptor = createMockPeerDescriptor({
16
14
  websocket: { host: '127.0.0.1', port: 12221, tls: false }
17
- }
15
+ })
18
16
 
19
17
  const streamPartId = StreamPartIDUtils.parse('random-graph#0')
20
18
  // Currently the nodes here are practically layer0 nodes acting as layer1 nodes, for the purpose of this test
@@ -1,4 +1,4 @@
1
- import { NodeType, PeerDescriptor, Simulator, SimulatorTransport } from '@streamr/dht'
1
+ import { PeerDescriptor, Simulator, SimulatorTransport } from '@streamr/dht'
2
2
  import {
3
3
  ContentType,
4
4
  EncryptionType,
@@ -10,6 +10,7 @@ import {
10
10
  } from '@streamr/protocol'
11
11
  import { EthereumAddress, hexToBinary, utf8ToBinary, waitForCondition } from '@streamr/utils'
12
12
  import { NetworkNode, createNetworkNode } from '../../src/NetworkNode'
13
+ import { createMockPeerDescriptor } from '../utils/utils'
13
14
 
14
15
  const STREAM_PART_ID = StreamPartIDUtils.parse('test#0')
15
16
 
@@ -21,15 +22,9 @@ describe('NetworkNode', () => {
21
22
  let node1: NetworkNode
22
23
  let node2: NetworkNode
23
24
 
24
- const pd1: PeerDescriptor = {
25
- nodeId: new Uint8Array([1, 2, 3]),
26
- type: NodeType.NODEJS
27
- }
25
+ const pd1: PeerDescriptor = createMockPeerDescriptor()
28
26
 
29
- const pd2: PeerDescriptor = {
30
- nodeId: new Uint8Array([1, 1, 1]),
31
- type: NodeType.NODEJS
32
- }
27
+ const pd2: PeerDescriptor = createMockPeerDescriptor()
33
28
 
34
29
  beforeEach(async () => {
35
30
  const simulator = new Simulator()
@@ -1,13 +1,7 @@
1
- import {
2
- DhtNode,
3
- PeerDescriptor,
4
- Simulator,
5
- SimulatorTransport,
6
- NodeType
7
- } from '@streamr/dht'
1
+ import { DhtNode, PeerDescriptor, Simulator, SimulatorTransport } from '@streamr/dht'
8
2
  import { StreamrNode, Events } from '../../src/logic/StreamrNode'
9
3
  import { waitForEvent3, waitForCondition } from '@streamr/utils'
10
- import { createStreamMessage } from '../utils/utils'
4
+ import { createMockPeerDescriptor, createStreamMessage } from '../utils/utils'
11
5
  import { StreamPartIDUtils } from '@streamr/protocol'
12
6
  import { randomEthereumAddress } from '@streamr/test-utils'
13
7
  import { Layer0Node } from '../../src/logic/Layer0Node'
@@ -21,14 +15,8 @@ describe('StreamrNode', () => {
21
15
  let node1: StreamrNode
22
16
  let node2: StreamrNode
23
17
 
24
- const peerDescriptor1: PeerDescriptor = {
25
- nodeId: new Uint8Array([1, 2, 3]),
26
- type: NodeType.NODEJS
27
- }
28
- const peerDescriptor2: PeerDescriptor = {
29
- nodeId: new Uint8Array([1, 1, 1]),
30
- type: NodeType.NODEJS
31
- }
18
+ const peerDescriptor1: PeerDescriptor = createMockPeerDescriptor()
19
+ const peerDescriptor2: PeerDescriptor = createMockPeerDescriptor()
32
20
  const STREAM_PART_ID = StreamPartIDUtils.parse('test#0')
33
21
 
34
22
  const msg = createStreamMessage(
@@ -1,9 +1,9 @@
1
- import { NodeType, PeerDescriptor, Simulator, SimulatorTransport, LatencyType, getRandomRegion } from '@streamr/dht'
1
+ import { PeerDescriptor, Simulator, SimulatorTransport, LatencyType } from '@streamr/dht'
2
2
  import { NetworkStack } from '../../src/NetworkStack'
3
3
  import { streamPartIdToDataKey } from '../../src/logic/EntryPointDiscovery'
4
4
  import { StreamPartIDUtils } from '@streamr/protocol'
5
5
  import { Any } from '../../src/proto/google/protobuf/any'
6
- import { createStreamMessage } from '../utils/utils'
6
+ import { createMockPeerDescriptor, createStreamMessage } from '../utils/utils'
7
7
  import { waitForCondition } from '@streamr/utils'
8
8
  import { randomEthereumAddress } from '@streamr/test-utils'
9
9
 
@@ -11,35 +11,11 @@ const STREAM_PART_ID = StreamPartIDUtils.parse('stream#0')
11
11
 
12
12
  describe('Joining stream parts on offline nodes', () => {
13
13
 
14
- const entryPointPeerDescriptor: PeerDescriptor = {
15
- nodeId: new Uint8Array([1, 2, 3]),
16
- type: NodeType.NODEJS,
17
- region: getRandomRegion()
18
- }
19
-
20
- const node1PeerDescriptor: PeerDescriptor = {
21
- nodeId: new Uint8Array([1, 1, 1]),
22
- type: NodeType.NODEJS,
23
- region: getRandomRegion()
24
- }
25
-
26
- const node2PeerDescriptor: PeerDescriptor = {
27
- nodeId: new Uint8Array([2, 2, 2]),
28
- type: NodeType.NODEJS,
29
- region: getRandomRegion()
30
- }
31
-
32
- const offlineDescriptor1: PeerDescriptor = {
33
- nodeId: new Uint8Array([3, 3, 3]),
34
- type: NodeType.NODEJS,
35
- region: getRandomRegion()
36
- }
37
-
38
- const offlineDescriptor2: PeerDescriptor = {
39
- nodeId: new Uint8Array([4, 4, 4]),
40
- type: NodeType.NODEJS,
41
- region: getRandomRegion()
42
- }
14
+ const entryPointPeerDescriptor: PeerDescriptor = createMockPeerDescriptor()
15
+ const node1PeerDescriptor: PeerDescriptor = createMockPeerDescriptor()
16
+ const node2PeerDescriptor: PeerDescriptor = createMockPeerDescriptor()
17
+ const offlineDescriptor1: PeerDescriptor = createMockPeerDescriptor()
18
+ const offlineDescriptor2: PeerDescriptor = createMockPeerDescriptor()
43
19
 
44
20
  let entryPoint: NetworkStack
45
21
  let node1: NetworkStack
@@ -1,4 +1,4 @@
1
- import { LatencyType, NodeType, PeerDescriptor, Simulator, SimulatorTransport, getRandomRegion } from '@streamr/dht'
1
+ import { LatencyType, PeerDescriptor, Simulator, SimulatorTransport } from '@streamr/dht'
2
2
  import {
3
3
  ContentType,
4
4
  EncryptionType,
@@ -22,11 +22,7 @@ describe('stream without default entrypoints', () => {
22
22
  let entrypoint: NetworkNode
23
23
  let nodes: NetworkNode[]
24
24
  let receivedMessageCount: number
25
- const entryPointPeerDescriptor: PeerDescriptor = {
26
- nodeId: new Uint8Array([1, 2, 3]),
27
- type: NodeType.NODEJS,
28
- region: getRandomRegion()
29
- }
25
+ const entryPointPeerDescriptor: PeerDescriptor = createMockPeerDescriptor()
30
26
 
31
27
  const streamMessage = new StreamMessage({
32
28
  messageId: new MessageID(
@@ -2,8 +2,7 @@ import { InspectSession, Events } from '../../src/logic/inspect/InspectSession'
2
2
  import { MessageID } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc'
3
3
  import { waitForEvent3 } from '../../../utils/dist/src/waitForEvent3'
4
4
  import { utf8ToBinary } from '@streamr/utils'
5
- import { createRandomNodeId } from '../utils/utils'
6
- import { DhtAddress } from '@streamr/dht'
5
+ import { DhtAddress, createRandomDhtAddress } from '@streamr/dht'
7
6
 
8
7
  describe('InspectSession', () => {
9
8
 
@@ -31,8 +30,8 @@ describe('InspectSession', () => {
31
30
  }
32
31
 
33
32
  beforeEach(() => {
34
- inspectedNode = createRandomNodeId()
35
- anotherNode = createRandomNodeId()
33
+ inspectedNode = createRandomDhtAddress()
34
+ anotherNode = createRandomDhtAddress()
36
35
  inspectSession = new InspectSession({
37
36
  inspectedNode
38
37
  })
@@ -1,8 +1,8 @@
1
- import { ListeningRpcCommunicator, getNodeIdFromPeerDescriptor } from '@streamr/dht'
1
+ import { ListeningRpcCommunicator, createRandomDhtAddress, getNodeIdFromPeerDescriptor } from '@streamr/dht'
2
2
  import { utf8ToBinary } from '@streamr/utils'
3
3
  import { Inspector } from '../../src/logic/inspect/Inspector'
4
4
  import { MockTransport } from '../utils/mock/Transport'
5
- import { createMockPeerDescriptor, createRandomNodeId, mockConnectionLocker } from '../utils/utils'
5
+ import { createMockPeerDescriptor, mockConnectionLocker } from '../utils/utils'
6
6
  import { StreamPartIDUtils } from '@streamr/protocol'
7
7
 
8
8
  describe('Inspector', () => {
@@ -12,7 +12,7 @@ describe('Inspector', () => {
12
12
 
13
13
  const inspectedDescriptor = createMockPeerDescriptor()
14
14
 
15
- const nodeId = createRandomNodeId()
15
+ const nodeId = createRandomDhtAddress()
16
16
  let mockConnect: jest.Mock
17
17
 
18
18
  const messageRef = {
@@ -3,12 +3,12 @@ import { NodeList } from '../../src/logic/NodeList'
3
3
  import { waitForCondition } from '@streamr/utils'
4
4
  import { range } from 'lodash'
5
5
  import { expect } from 'expect'
6
- import { createMockDeliveryRpcRemote, createRandomNodeId } from '../utils/utils'
7
- import { DhtAddress, getNodeIdFromPeerDescriptor } from '@streamr/dht'
6
+ import { createMockDeliveryRpcRemote } from '../utils/utils'
7
+ import { DhtAddress, createRandomDhtAddress, getNodeIdFromPeerDescriptor } from '@streamr/dht'
8
8
 
9
9
  describe('NeighborFinder', () => {
10
10
 
11
- const nodeId = createRandomNodeId()
11
+ const nodeId = createRandomDhtAddress()
12
12
  let neighbors: NodeList
13
13
  let nearbyNodeView: NodeList
14
14
  let neighborFinder: NeighborFinder
@@ -39,6 +39,9 @@ describe('NeighborUpdateRpcLocal', () => {
39
39
  neighborFinder = {
40
40
  start: jest.fn()
41
41
  } as any
42
+ const connectionLocker = {
43
+ unlockConnection: jest.fn()
44
+ } as any
42
45
 
43
46
  rpcLocal = new NeighborUpdateRpcLocal({
44
47
  localPeerDescriptor,
@@ -47,7 +50,8 @@ describe('NeighborUpdateRpcLocal', () => {
47
50
  neighborFinder,
48
51
  streamPartId,
49
52
  rpcCommunicator,
50
- neighborTargetCount
53
+ neighborTargetCount,
54
+ connectionLocker
51
55
  })
52
56
  })
53
57
 
@@ -2,6 +2,7 @@ import {
2
2
  ListeningRpcCommunicator,
3
3
  NodeType,
4
4
  PeerDescriptor,
5
+ createRandomDhtAddress,
5
6
  getDhtAddressFromRaw,
6
7
  getNodeIdFromPeerDescriptor,
7
8
  } from '@streamr/dht'
@@ -11,7 +12,7 @@ import { DeliveryRpcRemote } from '../../src/logic/DeliveryRpcRemote'
11
12
  import { NodeList } from '../../src/logic/NodeList'
12
13
  import { formStreamPartDeliveryServiceId } from '../../src/logic/formStreamPartDeliveryServiceId'
13
14
  import { DeliveryRpcClient } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc.client'
14
- import { createMockPeerDescriptor, createRandomNodeId } from '../utils/utils'
15
+ import { createMockPeerDescriptor } from '../utils/utils'
15
16
  import { MockTransport } from '../utils/mock/Transport'
16
17
 
17
18
  const streamPartId = StreamPartIDUtils.parse('stream#0')
@@ -25,7 +26,7 @@ describe('NodeList', () => {
25
26
  new Uint8Array([1, 1, 4]),
26
27
  new Uint8Array([1, 1, 5])
27
28
  ]
28
- const ownId = createRandomNodeId()
29
+ const ownId = createRandomDhtAddress()
29
30
  let nodeList: NodeList
30
31
 
31
32
  const createRemoteGraphNode = (peerDescriptor: PeerDescriptor) => {
@@ -135,7 +136,7 @@ describe('NodeList', () => {
135
136
  })
136
137
 
137
138
  it('items are in insertion order', () => {
138
- const list = new NodeList(createRandomNodeId(), 100)
139
+ const list = new NodeList(createRandomDhtAddress(), 100)
139
140
  const item1 = createRemoteGraphNode(createMockPeerDescriptor())
140
141
  const item2 = createRemoteGraphNode(createMockPeerDescriptor())
141
142
  const item3 = createRemoteGraphNode(createMockPeerDescriptor())
@@ -66,19 +66,19 @@ describe('RandomGraphNode', () => {
66
66
  expect(ids[0]).toEqual(getNodeIdFromPeerDescriptor(mockRemote.getPeerDescriptor()))
67
67
  })
68
68
 
69
- it('Adds Closest Nodes from layer1 newContact event to nearbyNodeView', async () => {
69
+ it('Adds Closest Nodes from layer1 contactAdded event to nearbyNodeView', async () => {
70
70
  const peerDescriptor1 = createMockPeerDescriptor()
71
71
  const peerDescriptor2 = createMockPeerDescriptor()
72
- layer1Node.emit('newContact', peerDescriptor1, [peerDescriptor1, peerDescriptor2])
72
+ layer1Node.emit('contactAdded', peerDescriptor1, [peerDescriptor1, peerDescriptor2])
73
73
  await waitForCondition(() => nearbyNodeView.size() === 2)
74
74
  expect(nearbyNodeView.get(getNodeIdFromPeerDescriptor(peerDescriptor1))).toBeTruthy()
75
75
  expect(nearbyNodeView.get(getNodeIdFromPeerDescriptor(peerDescriptor2))).toBeTruthy()
76
76
  })
77
77
 
78
- it('Adds Random Nodes from layer1 newRandomContact event to randomNodeView', async () => {
78
+ it('Adds Random Nodes from layer1 randomContactAdded event to randomNodeView', async () => {
79
79
  const peerDescriptor1 = createMockPeerDescriptor()
80
80
  const peerDescriptor2 = createMockPeerDescriptor()
81
- layer1Node.emit('newRandomContact', peerDescriptor1, [peerDescriptor1, peerDescriptor2])
81
+ layer1Node.emit('randomContactAdded', peerDescriptor1, [peerDescriptor1, peerDescriptor2])
82
82
  await waitForCondition(() => randomNodeView.size() === 2)
83
83
  expect(randomNodeView.get(getNodeIdFromPeerDescriptor(peerDescriptor1))).toBeTruthy()
84
84
  expect(randomNodeView.get(getNodeIdFromPeerDescriptor(peerDescriptor2))).toBeTruthy()
@@ -88,7 +88,7 @@ describe('RandomGraphNode', () => {
88
88
  const peerDescriptor1 = createMockPeerDescriptor()
89
89
  const peerDescriptor2 = createMockPeerDescriptor()
90
90
  layer1Node.addNewRandomPeerToKBucket()
91
- layer1Node.emit('newContact', peerDescriptor1, [peerDescriptor1, peerDescriptor2])
91
+ layer1Node.emit('contactAdded', peerDescriptor1, [peerDescriptor1, peerDescriptor2])
92
92
  await waitForCondition(() => {
93
93
  return nearbyNodeView.size() === 3
94
94
  }, 20000)
@@ -1,13 +1,11 @@
1
- import { randomBytes } from 'crypto'
2
1
  import {
3
2
  ConnectionLocker,
4
- DhtAddress,
5
3
  DhtNode,
6
4
  NodeType,
7
5
  PeerDescriptor,
8
6
  Simulator,
9
7
  SimulatorTransport,
10
- getDhtAddressFromRaw,
8
+ createRandomDhtAddress,
11
9
  getRandomRegion,
12
10
  getRawFromDhtAddress
13
11
  } from '@streamr/dht'
@@ -91,14 +89,10 @@ export const createStreamMessage = (
91
89
  return msg
92
90
  }
93
91
 
94
- export const createRandomNodeId = (): DhtAddress => {
95
- return getDhtAddressFromRaw(randomBytes(10))
96
- }
97
-
98
92
  export const createMockPeerDescriptor = (opts?: Omit<Partial<PeerDescriptor>, 'nodeId' | 'type'>): PeerDescriptor => {
99
93
  return {
100
94
  ...opts,
101
- nodeId: getRawFromDhtAddress(createRandomNodeId()),
95
+ nodeId: getRawFromDhtAddress(createRandomDhtAddress()),
102
96
  type: NodeType.NODEJS,
103
97
  region: getRandomRegion()
104
98
  }