@streamr/trackerless-network 100.0.0 → 100.1.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/dist/package.json +6 -6
- package/dist/src/NetworkNode.js +11 -11
- package/dist/src/NetworkNode.js.map +1 -1
- package/dist/src/NetworkStack.d.ts +4 -4
- package/dist/src/NetworkStack.js +18 -16
- package/dist/src/NetworkStack.js.map +1 -1
- package/dist/src/exports.d.ts +1 -1
- package/dist/src/logic/{StreamrNode.d.ts → ContentDeliveryManager.d.ts} +6 -6
- package/dist/src/logic/{StreamrNode.js → ContentDeliveryManager.js} +7 -9
- package/dist/src/logic/ContentDeliveryManager.js.map +1 -0
- package/dist/src/logic/{DeliveryRpcLocal.d.ts → ContentDeliveryRpcLocal.d.ts} +4 -4
- package/dist/src/logic/{DeliveryRpcLocal.js → ContentDeliveryRpcLocal.js} +4 -4
- package/dist/src/logic/ContentDeliveryRpcLocal.js.map +1 -0
- package/dist/src/logic/{DeliveryRpcRemote.d.ts → ContentDeliveryRpcRemote.d.ts} +2 -2
- package/dist/src/logic/{DeliveryRpcRemote.js → ContentDeliveryRpcRemote.js} +4 -4
- package/dist/src/logic/ContentDeliveryRpcRemote.js.map +1 -0
- package/dist/src/logic/EntryPointDiscovery.js +1 -1
- package/dist/src/logic/EntryPointDiscovery.js.map +1 -1
- package/dist/src/logic/NodeList.d.ts +11 -11
- package/dist/src/logic/NodeList.js.map +1 -1
- package/dist/src/logic/RandomGraphNode.d.ts +1 -1
- package/dist/src/logic/RandomGraphNode.js +12 -12
- package/dist/src/logic/RandomGraphNode.js.map +1 -1
- package/dist/src/logic/createRandomGraphNode.js +1 -1
- package/dist/src/logic/createRandomGraphNode.js.map +1 -1
- package/dist/src/logic/formStreamPartDeliveryServiceId.d.ts +1 -1
- package/dist/src/logic/formStreamPartDeliveryServiceId.js +4 -3
- package/dist/src/logic/formStreamPartDeliveryServiceId.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/HandshakeRpcLocal.d.ts +2 -2
- package/dist/src/logic/neighbor-discovery/HandshakeRpcLocal.js +3 -3
- package/dist/src/logic/neighbor-discovery/HandshakeRpcLocal.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.js +2 -2
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/Handshaker.d.ts +1 -1
- package/dist/src/logic/neighbor-discovery/Handshaker.js +6 -6
- package/dist/src/logic/neighbor-discovery/Handshaker.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js +2 -2
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.js +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.js.map +1 -1
- package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.js +6 -0
- package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.js.map +1 -1
- package/dist/src/logic/proxy/ProxyClient.d.ts +1 -1
- package/dist/src/logic/proxy/ProxyClient.js +8 -8
- package/dist/src/logic/proxy/ProxyClient.js.map +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcLocal.d.ts +2 -2
- package/dist/src/logic/proxy/ProxyConnectionRpcLocal.js +3 -3
- package/dist/src/logic/proxy/ProxyConnectionRpcLocal.js.map +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js.map +1 -1
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js +3 -3
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js.map +1 -1
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.js +2 -2
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.js.map +1 -1
- package/dist/src/proto/google/protobuf/any.d.ts +11 -4
- package/dist/src/proto/google/protobuf/any.js.map +1 -1
- package/dist/src/proto/google/protobuf/empty.d.ts +0 -1
- package/dist/src/proto/google/protobuf/empty.js.map +1 -1
- package/dist/src/proto/google/protobuf/timestamp.d.ts +9 -3
- package/dist/src/proto/google/protobuf/timestamp.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +10 -0
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +9 -2
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +44 -0
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +29 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +6 -0
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.d.ts +4 -4
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.js +7 -7
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.js.map +1 -1
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.d.ts +9 -5
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.js +8 -4
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.js.map +1 -1
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.server.d.ts +2 -2
- package/dist/test/benchmark/first-message.js +4 -4
- package/dist/test/benchmark/first-message.js.map +1 -1
- package/dist/test/utils/utils.d.ts +2 -2
- package/dist/test/utils/utils.js +9 -6
- package/dist/test/utils/utils.js.map +1 -1
- package/karma.config.js +2 -0
- package/package.json +6 -6
- package/protos/NetworkRpc.proto +3 -2
- package/src/NetworkNode.ts +11 -11
- package/src/NetworkStack.ts +23 -18
- package/src/exports.ts +1 -1
- package/src/logic/{StreamrNode.ts → ContentDeliveryManager.ts} +12 -13
- package/src/logic/{DeliveryRpcLocal.ts → ContentDeliveryRpcLocal.ts} +5 -5
- package/src/logic/{DeliveryRpcRemote.ts → ContentDeliveryRpcRemote.ts} +2 -2
- package/src/logic/EntryPointDiscovery.ts +1 -1
- package/src/logic/NodeList.ts +13 -13
- package/src/logic/RandomGraphNode.ts +19 -21
- package/src/logic/createRandomGraphNode.ts +2 -2
- package/src/logic/formStreamPartDeliveryServiceId.ts +2 -1
- package/src/logic/neighbor-discovery/HandshakeRpcLocal.ts +5 -5
- package/src/logic/neighbor-discovery/HandshakeRpcRemote.ts +2 -2
- package/src/logic/neighbor-discovery/Handshaker.ts +10 -11
- package/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.ts +4 -4
- package/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.ts +1 -1
- package/src/logic/protocol-integration/stream-message/StreamMessageTranslator.ts +16 -10
- package/src/logic/proxy/ProxyClient.ts +11 -11
- package/src/logic/proxy/ProxyConnectionRpcLocal.ts +6 -6
- package/src/logic/proxy/ProxyConnectionRpcRemote.ts +1 -1
- package/src/logic/temporary-connection/TemporaryConnectionRpcLocal.ts +5 -5
- package/src/logic/temporary-connection/TemporaryConnectionRpcRemote.ts +2 -2
- package/src/proto/google/protobuf/any.ts +11 -4
- package/src/proto/google/protobuf/empty.ts +0 -1
- package/src/proto/google/protobuf/timestamp.ts +9 -3
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +15 -2
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +6 -0
- package/src/proto/packages/dht/protos/DhtRpc.ts +58 -0
- package/src/proto/packages/trackerless-network/protos/NetworkRpc.client.ts +8 -8
- package/src/proto/packages/trackerless-network/protos/NetworkRpc.server.ts +2 -2
- package/src/proto/packages/trackerless-network/protos/NetworkRpc.ts +10 -6
- package/test/benchmark/first-message.ts +4 -4
- package/test/end-to-end/inspect.test.ts +6 -6
- package/test/end-to-end/proxy-and-full-node.test.ts +19 -19
- package/test/end-to-end/proxy-connections.test.ts +7 -7
- package/test/end-to-end/proxy-key-exchange.test.ts +3 -3
- package/test/end-to-end/webrtc-full-node-network.test.ts +8 -8
- package/test/end-to-end/websocket-full-node-network.test.ts +9 -9
- package/test/integration/ContentDeliveryManager.test.ts +135 -0
- package/test/integration/{DeliveryRpcRemote.test.ts → ContentDeliveryRpcRemote.test.ts} +6 -6
- package/test/integration/Inspect.test.ts +2 -2
- package/test/integration/NetworkRpc.test.ts +3 -3
- package/test/integration/NetworkStack.test.ts +7 -7
- package/test/integration/NodeInfoRpc.test.ts +10 -10
- package/test/integration/joining-streams-on-offline-peers.test.ts +3 -3
- package/test/integration/streamEntryPointReplacing.test.ts +6 -4
- package/test/unit/ContentDeliveryManager.test.ts +96 -0
- package/test/unit/{DeliveryRpcLocal.test.ts → ContentDeliveryRpcLocal.test.ts} +4 -4
- package/test/unit/HandshakeRpcLocal.test.ts +19 -19
- package/test/unit/Handshaker.test.ts +2 -2
- package/test/unit/NeighborFinder.test.ts +2 -2
- package/test/unit/NeighborUpdateRpcLocal.test.ts +8 -8
- package/test/unit/NetworkNode.test.ts +6 -6
- package/test/unit/NodeList.test.ts +6 -6
- package/test/unit/RandomGraphNode.test.ts +3 -3
- package/test/utils/utils.ts +9 -6
- package/dist/src/logic/DeliveryRpcLocal.js.map +0 -1
- package/dist/src/logic/DeliveryRpcRemote.js.map +0 -1
- package/dist/src/logic/StreamrNode.js.map +0 -1
- package/test/integration/StreamrNode.test.ts +0 -131
- package/test/unit/StreamrNode.test.ts +0 -98
|
@@ -67,15 +67,15 @@ describe('NetworkStack NodeInfoRpc', () => {
|
|
|
67
67
|
it('happy path', async () => {
|
|
68
68
|
const streamPartId1 = StreamPartIDUtils.parse('stream1#0')
|
|
69
69
|
const streamPartId2 = StreamPartIDUtils.parse('stream2#0')
|
|
70
|
-
requesteStack.
|
|
71
|
-
otherStack.
|
|
72
|
-
requesteStack.
|
|
73
|
-
otherStack.
|
|
70
|
+
requesteStack.getContentDeliveryManager().joinStreamPart(streamPartId1)
|
|
71
|
+
otherStack.getContentDeliveryManager().joinStreamPart(streamPartId1)
|
|
72
|
+
requesteStack.getContentDeliveryManager().joinStreamPart(streamPartId2)
|
|
73
|
+
otherStack.getContentDeliveryManager().joinStreamPart(streamPartId2)
|
|
74
74
|
await waitForCondition(() =>
|
|
75
|
-
requesteStack.
|
|
76
|
-
&& otherStack.
|
|
77
|
-
&& requesteStack.
|
|
78
|
-
&& otherStack.
|
|
75
|
+
requesteStack.getContentDeliveryManager().getNeighbors(streamPartId1).length === 1
|
|
76
|
+
&& otherStack.getContentDeliveryManager().getNeighbors(streamPartId1).length === 1
|
|
77
|
+
&& requesteStack.getContentDeliveryManager().getNeighbors(streamPartId2).length === 1
|
|
78
|
+
&& otherStack.getContentDeliveryManager().getNeighbors(streamPartId2).length === 1
|
|
79
79
|
)
|
|
80
80
|
const result = await nodeInfoClient.getInfo(requesteePeerDescriptor)
|
|
81
81
|
expect(result).toMatchObject({
|
|
@@ -88,12 +88,12 @@ describe('NetworkStack NodeInfoRpc', () => {
|
|
|
88
88
|
{
|
|
89
89
|
id: streamPartId1,
|
|
90
90
|
controlLayerNeighbors: [normalizePeerDescriptor(otherPeerDescriptor)],
|
|
91
|
-
|
|
91
|
+
contentDeliveryLayerNeighbors: [normalizePeerDescriptor(otherPeerDescriptor)]
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
id: streamPartId2,
|
|
95
95
|
controlLayerNeighbors: [normalizePeerDescriptor(otherPeerDescriptor)],
|
|
96
|
-
|
|
96
|
+
contentDeliveryLayerNeighbors: [normalizePeerDescriptor(otherPeerDescriptor)]
|
|
97
97
|
}
|
|
98
98
|
],
|
|
99
99
|
version: expect.any(String)
|
|
@@ -70,10 +70,10 @@ describe('Joining stream parts on offline nodes', () => {
|
|
|
70
70
|
await entryPoint.getLayer0Node().storeDataToDht(streamPartIdToDataKey(STREAM_PART_ID), Any.pack(offlineDescriptor1, PeerDescriptor))
|
|
71
71
|
await entryPoint.getLayer0Node().storeDataToDht(streamPartIdToDataKey(STREAM_PART_ID), Any.pack(offlineDescriptor2, PeerDescriptor))
|
|
72
72
|
|
|
73
|
-
node1.
|
|
74
|
-
node1.
|
|
73
|
+
node1.getContentDeliveryManager().joinStreamPart(STREAM_PART_ID)
|
|
74
|
+
node1.getContentDeliveryManager().on('newMessage', () => { messageReceived = true })
|
|
75
75
|
const msg = createStreamMessage(JSON.stringify({ hello: 'WORLD' }), STREAM_PART_ID, randomEthereumAddress())
|
|
76
|
-
node2.
|
|
76
|
+
node2.getContentDeliveryManager().broadcast(msg)
|
|
77
77
|
await waitForCondition(() => messageReceived, 40000)
|
|
78
78
|
}, 60000)
|
|
79
79
|
|
|
@@ -75,20 +75,22 @@ describe('Stream Entry Points are replaced when known entry points leave streams
|
|
|
75
75
|
let receivedMessages = 0
|
|
76
76
|
for (const node of laterNodesOnStream) {
|
|
77
77
|
await node.joinStreamPart(STREAM_PART_ID, { minCount: 4, timeout: 60000 })
|
|
78
|
-
node.
|
|
78
|
+
node.getContentDeliveryManager().on('newMessage', () => {
|
|
79
79
|
receivedMessages += 1
|
|
80
80
|
})
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
await Promise.all(initialNodesOnStream.map((node) => node.
|
|
84
|
-
await waitForCondition(() =>
|
|
83
|
+
await Promise.all(initialNodesOnStream.map((node) => node.getContentDeliveryManager().leaveStreamPart(STREAM_PART_ID)))
|
|
84
|
+
await waitForCondition(() =>
|
|
85
|
+
laterNodesOnStream.every((node) => node.getContentDeliveryManager().getNeighbors(STREAM_PART_ID).length >= 4), 60000, 1000
|
|
86
|
+
)
|
|
85
87
|
|
|
86
88
|
const msg = createStreamMessage(
|
|
87
89
|
JSON.stringify({ hello: 'WORLD' }),
|
|
88
90
|
STREAM_PART_ID,
|
|
89
91
|
randomEthereumAddress()
|
|
90
92
|
)
|
|
91
|
-
newNodeInStream.
|
|
93
|
+
newNodeInStream.getContentDeliveryManager().broadcast(msg)
|
|
92
94
|
await waitForCondition(() => receivedMessages === NUM_OF_LATER_NODES, 30000)
|
|
93
95
|
}, 200000)
|
|
94
96
|
})
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { areEqualPeerDescriptors } from '@streamr/dht'
|
|
2
|
+
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
3
|
+
import { randomEthereumAddress } from '@streamr/test-utils'
|
|
4
|
+
import { waitForCondition } from '@streamr/utils'
|
|
5
|
+
import { ContentDeliveryManager } from '../../src/logic/ContentDeliveryManager'
|
|
6
|
+
import { MockLayer0Node } from '../utils/mock/MockLayer0Node'
|
|
7
|
+
import { MockTransport } from '../utils/mock/Transport'
|
|
8
|
+
import { createMockPeerDescriptor, createStreamMessage, mockConnectionLocker } from '../utils/utils'
|
|
9
|
+
import { ProxyDirection } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc'
|
|
10
|
+
|
|
11
|
+
describe('ContentDeliveryManager', () => {
|
|
12
|
+
|
|
13
|
+
let manager: ContentDeliveryManager
|
|
14
|
+
const peerDescriptor = createMockPeerDescriptor()
|
|
15
|
+
|
|
16
|
+
beforeEach(async () => {
|
|
17
|
+
manager = new ContentDeliveryManager({})
|
|
18
|
+
const mockLayer0 = new MockLayer0Node(peerDescriptor)
|
|
19
|
+
await manager.start(mockLayer0, new MockTransport(), mockConnectionLocker)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
afterEach(async () => {
|
|
23
|
+
await manager.destroy()
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('PeerDescriptor is correct', () => {
|
|
27
|
+
expect(areEqualPeerDescriptors(peerDescriptor, manager.getPeerDescriptor()))
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
describe('join and leave', () => {
|
|
31
|
+
|
|
32
|
+
const streamPartId = StreamPartIDUtils.parse('stream#0')
|
|
33
|
+
const message = createStreamMessage(
|
|
34
|
+
JSON.stringify({ hello: 'WORLD' }),
|
|
35
|
+
streamPartId,
|
|
36
|
+
randomEthereumAddress()
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
beforeEach(async () => {
|
|
40
|
+
manager.setStreamPartEntryPoints(streamPartId, [manager.getPeerDescriptor()])
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('can join stream part', async () => {
|
|
44
|
+
manager.joinStreamPart(streamPartId)
|
|
45
|
+
expect(manager.hasStreamPart(streamPartId)).toEqual(true)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('can leave stream part', async () => {
|
|
49
|
+
manager.joinStreamPart(streamPartId)
|
|
50
|
+
expect(manager.hasStreamPart(streamPartId)).toEqual(true)
|
|
51
|
+
await manager.leaveStreamPart(streamPartId)
|
|
52
|
+
expect(manager.hasStreamPart(streamPartId)).toEqual(false)
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('broadcast joins stream', async () => {
|
|
56
|
+
manager.broadcast(message)
|
|
57
|
+
await waitForCondition(() => manager.hasStreamPart(streamPartId))
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
describe('proxied stream', () => {
|
|
62
|
+
it('happy path', async () => {
|
|
63
|
+
const streamPartId = StreamPartIDUtils.parse('stream#0')
|
|
64
|
+
const proxy = createMockPeerDescriptor()
|
|
65
|
+
const userId = randomEthereumAddress()
|
|
66
|
+
await manager.setProxies(streamPartId, [proxy], ProxyDirection.PUBLISH, userId)
|
|
67
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(true)
|
|
68
|
+
await manager.setProxies(streamPartId, [], ProxyDirection.PUBLISH, userId)
|
|
69
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(false)
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('empty node list', async () => {
|
|
73
|
+
const streamPartId = StreamPartIDUtils.parse('stream#0')
|
|
74
|
+
const proxy = createMockPeerDescriptor()
|
|
75
|
+
const userId = randomEthereumAddress()
|
|
76
|
+
await manager.setProxies(streamPartId, [], ProxyDirection.PUBLISH, userId)
|
|
77
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(false)
|
|
78
|
+
await manager.setProxies(streamPartId, [proxy], ProxyDirection.PUBLISH, userId)
|
|
79
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(true)
|
|
80
|
+
await manager.setProxies(streamPartId, [], ProxyDirection.PUBLISH, userId)
|
|
81
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(false)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('connection count to 0', async () => {
|
|
85
|
+
const streamPartId = StreamPartIDUtils.parse('stream#0')
|
|
86
|
+
const proxy = createMockPeerDescriptor()
|
|
87
|
+
const userId = randomEthereumAddress()
|
|
88
|
+
await manager.setProxies(streamPartId, [proxy], ProxyDirection.PUBLISH, userId, 0)
|
|
89
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(false)
|
|
90
|
+
await manager.setProxies(streamPartId, [proxy], ProxyDirection.PUBLISH, userId)
|
|
91
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(true)
|
|
92
|
+
await manager.setProxies(streamPartId, [proxy], ProxyDirection.PUBLISH, userId, 0)
|
|
93
|
+
expect(manager.isProxiedStreamPart(streamPartId)).toBe(false)
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ListeningRpcCommunicator } from '@streamr/dht'
|
|
2
2
|
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
3
3
|
import { randomEthereumAddress } from '@streamr/test-utils'
|
|
4
|
-
import {
|
|
4
|
+
import { ContentDeliveryRpcLocal } from '../../src/logic/ContentDeliveryRpcLocal'
|
|
5
5
|
import { LeaveStreamPartNotice } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc'
|
|
6
6
|
import { MockTransport } from '../utils/mock/Transport'
|
|
7
7
|
import { createMockPeerDescriptor, createStreamMessage } from '../utils/utils'
|
|
8
8
|
|
|
9
|
-
describe('
|
|
9
|
+
describe('ContentDeliveryRpcLocal', () => {
|
|
10
10
|
|
|
11
|
-
let rpcLocal:
|
|
11
|
+
let rpcLocal: ContentDeliveryRpcLocal
|
|
12
12
|
const peerDescriptor = createMockPeerDescriptor()
|
|
13
13
|
|
|
14
14
|
const mockSender = createMockPeerDescriptor()
|
|
@@ -30,7 +30,7 @@ describe('DeliveryRpcLocal', () => {
|
|
|
30
30
|
mockOnLeaveNotice = jest.fn((_m) => {})
|
|
31
31
|
mockMarkForInspection = jest.fn((_m) => {})
|
|
32
32
|
|
|
33
|
-
rpcLocal = new
|
|
33
|
+
rpcLocal = new ContentDeliveryRpcLocal({
|
|
34
34
|
markAndCheckDuplicate: mockDuplicateCheck,
|
|
35
35
|
broadcast: mockBroadcast,
|
|
36
36
|
onLeaveNotice: mockOnLeaveNotice,
|
|
@@ -2,7 +2,7 @@ import { DhtAddress, NodeType, getNodeIdFromPeerDescriptor, getRawFromDhtAddress
|
|
|
2
2
|
import { NodeList } from '../../src/logic/NodeList'
|
|
3
3
|
import { HandshakeRpcLocal } from '../../src/logic/neighbor-discovery/HandshakeRpcLocal'
|
|
4
4
|
import { InterleaveRequest, StreamPartHandshakeRequest } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc'
|
|
5
|
-
import { createMockPeerDescriptor, createMockHandshakeRpcRemote,
|
|
5
|
+
import { createMockPeerDescriptor, createMockHandshakeRpcRemote, createMockContentDeliveryRpcRemote } from '../utils/utils'
|
|
6
6
|
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
7
7
|
|
|
8
8
|
const STREAM_PART_ID = StreamPartIDUtils.parse('stream#0')
|
|
@@ -29,7 +29,7 @@ describe('HandshakeRpcLocal', () => {
|
|
|
29
29
|
ongoingHandshakes,
|
|
30
30
|
ongoingInterleaves,
|
|
31
31
|
createRpcRemote: (_p) => createMockHandshakeRpcRemote(),
|
|
32
|
-
|
|
32
|
+
createContentDeliveryRpcRemote: (_p) => createMockContentDeliveryRpcRemote(),
|
|
33
33
|
handshakeWithInterleaving: async (_p, _t) => {
|
|
34
34
|
handshakeWithInterleaving()
|
|
35
35
|
return true
|
|
@@ -53,10 +53,10 @@ describe('HandshakeRpcLocal', () => {
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
it('handshake interleave', async () => {
|
|
56
|
-
neighbors.add(
|
|
57
|
-
neighbors.add(
|
|
58
|
-
neighbors.add(
|
|
59
|
-
neighbors.add(
|
|
56
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
57
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
58
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
59
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
60
60
|
const req = StreamPartHandshakeRequest.create({
|
|
61
61
|
streamPartId: STREAM_PART_ID,
|
|
62
62
|
requestId: 'requestId'
|
|
@@ -110,10 +110,10 @@ describe('HandshakeRpcLocal', () => {
|
|
|
110
110
|
})
|
|
111
111
|
|
|
112
112
|
it('rejects handshakes if interleaving to the requestor is ongoing', async () => {
|
|
113
|
-
neighbors.add(
|
|
114
|
-
neighbors.add(
|
|
115
|
-
neighbors.add(
|
|
116
|
-
neighbors.add(
|
|
113
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
114
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
115
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
116
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
117
117
|
const requestor = createMockPeerDescriptor()
|
|
118
118
|
ongoingInterleaves.add(getNodeIdFromPeerDescriptor(requestor))
|
|
119
119
|
const req = StreamPartHandshakeRequest.create({
|
|
@@ -130,10 +130,10 @@ describe('HandshakeRpcLocal', () => {
|
|
|
130
130
|
const interleavingPeer1 = createMockPeerDescriptor()
|
|
131
131
|
const interleavingPeer2 = createMockPeerDescriptor()
|
|
132
132
|
const interleavingPeer3 = createMockPeerDescriptor()
|
|
133
|
-
neighbors.add(
|
|
134
|
-
neighbors.add(
|
|
135
|
-
neighbors.add(
|
|
136
|
-
neighbors.add(
|
|
133
|
+
neighbors.add(createMockContentDeliveryRpcRemote(interleavingPeer1))
|
|
134
|
+
neighbors.add(createMockContentDeliveryRpcRemote(interleavingPeer2))
|
|
135
|
+
neighbors.add(createMockContentDeliveryRpcRemote(interleavingPeer3))
|
|
136
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
137
137
|
ongoingInterleaves.add(getNodeIdFromPeerDescriptor(interleavingPeer1))
|
|
138
138
|
ongoingInterleaves.add(getNodeIdFromPeerDescriptor(interleavingPeer2))
|
|
139
139
|
ongoingInterleaves.add(getNodeIdFromPeerDescriptor(interleavingPeer3))
|
|
@@ -149,11 +149,11 @@ describe('HandshakeRpcLocal', () => {
|
|
|
149
149
|
})
|
|
150
150
|
|
|
151
151
|
it('rejects handshakes if the requestor has more than maxNeighborCount neighbors', async () => {
|
|
152
|
-
neighbors.add(
|
|
153
|
-
neighbors.add(
|
|
154
|
-
neighbors.add(
|
|
155
|
-
neighbors.add(
|
|
156
|
-
neighbors.add(
|
|
152
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
153
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
154
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
155
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
156
|
+
neighbors.add(createMockContentDeliveryRpcRemote())
|
|
157
157
|
const req = StreamPartHandshakeRequest.create({
|
|
158
158
|
streamPartId: STREAM_PART_ID,
|
|
159
159
|
requestId: 'requestId'
|
|
@@ -2,7 +2,7 @@ import { ListeningRpcCommunicator, Simulator, SimulatorTransport, getNodeIdFromP
|
|
|
2
2
|
import { range } from 'lodash'
|
|
3
3
|
import { NodeList } from '../../src/logic/NodeList'
|
|
4
4
|
import { Handshaker } from '../../src/logic/neighbor-discovery/Handshaker'
|
|
5
|
-
import { createMockPeerDescriptor,
|
|
5
|
+
import { createMockPeerDescriptor, createMockContentDeliveryRpcRemote } from '../utils/utils'
|
|
6
6
|
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
7
7
|
|
|
8
8
|
describe('Handshaker', () => {
|
|
@@ -61,7 +61,7 @@ describe('Handshaker', () => {
|
|
|
61
61
|
})
|
|
62
62
|
|
|
63
63
|
it('attemptHandshakesOnContact with known nodes that cannot be connected to', async () => {
|
|
64
|
-
range(2).forEach(() => randomNodeView.add(
|
|
64
|
+
range(2).forEach(() => randomNodeView.add(createMockContentDeliveryRpcRemote()))
|
|
65
65
|
const res = await handshaker.attemptHandshakesOnContacts([])
|
|
66
66
|
expect(res.length).toEqual(2)
|
|
67
67
|
})
|
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { createMockContentDeliveryRpcRemote } from '../utils/utils'
|
|
7
7
|
import { DhtAddress, createRandomDhtAddress, getNodeIdFromPeerDescriptor } from '@streamr/dht'
|
|
8
8
|
|
|
9
9
|
describe('NeighborFinder', () => {
|
|
@@ -18,7 +18,7 @@ describe('NeighborFinder', () => {
|
|
|
18
18
|
beforeEach(() => {
|
|
19
19
|
neighbors = new NodeList(nodeId, 15)
|
|
20
20
|
nearbyNodeView = new NodeList(nodeId, 30)
|
|
21
|
-
range(30).forEach(() => nearbyNodeView.add(
|
|
21
|
+
range(30).forEach(() => nearbyNodeView.add(createMockContentDeliveryRpcRemote()))
|
|
22
22
|
const mockDoFindNeighbors = async (excluded: DhtAddress[]) => {
|
|
23
23
|
const target = nearbyNodeView.getRandom(excluded)
|
|
24
24
|
if (Math.random() < 0.5) {
|
|
@@ -5,8 +5,8 @@ import { createMockPeerDescriptor } from '../utils/utils'
|
|
|
5
5
|
import { NodeList } from '../../src/logic/NodeList'
|
|
6
6
|
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
7
7
|
import { MockTransport } from '../utils/mock/Transport'
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { ContentDeliveryRpcClient } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc.client'
|
|
9
|
+
import { ContentDeliveryRpcRemote } from '../../src/logic/ContentDeliveryRpcRemote'
|
|
10
10
|
import { range } from 'lodash'
|
|
11
11
|
|
|
12
12
|
describe('NeighborUpdateRpcLocal', () => {
|
|
@@ -24,11 +24,11 @@ describe('NeighborUpdateRpcLocal', () => {
|
|
|
24
24
|
|
|
25
25
|
const addNeighbors = (count: number) => {
|
|
26
26
|
for (let i = 0; i < count; i++) {
|
|
27
|
-
neighbors.add(new
|
|
27
|
+
neighbors.add(new ContentDeliveryRpcRemote(
|
|
28
28
|
localPeerDescriptor,
|
|
29
29
|
createMockPeerDescriptor(),
|
|
30
30
|
rpcCommunicator,
|
|
31
|
-
|
|
31
|
+
ContentDeliveryRpcClient
|
|
32
32
|
))
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -81,11 +81,11 @@ describe('NeighborUpdateRpcLocal', () => {
|
|
|
81
81
|
|
|
82
82
|
it('does not ask to be removed if caller is a neighbor', async () => {
|
|
83
83
|
const caller = createMockPeerDescriptor()
|
|
84
|
-
const neighbor = new
|
|
84
|
+
const neighbor = new ContentDeliveryRpcRemote(
|
|
85
85
|
localPeerDescriptor,
|
|
86
86
|
caller,
|
|
87
87
|
rpcCommunicator,
|
|
88
|
-
|
|
88
|
+
ContentDeliveryRpcClient
|
|
89
89
|
)
|
|
90
90
|
neighbors.add(neighbor)
|
|
91
91
|
const res = await rpcLocal.neighborUpdate({
|
|
@@ -108,11 +108,11 @@ describe('NeighborUpdateRpcLocal', () => {
|
|
|
108
108
|
|
|
109
109
|
it('asks to be removed if caller is a neighbor and both have too many neighbors', async () => {
|
|
110
110
|
const caller = createMockPeerDescriptor()
|
|
111
|
-
const neighbor = new
|
|
111
|
+
const neighbor = new ContentDeliveryRpcRemote(
|
|
112
112
|
localPeerDescriptor,
|
|
113
113
|
caller,
|
|
114
114
|
rpcCommunicator,
|
|
115
|
-
|
|
115
|
+
ContentDeliveryRpcClient
|
|
116
116
|
)
|
|
117
117
|
neighbors.add(neighbor)
|
|
118
118
|
addNeighbors(neighborTargetCount)
|
|
@@ -3,7 +3,7 @@ import { randomEthereumAddress } from '@streamr/test-utils'
|
|
|
3
3
|
import { EventEmitter } from 'eventemitter3'
|
|
4
4
|
import { NetworkNode } from '../../src/NetworkNode'
|
|
5
5
|
import { NetworkStack } from '../../src/NetworkStack'
|
|
6
|
-
import { Events } from '../../src/logic/
|
|
6
|
+
import { Events } from '../../src/logic/ContentDeliveryManager'
|
|
7
7
|
import { StreamMessage } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc'
|
|
8
8
|
import { createStreamMessage } from '../utils/utils'
|
|
9
9
|
import { StreamMessageTranslator } from '../../src/logic/protocol-integration/stream-message/StreamMessageTranslator'
|
|
@@ -18,9 +18,9 @@ const createMessage = (id: number): StreamMessage => {
|
|
|
18
18
|
describe('NetworkNode', () => {
|
|
19
19
|
|
|
20
20
|
it('message listener', async () => {
|
|
21
|
-
const
|
|
21
|
+
const contentDeliveryManager = new EventEmitter<Events>()
|
|
22
22
|
const stack: Partial<NetworkStack> = {
|
|
23
|
-
|
|
23
|
+
getContentDeliveryManager: () => contentDeliveryManager as any,
|
|
24
24
|
joinStreamPart: async () => {}
|
|
25
25
|
}
|
|
26
26
|
const node = new NetworkNode(stack as any)
|
|
@@ -30,14 +30,14 @@ describe('NetworkNode', () => {
|
|
|
30
30
|
node.addMessageListener(onMessage)
|
|
31
31
|
const msg1 = createMessage(1)
|
|
32
32
|
const msg2 = createMessage(2)
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
contentDeliveryManager.emit('newMessage', msg1)
|
|
34
|
+
contentDeliveryManager.emit('newMessage', msg2)
|
|
35
35
|
expect(onMessage.mock.calls[0][0]).toEqual(StreamMessageTranslator.toClientProtocol(msg1))
|
|
36
36
|
expect(onMessage.mock.calls[1][0]).toEqual(StreamMessageTranslator.toClientProtocol(msg2))
|
|
37
37
|
expect(onMessage).toBeCalledTimes(2)
|
|
38
38
|
|
|
39
39
|
node.removeMessageListener(onMessage)
|
|
40
|
-
|
|
40
|
+
contentDeliveryManager.emit('newMessage', createMessage(3))
|
|
41
41
|
expect(onMessage).toBeCalledTimes(2)
|
|
42
42
|
})
|
|
43
43
|
})
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from '@streamr/dht'
|
|
9
9
|
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
10
10
|
import { expect } from 'expect'
|
|
11
|
-
import {
|
|
11
|
+
import { ContentDeliveryRpcRemote } from '../../src/logic/ContentDeliveryRpcRemote'
|
|
12
12
|
import { NodeList } from '../../src/logic/NodeList'
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { formStreamPartContentDeliveryServiceId } from '../../src/logic/formStreamPartDeliveryServiceId'
|
|
14
|
+
import { ContentDeliveryRpcClient } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc.client'
|
|
15
15
|
import { createMockPeerDescriptor } from '../utils/utils'
|
|
16
16
|
import { MockTransport } from '../utils/mock/Transport'
|
|
17
17
|
|
|
@@ -30,12 +30,12 @@ describe('NodeList', () => {
|
|
|
30
30
|
let nodeList: NodeList
|
|
31
31
|
|
|
32
32
|
const createRemoteGraphNode = (peerDescriptor: PeerDescriptor) => {
|
|
33
|
-
const mockCommunicator = new ListeningRpcCommunicator(
|
|
34
|
-
return new
|
|
33
|
+
const mockCommunicator = new ListeningRpcCommunicator(formStreamPartContentDeliveryServiceId(streamPartId), new MockTransport())
|
|
34
|
+
return new ContentDeliveryRpcRemote(
|
|
35
35
|
createMockPeerDescriptor(),
|
|
36
36
|
peerDescriptor,
|
|
37
37
|
mockCommunicator,
|
|
38
|
-
|
|
38
|
+
ContentDeliveryRpcClient
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -7,7 +7,7 @@ import { MockLayer1Node } from '../utils/mock/MockLayer1Node'
|
|
|
7
7
|
import { MockNeighborFinder } from '../utils/mock/MockNeighborFinder'
|
|
8
8
|
import { MockNeighborUpdateManager } from '../utils/mock/MockNeighborUpdateManager'
|
|
9
9
|
import { MockTransport } from '../utils/mock/Transport'
|
|
10
|
-
import { createMockPeerDescriptor,
|
|
10
|
+
import { createMockPeerDescriptor, createMockContentDeliveryRpcRemote, mockConnectionLocker } from '../utils/utils'
|
|
11
11
|
import { StreamPartIDUtils } from '@streamr/protocol'
|
|
12
12
|
import { getNodeIdFromPeerDescriptor } from '@streamr/dht'
|
|
13
13
|
|
|
@@ -53,14 +53,14 @@ describe('RandomGraphNode', () => {
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
it('getNeighbors', () => {
|
|
56
|
-
const mockRemote =
|
|
56
|
+
const mockRemote = createMockContentDeliveryRpcRemote()
|
|
57
57
|
neighbors.add(mockRemote)
|
|
58
58
|
const result = randomGraphNode.getNeighbors()
|
|
59
59
|
expect(getNodeIdFromPeerDescriptor(result[0])).toEqual(getNodeIdFromPeerDescriptor(mockRemote.getPeerDescriptor()))
|
|
60
60
|
})
|
|
61
61
|
|
|
62
62
|
it('getNearbyNodeView', () => {
|
|
63
|
-
const mockRemote =
|
|
63
|
+
const mockRemote = createMockContentDeliveryRpcRemote()
|
|
64
64
|
nearbyNodeView.add(mockRemote)
|
|
65
65
|
const ids = randomGraphNode.getNearbyNodeView().getIds()
|
|
66
66
|
expect(ids[0]).toEqual(getNodeIdFromPeerDescriptor(mockRemote.getPeerDescriptor()))
|
package/test/utils/utils.ts
CHANGED
|
@@ -17,21 +17,24 @@ import {
|
|
|
17
17
|
SignatureType,
|
|
18
18
|
StreamMessage
|
|
19
19
|
} from '../../src/proto/packages/trackerless-network/protos/NetworkRpc'
|
|
20
|
-
import {
|
|
20
|
+
import { ContentDeliveryRpcRemote } from '../../src/logic/ContentDeliveryRpcRemote'
|
|
21
21
|
import { createRandomGraphNode } from '../../src/logic/createRandomGraphNode'
|
|
22
22
|
import { HandshakeRpcRemote } from '../../src/logic/neighbor-discovery/HandshakeRpcRemote'
|
|
23
23
|
import { NetworkNode, createNetworkNode } from '../../src/NetworkNode'
|
|
24
24
|
import { EthereumAddress, hexToBinary, utf8ToBinary } from '@streamr/utils'
|
|
25
25
|
import { StreamPartID, StreamPartIDUtils } from '@streamr/protocol'
|
|
26
26
|
import { Layer1Node } from '../../src/logic/Layer1Node'
|
|
27
|
-
import {
|
|
27
|
+
import { ContentDeliveryRpcClient, HandshakeRpcClient } from '../../src/proto/packages/trackerless-network/protos/NetworkRpc.client'
|
|
28
28
|
import { RpcCommunicator } from '@streamr/proto-rpc'
|
|
29
29
|
|
|
30
30
|
export const mockConnectionLocker: ConnectionLocker = {
|
|
31
31
|
lockConnection: () => {},
|
|
32
32
|
unlockConnection: () => {},
|
|
33
33
|
weakLockConnection: () => {},
|
|
34
|
-
weakUnlockConnection: () => {}
|
|
34
|
+
weakUnlockConnection: () => {},
|
|
35
|
+
getLocalLockedConnectionCount: () => 0,
|
|
36
|
+
getRemoteLockedConnectionCount: () => 0,
|
|
37
|
+
getWeakLockedConnectionCount: () => 0,
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
export const createMockRandomGraphNodeAndDhtNode = async (
|
|
@@ -101,12 +104,12 @@ export const createMockPeerDescriptor = (opts?: Omit<Partial<PeerDescriptor>, 'n
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
export const
|
|
105
|
-
return new
|
|
107
|
+
export const createMockContentDeliveryRpcRemote = (remotePeerDescriptor?: PeerDescriptor): ContentDeliveryRpcRemote => {
|
|
108
|
+
return new ContentDeliveryRpcRemote(
|
|
106
109
|
createMockPeerDescriptor(),
|
|
107
110
|
remotePeerDescriptor ?? createMockPeerDescriptor(),
|
|
108
111
|
new RpcCommunicator(),
|
|
109
|
-
|
|
112
|
+
ContentDeliveryRpcClient
|
|
110
113
|
)
|
|
111
114
|
}
|
|
112
115
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeliveryRpcLocal.js","sourceRoot":"","sources":["../../../src/logic/DeliveryRpcLocal.ts"],"names":[],"mappings":";;;AAAA,sCAAgI;AAChI,0DAAsD;AAqBtD,MAAa,gBAAgB;IAER,MAAM,CAAwB;IAE/C,YAAY,MAA8B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAsB,EAAE,OAA0B;QACtE,MAAM,YAAY,GAAG,IAAA,iCAA2B,EAAE,OAA0B,CAAC,wBAAyB,CAAC,CAAA;QACvG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,SAAU,CAAC,CAAA;QAC/D,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,SAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACpF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;QAChD,CAAC;QACD,OAAO,aAAK,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,OAA8B,EAAE,OAA0B;QAClF,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YACpD,MAAM,oBAAoB,GAAI,OAA0B,CAAC,wBAAyB,CAAA;YAClF,MAAM,QAAQ,GAAG,IAAA,iCAA2B,EAAC,oBAAoB,CAAC,CAAA;YAClE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;QAC7D,CAAC;QACD,OAAO,aAAK,CAAA;IAChB,CAAC;CACJ;AAzBD,4CAyBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeliveryRpcRemote.js","sourceRoot":"","sources":["../../../src/logic/DeliveryRpcRemote.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,0CAAuC;AAQvC,MAAM,MAAM,GA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