@lodestar/beacon-node 1.18.0-dev.1d3bf0412a → 1.18.0-dev.20bc193da0

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 (92) hide show
  1. package/lib/api/impl/beacon/rewards/index.js +4 -0
  2. package/lib/api/impl/beacon/rewards/index.js.map +1 -1
  3. package/lib/api/impl/validator/index.d.ts +14 -0
  4. package/lib/api/impl/validator/index.js +7 -7
  5. package/lib/api/impl/validator/index.js.map +1 -1
  6. package/lib/api/rest/activeSockets.js +1 -1
  7. package/lib/api/rest/activeSockets.js.map +1 -1
  8. package/lib/chain/blocks/types.d.ts +15 -7
  9. package/lib/chain/blocks/types.js.map +1 -1
  10. package/lib/chain/blocks/verifyBlocksDataAvailability.js +1 -1
  11. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  12. package/lib/chain/bls/multithread/index.js +1 -1
  13. package/lib/chain/bls/multithread/index.js.map +1 -1
  14. package/lib/chain/chain.d.ts +5 -0
  15. package/lib/chain/chain.js +44 -4
  16. package/lib/chain/chain.js.map +1 -1
  17. package/lib/chain/forkChoice/index.d.ts +4 -2
  18. package/lib/chain/forkChoice/index.js +4 -1
  19. package/lib/chain/forkChoice/index.js.map +1 -1
  20. package/lib/chain/interface.d.ts +5 -0
  21. package/lib/chain/interface.js.map +1 -1
  22. package/lib/chain/opPools/attestationPool.js +1 -1
  23. package/lib/chain/opPools/attestationPool.js.map +1 -1
  24. package/lib/chain/options.d.ts +5 -1
  25. package/lib/chain/options.js +6 -0
  26. package/lib/chain/options.js.map +1 -1
  27. package/lib/chain/reprocess.js +1 -1
  28. package/lib/chain/reprocess.js.map +1 -1
  29. package/lib/chain/rewards/attestationsRewards.d.ts +7 -0
  30. package/lib/chain/rewards/attestationsRewards.js +109 -0
  31. package/lib/chain/rewards/attestationsRewards.js.map +1 -0
  32. package/lib/chain/seenCache/seenGossipBlockInput.d.ts +2 -2
  33. package/lib/chain/seenCache/seenGossipBlockInput.js +22 -7
  34. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  35. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +0 -1
  36. package/lib/chain/stateCache/persistentCheckpointsCache.js +4 -6
  37. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  38. package/lib/chain/stateCache/stateContextCheckpointsCache.d.ts +2 -3
  39. package/lib/chain/stateCache/stateContextCheckpointsCache.js +1 -2
  40. package/lib/chain/stateCache/stateContextCheckpointsCache.js.map +1 -1
  41. package/lib/chain/validation/block.js +2 -2
  42. package/lib/chain/validation/block.js.map +1 -1
  43. package/lib/eth1/provider/eth1Provider.js +1 -1
  44. package/lib/eth1/provider/eth1Provider.js.map +1 -1
  45. package/lib/metrics/metrics/lodestar.d.ts +1 -1
  46. package/lib/metrics/metrics/lodestar.js +5 -5
  47. package/lib/metrics/metrics/lodestar.js.map +1 -1
  48. package/lib/monitoring/options.js +3 -3
  49. package/lib/monitoring/options.js.map +1 -1
  50. package/lib/network/core/metrics.d.ts +2 -3
  51. package/lib/network/core/metrics.js.map +1 -1
  52. package/lib/network/core/networkCore.js +1 -4
  53. package/lib/network/core/networkCore.js.map +1 -1
  54. package/lib/network/events.d.ts +2 -2
  55. package/lib/network/gossip/gossipsub.js +2 -2
  56. package/lib/network/gossip/gossipsub.js.map +1 -1
  57. package/lib/network/libp2p/index.js +1 -1
  58. package/lib/network/libp2p/index.js.map +1 -1
  59. package/lib/network/options.js +0 -2
  60. package/lib/network/options.js.map +1 -1
  61. package/lib/network/peers/peerManager.js +1 -1
  62. package/lib/network/peers/peerManager.js.map +1 -1
  63. package/lib/network/processor/gossipHandlers.js +41 -16
  64. package/lib/network/processor/gossipHandlers.js.map +1 -1
  65. package/lib/network/processor/gossipQueues/indexed.d.ts +1 -1
  66. package/lib/network/processor/gossipQueues/indexed.js +1 -1
  67. package/lib/network/processor/index.js +1 -1
  68. package/lib/network/processor/index.js.map +1 -1
  69. package/lib/network/reqresp/beaconBlocksMaybeBlobsByRoot.d.ts +2 -2
  70. package/lib/network/reqresp/beaconBlocksMaybeBlobsByRoot.js +15 -3
  71. package/lib/network/reqresp/beaconBlocksMaybeBlobsByRoot.js.map +1 -1
  72. package/lib/network/reqresp/rateLimit.js +12 -12
  73. package/lib/network/reqresp/rateLimit.js.map +1 -1
  74. package/lib/network/subnets/index.d.ts +0 -1
  75. package/lib/network/subnets/index.js +0 -1
  76. package/lib/network/subnets/index.js.map +1 -1
  77. package/lib/network/subnets/interface.d.ts +0 -1
  78. package/lib/sync/interface.d.ts +16 -12
  79. package/lib/sync/interface.js +1 -0
  80. package/lib/sync/interface.js.map +1 -1
  81. package/lib/sync/unknownBlock.js +63 -60
  82. package/lib/sync/unknownBlock.js.map +1 -1
  83. package/lib/sync/utils/pendingBlocksTree.js +1 -1
  84. package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
  85. package/lib/util/profile.js +4 -1
  86. package/lib/util/profile.js.map +1 -1
  87. package/lib/util/queue/itemQueue.js +1 -1
  88. package/lib/util/queue/itemQueue.js.map +1 -1
  89. package/package.json +16 -17
  90. package/lib/network/subnets/attnetsService.d.ts +0 -118
  91. package/lib/network/subnets/attnetsService.js +0 -325
  92. package/lib/network/subnets/attnetsService.js.map +0 -1
@@ -1,325 +0,0 @@
1
- import { computeStartSlotAtEpoch } from "@lodestar/state-transition";
2
- import { ATTESTATION_SUBNET_COUNT, EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION, RANDOM_SUBNETS_PER_VALIDATOR, SLOTS_PER_EPOCH, } from "@lodestar/params";
3
- import { ssz } from "@lodestar/types";
4
- import { MapDef, randBetween } from "@lodestar/utils";
5
- import { shuffle } from "../../util/shuffle.js";
6
- import { ClockEvent } from "../../util/clock.js";
7
- import { GossipType } from "../gossip/index.js";
8
- import { SubnetMap } from "../peers/utils/index.js";
9
- import { getActiveForks } from "../forks.js";
10
- /**
11
- * The time (in slots) before a last seen validator is considered absent and we unsubscribe from the random
12
- * gossip topics that we subscribed to due to the validator connection.
13
- */
14
- const LAST_SEEN_VALIDATOR_TIMEOUT = 150;
15
- const gossipType = GossipType.beacon_attestation;
16
- export var SubnetSource;
17
- (function (SubnetSource) {
18
- SubnetSource["committee"] = "committee";
19
- SubnetSource["random"] = "random";
20
- })(SubnetSource || (SubnetSource = {}));
21
- /**
22
- * Manage random (long lived) subnets and committee (short lived) subnets.
23
- * - PeerManager uses attnetsService to know which peers are required for duties
24
- * - Network call addCommitteeSubscriptions() from API calls
25
- * - Gossip handler checks shouldProcess to know if validator is aggregator
26
- */
27
- export class AttnetsService {
28
- constructor(config, clock, gossip, metadata, logger, metrics, opts) {
29
- this.config = config;
30
- this.clock = clock;
31
- this.gossip = gossip;
32
- this.metadata = metadata;
33
- this.logger = logger;
34
- this.metrics = metrics;
35
- this.opts = opts;
36
- /** Committee subnets - PeerManager must find peers for those */
37
- this.committeeSubnets = new SubnetMap();
38
- /**
39
- * All currently subscribed short-lived subnets, for attestation aggregation
40
- * This class will tell gossip to subscribe and un-subscribe
41
- * If a value exists for `SubscriptionId` it means that gossip subscription is active in network.gossip
42
- */
43
- this.subscriptionsCommittee = new SubnetMap();
44
- /** Same as `subscriptionsCommittee` but for long-lived subnets. May overlap with `subscriptionsCommittee` */
45
- this.subscriptionsRandom = new SubnetMap();
46
- /**
47
- * Map of an aggregator at a slot and subnet
48
- * Used to determine if we should process an attestation.
49
- */
50
- this.aggregatorSlotSubnet = new MapDef(() => new Set());
51
- /**
52
- * A collection of seen validators. These dictate how many random subnets we should be
53
- * subscribed to. As these time out, we unsubscribe from the required random subnets and update our ENR.
54
- * This is a map of validator index and its last active slot.
55
- */
56
- this.knownValidators = new Map();
57
- /**
58
- * Run per slot.
59
- * - Subscribe to gossip subnets 2 slots in advance
60
- * - Unsubscribe from expired subnets
61
- */
62
- this.onSlot = (clockSlot) => {
63
- try {
64
- for (const [dutiedSlot, subnets] of this.aggregatorSlotSubnet.entries()) {
65
- if (dutiedSlot === clockSlot + this.opts.slotsToSubscribeBeforeAggregatorDuty) {
66
- // Trigger gossip subscription first, in batch
67
- if (subnets.size > 0) {
68
- this.subscribeToSubnets(Array.from(subnets), SubnetSource.committee);
69
- }
70
- // Then, register the subscriptions
71
- Array.from(subnets).map((subnet) => this.subscriptionsCommittee.request({ subnet, toSlot: dutiedSlot }));
72
- }
73
- }
74
- // For node >= 64 validators, we should consistently subscribe to all subnets
75
- // it's important to check random subnets first
76
- // See https://github.com/ChainSafe/lodestar/issues/4929
77
- this.unsubscribeExpiredRandomSubnets(clockSlot);
78
- this.unsubscribeExpiredCommitteeSubnets(clockSlot);
79
- }
80
- catch (e) {
81
- this.logger.error("Error on AttnetsService.onSlot", { slot: clockSlot }, e);
82
- }
83
- };
84
- /**
85
- * Run per epoch, clean-up operations that are not urgent
86
- */
87
- this.onEpoch = (epoch) => {
88
- try {
89
- const slot = computeStartSlotAtEpoch(epoch);
90
- this.pruneExpiredKnownValidators(slot);
91
- this.pruneExpiredAggregator(slot);
92
- }
93
- catch (e) {
94
- this.logger.error("Error on AttnetsService.onEpoch", { epoch }, e);
95
- }
96
- };
97
- // if subscribeAllSubnets, we act like we have >= ATTESTATION_SUBNET_COUNT validators connecting to this node
98
- // so that we have enough subnet topic peers, see https://github.com/ChainSafe/lodestar/issues/4921
99
- if (this.opts.subscribeAllSubnets) {
100
- for (let subnet = 0; subnet < ATTESTATION_SUBNET_COUNT; subnet++) {
101
- this.committeeSubnets.request({ subnet, toSlot: Infinity });
102
- }
103
- }
104
- this.randBetweenFn = this.opts.randBetweenFn ?? randBetween;
105
- this.shuffleFn = this.opts.shuffleFn ?? shuffle;
106
- if (metrics) {
107
- metrics.attnetsService.subscriptionsRandom.addCollect(() => this.onScrapeLodestarMetrics(metrics));
108
- }
109
- this.clock.on(ClockEvent.slot, this.onSlot);
110
- this.clock.on(ClockEvent.epoch, this.onEpoch);
111
- }
112
- close() {
113
- this.clock.off(ClockEvent.slot, this.onSlot);
114
- this.clock.off(ClockEvent.epoch, this.onEpoch);
115
- }
116
- /**
117
- * Get all active subnets for the hearbeat.
118
- */
119
- getActiveSubnets() {
120
- // Omit subscriptionsRandom, not necessary to force the network component to keep peers on that subnets
121
- return this.committeeSubnets.getActiveTtl(this.clock.currentSlot);
122
- }
123
- /**
124
- * Called from the API when validator is a part of a committee.
125
- */
126
- addCommitteeSubscriptions(subscriptions) {
127
- const currentSlot = this.clock.currentSlot;
128
- let addedknownValidators = false;
129
- for (const { validatorIndex, subnet, slot, isAggregator } of subscriptions) {
130
- // Add known validator
131
- if (!this.knownValidators.has(validatorIndex))
132
- addedknownValidators = true;
133
- this.knownValidators.set(validatorIndex, currentSlot);
134
- // the peer-manager heartbeat will help find the subnet
135
- this.committeeSubnets.request({ subnet, toSlot: slot + 1 });
136
- if (isAggregator) {
137
- // need exact slot here
138
- this.aggregatorSlotSubnet.getOrDefault(slot).add(subnet);
139
- }
140
- }
141
- if (addedknownValidators)
142
- this.rebalanceRandomSubnets();
143
- }
144
- /**
145
- * Check if a subscription is still active before handling a gossip object
146
- */
147
- shouldProcess(subnet, slot) {
148
- if (!this.aggregatorSlotSubnet.has(slot)) {
149
- return false;
150
- }
151
- return this.aggregatorSlotSubnet.getOrDefault(slot).has(subnet);
152
- }
153
- /** Call ONLY ONCE: Two epoch before the fork, re-subscribe all existing random subscriptions to the new fork */
154
- subscribeSubnetsToNextFork(nextFork) {
155
- this.logger.info("Subscribing to random attnets to next fork", { nextFork });
156
- for (const subnet of this.subscriptionsRandom.getAll()) {
157
- this.gossip.subscribeTopic({ type: gossipType, fork: nextFork, subnet });
158
- }
159
- }
160
- /** Call ONLY ONCE: Two epochs after the fork, un-subscribe all subnets from the old fork */
161
- unsubscribeSubnetsFromPrevFork(prevFork) {
162
- this.logger.info("Unsubscribing to random attnets from prev fork", { prevFork });
163
- for (let subnet = 0; subnet < ATTESTATION_SUBNET_COUNT; subnet++) {
164
- if (!this.opts.subscribeAllSubnets) {
165
- this.gossip.unsubscribeTopic({ type: gossipType, fork: prevFork, subnet });
166
- }
167
- }
168
- }
169
- /**
170
- * Unsubscribe to a committee subnet from subscribedCommitteeSubnets.
171
- * If a random subnet is present, we do not unsubscribe from it.
172
- */
173
- unsubscribeExpiredCommitteeSubnets(slot) {
174
- const expired = this.subscriptionsCommittee.getExpired(slot);
175
- if (expired.length > 0) {
176
- this.unsubscribeSubnets(expired, slot, SubnetSource.committee);
177
- }
178
- }
179
- /**
180
- * A random subnet has expired.
181
- * This function selects a new subnet to join, or extends the expiry if there are no more
182
- * available subnets to choose from.
183
- */
184
- unsubscribeExpiredRandomSubnets(slot) {
185
- const expired = this.subscriptionsRandom.getExpired(slot);
186
- const currentSlot = this.clock.currentSlot;
187
- if (expired.length === 0) {
188
- return;
189
- }
190
- if (this.knownValidators.size * RANDOM_SUBNETS_PER_VALIDATOR >= ATTESTATION_SUBNET_COUNT) {
191
- // Optimization: If we have to be subcribed to all subnets, no need to unsubscribe. Just extend the timeout
192
- for (const subnet of expired) {
193
- this.subscriptionsRandom.request({ subnet, toSlot: this.randomSubscriptionSlotLen() + currentSlot });
194
- }
195
- return;
196
- }
197
- // Prune subnets and re-subcribe to new ones
198
- this.unsubscribeSubnets(expired, slot, SubnetSource.random);
199
- this.rebalanceRandomSubnets();
200
- }
201
- /**
202
- * A known validator has not sent a subscription in a while. They are considered offline and the
203
- * beacon node no longer needs to be subscribed to the allocated random subnets.
204
- *
205
- * We don't keep track of a specific validator to random subnet, rather the ratio of active
206
- * validators to random subnets. So when a validator goes offline, we can simply remove the
207
- * allocated amount of random subnets.
208
- */
209
- pruneExpiredKnownValidators(currentSlot) {
210
- let deletedKnownValidators = false;
211
- for (const [index, slot] of this.knownValidators.entries()) {
212
- if (currentSlot > slot + LAST_SEEN_VALIDATOR_TIMEOUT) {
213
- const deleted = this.knownValidators.delete(index);
214
- if (deleted)
215
- deletedKnownValidators = true;
216
- }
217
- }
218
- if (deletedKnownValidators)
219
- this.rebalanceRandomSubnets();
220
- }
221
- /**
222
- * No need to track aggregator for past slots.
223
- * @param currentSlot
224
- */
225
- pruneExpiredAggregator(currentSlot) {
226
- for (const slot of this.aggregatorSlotSubnet.keys()) {
227
- if (currentSlot > slot) {
228
- this.aggregatorSlotSubnet.delete(slot);
229
- }
230
- }
231
- }
232
- /**
233
- * Called when we have new validators or expired validators.
234
- * knownValidators should be updated before this function.
235
- */
236
- rebalanceRandomSubnets() {
237
- const slot = this.clock.currentSlot;
238
- // By limiting to ATTESTATION_SUBNET_COUNT, if target is still over subnetDiff equals 0
239
- const targetRandomSubnetCount = Math.min(this.knownValidators.size * RANDOM_SUBNETS_PER_VALIDATOR, ATTESTATION_SUBNET_COUNT);
240
- const subnetDiff = targetRandomSubnetCount - this.subscriptionsRandom.size;
241
- // subscribe to more random subnets
242
- if (subnetDiff > 0) {
243
- const activeSubnets = new Set(this.subscriptionsRandom.getActive(slot));
244
- const allSubnets = Array.from({ length: ATTESTATION_SUBNET_COUNT }, (_, i) => i);
245
- const availableSubnets = allSubnets.filter((subnet) => !activeSubnets.has(subnet));
246
- const subnetsToConnect = this.shuffleFn(availableSubnets).slice(0, subnetDiff);
247
- // Tell gossip to connect to the subnets if not connected already
248
- this.subscribeToSubnets(subnetsToConnect, SubnetSource.random);
249
- // Register these new subnets until some future slot
250
- for (const subnet of subnetsToConnect) {
251
- // the heartbeat will help connect to respective peers
252
- this.subscriptionsRandom.request({ subnet, toSlot: this.randomSubscriptionSlotLen() + slot });
253
- }
254
- }
255
- // unsubscribe some random subnets
256
- if (subnetDiff < 0) {
257
- const activeRandomSubnets = this.subscriptionsRandom.getActive(slot);
258
- // TODO: Do we want to remove the oldest subnets or the newest subnets?
259
- // .slice(-2) will extract the last two items of the array
260
- const toRemoveSubnets = activeRandomSubnets.slice(subnetDiff);
261
- for (const subnet of toRemoveSubnets) {
262
- this.subscriptionsRandom.delete(subnet);
263
- }
264
- this.unsubscribeSubnets(toRemoveSubnets, slot, SubnetSource.random);
265
- }
266
- // If there has been a change update the local ENR bitfield
267
- if (subnetDiff !== 0) {
268
- this.updateMetadata();
269
- }
270
- }
271
- /** Update ENR */
272
- updateMetadata() {
273
- const subnets = ssz.phase0.AttestationSubnets.defaultValue();
274
- for (const subnet of this.subscriptionsRandom.getAll()) {
275
- subnets.set(subnet, true);
276
- }
277
- // Only update metadata if necessary, setting `metadata.[key]` triggers a write to disk
278
- if (!ssz.phase0.AttestationSubnets.equals(subnets, this.metadata.attnets)) {
279
- this.metadata.attnets = subnets;
280
- }
281
- }
282
- /** Tigger a gossip subcription only if not already subscribed */
283
- subscribeToSubnets(subnets, src) {
284
- const forks = getActiveForks(this.config, this.clock.currentEpoch);
285
- for (const subnet of subnets) {
286
- if (!this.subscriptionsCommittee.has(subnet) && !this.subscriptionsRandom.has(subnet)) {
287
- for (const fork of forks) {
288
- this.gossip.subscribeTopic({ type: gossipType, fork, subnet });
289
- }
290
- this.metrics?.attnetsService.subscribeSubnets.inc({ subnet, src });
291
- }
292
- }
293
- }
294
- /** Trigger a gossip un-subscrition only if no-one is still subscribed */
295
- unsubscribeSubnets(subnets, slot, src) {
296
- // No need to unsubscribeTopic(). Return early to prevent repetitive extra work
297
- if (this.opts.subscribeAllSubnets)
298
- return;
299
- const forks = getActiveForks(this.config, this.clock.currentEpoch);
300
- for (const subnet of subnets) {
301
- if (!this.subscriptionsCommittee.isActiveAtSlot(subnet, slot) &&
302
- !this.subscriptionsRandom.isActiveAtSlot(subnet, slot)) {
303
- for (const fork of forks) {
304
- this.gossip.unsubscribeTopic({ type: gossipType, fork, subnet });
305
- }
306
- this.metrics?.attnetsService.unsubscribeSubnets.inc({ subnet, src });
307
- }
308
- }
309
- }
310
- randomSubscriptionSlotLen() {
311
- return (this.randBetweenFn(EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION, 2 * EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION) *
312
- SLOTS_PER_EPOCH);
313
- }
314
- onScrapeLodestarMetrics(metrics) {
315
- metrics.attnetsService.committeeSubnets.set(this.committeeSubnets.size);
316
- metrics.attnetsService.subscriptionsCommittee.set(this.subscriptionsCommittee.size);
317
- metrics.attnetsService.subscriptionsRandom.set(this.subscriptionsRandom.size);
318
- let aggregatorCount = 0;
319
- for (const subnets of this.aggregatorSlotSubnet.values()) {
320
- aggregatorCount += subnets.size;
321
- }
322
- metrics.attnetsService.aggregatorSlotSubnetCount.set(aggregatorCount);
323
- }
324
- }
325
- //# sourceMappingURL=attnetsService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attnetsService.js","sourceRoot":"","sources":["../../../src/network/subnets/attnetsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EACL,wBAAwB,EACxB,qCAAqC,EAErC,4BAA4B,EAC5B,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAc,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAS,MAAM,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAS,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAC,SAAS,EAAkB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAY3C;;;GAGG;AACH,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAExC,MAAM,UAAU,GAAG,UAAU,CAAC,kBAAkB,CAAC;AAEjD,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IA2BzB,YACmB,MAAuB,EACvB,KAAa,EACb,MAAwB,EACxB,QAA4B,EAC5B,MAAc,EACd,OAA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