@lodestar/beacon-node 1.18.0-dev.2d766ca289 → 1.18.0-dev.2dae605a9c
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/lib/api/impl/beacon/blocks/index.js +32 -13
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/blocks/utils.d.ts +1 -0
- package/lib/api/impl/beacon/rewards/index.js +6 -6
- package/lib/api/impl/beacon/rewards/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.js +27 -9
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +2 -1
- package/lib/api/impl/beacon/state/utils.js +15 -13
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js +4 -8
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.js +1 -1
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/chain.d.ts +6 -0
- package/lib/chain/chain.js +25 -13
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/interface.d.ts +6 -0
- package/lib/network/network.js +2 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/aggregatorTracker.d.ts +2 -0
- package/lib/network/processor/aggregatorTracker.js +11 -1
- package/lib/network/processor/aggregatorTracker.js.map +1 -1
- package/package.json +14 -14
|
@@ -6,8 +6,10 @@ type SubnetId = number;
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class AggregatorTracker {
|
|
8
8
|
private subnetAggregatorsBySlot;
|
|
9
|
+
get maxSlotsCached(): number;
|
|
9
10
|
addAggregator(subnet: SubnetId, slot: Slot): void;
|
|
10
11
|
shouldAggregate(subnet: SubnetId, slot: Slot): boolean;
|
|
12
|
+
prune(): void;
|
|
11
13
|
}
|
|
12
14
|
export {};
|
|
13
15
|
//# sourceMappingURL=aggregatorTracker.d.ts.map
|
|
@@ -10,12 +10,22 @@ export class AggregatorTracker {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
this.subnetAggregatorsBySlot = new MapDef(() => new Set());
|
|
12
12
|
}
|
|
13
|
+
get maxSlotsCached() {
|
|
14
|
+
return MAX_SLOTS_CACHED;
|
|
15
|
+
}
|
|
13
16
|
addAggregator(subnet, slot) {
|
|
14
17
|
this.subnetAggregatorsBySlot.getOrDefault(slot).add(subnet);
|
|
15
|
-
pruneSetToMax(this.subnetAggregatorsBySlot, MAX_SLOTS_CACHED);
|
|
16
18
|
}
|
|
17
19
|
shouldAggregate(subnet, slot) {
|
|
18
20
|
return this.subnetAggregatorsBySlot.get(slot)?.has(subnet) === true;
|
|
19
21
|
}
|
|
22
|
+
prune() {
|
|
23
|
+
// We could also `pruneBySlot` as items before current slot are no longer
|
|
24
|
+
// relevant but due to small cache size (64), the best approach is to
|
|
25
|
+
// just prune the cache after a batch of subnet subscriptions is processed.
|
|
26
|
+
pruneSetToMax(this.subnetAggregatorsBySlot, MAX_SLOTS_CACHED,
|
|
27
|
+
// Prune the oldest slots first
|
|
28
|
+
(a, b) => a - b);
|
|
29
|
+
}
|
|
20
30
|
}
|
|
21
31
|
//# sourceMappingURL=aggregatorTracker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregatorTracker.js","sourceRoot":"","sources":["../../../src/network/processor/aggregatorTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAItD,wDAAwD;AACxD,MAAM,gBAAgB,GAAG,eAAe,GAAG,CAAC,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QACU,4BAAuB,GAAG,IAAI,MAAM,CAAsB,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregatorTracker.js","sourceRoot":"","sources":["../../../src/network/processor/aggregatorTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAItD,wDAAwD;AACxD,MAAM,gBAAgB,GAAG,eAAe,GAAG,CAAC,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QACU,4BAAuB,GAAG,IAAI,MAAM,CAAsB,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IAyBrF,CAAC;IAvBC,IAAI,cAAc;QAChB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,aAAa,CAAC,MAAgB,EAAE,IAAU;QACxC,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,eAAe,CAAC,MAAgB,EAAE,IAAU;QAC1C,OAAO,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACtE,CAAC;IAED,KAAK;QACH,yEAAyE;QACzE,qEAAqE;QACrE,2EAA2E;QAC3E,aAAa,CACX,IAAI,CAAC,uBAAuB,EAC5B,gBAAgB;QAChB,+BAA+B;QAC/B,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAChB,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.18.0-dev.
|
|
14
|
+
"version": "1.18.0-dev.2dae605a9c",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -120,18 +120,18 @@
|
|
|
120
120
|
"@libp2p/peer-id-factory": "^4.0.3",
|
|
121
121
|
"@libp2p/prometheus-metrics": "^3.0.10",
|
|
122
122
|
"@libp2p/tcp": "9.0.10",
|
|
123
|
-
"@lodestar/api": "1.18.0-dev.
|
|
124
|
-
"@lodestar/config": "1.18.0-dev.
|
|
125
|
-
"@lodestar/db": "1.18.0-dev.
|
|
126
|
-
"@lodestar/fork-choice": "1.18.0-dev.
|
|
127
|
-
"@lodestar/light-client": "1.18.0-dev.
|
|
128
|
-
"@lodestar/logger": "1.18.0-dev.
|
|
129
|
-
"@lodestar/params": "1.18.0-dev.
|
|
130
|
-
"@lodestar/reqresp": "1.18.0-dev.
|
|
131
|
-
"@lodestar/state-transition": "1.18.0-dev.
|
|
132
|
-
"@lodestar/types": "1.18.0-dev.
|
|
133
|
-
"@lodestar/utils": "1.18.0-dev.
|
|
134
|
-
"@lodestar/validator": "1.18.0-dev.
|
|
123
|
+
"@lodestar/api": "1.18.0-dev.2dae605a9c",
|
|
124
|
+
"@lodestar/config": "1.18.0-dev.2dae605a9c",
|
|
125
|
+
"@lodestar/db": "1.18.0-dev.2dae605a9c",
|
|
126
|
+
"@lodestar/fork-choice": "1.18.0-dev.2dae605a9c",
|
|
127
|
+
"@lodestar/light-client": "1.18.0-dev.2dae605a9c",
|
|
128
|
+
"@lodestar/logger": "1.18.0-dev.2dae605a9c",
|
|
129
|
+
"@lodestar/params": "1.18.0-dev.2dae605a9c",
|
|
130
|
+
"@lodestar/reqresp": "1.18.0-dev.2dae605a9c",
|
|
131
|
+
"@lodestar/state-transition": "1.18.0-dev.2dae605a9c",
|
|
132
|
+
"@lodestar/types": "1.18.0-dev.2dae605a9c",
|
|
133
|
+
"@lodestar/utils": "1.18.0-dev.2dae605a9c",
|
|
134
|
+
"@lodestar/validator": "1.18.0-dev.2dae605a9c",
|
|
135
135
|
"@multiformats/multiaddr": "^12.1.3",
|
|
136
136
|
"c-kzg": "^2.1.2",
|
|
137
137
|
"datastore-core": "^9.1.1",
|
|
@@ -170,5 +170,5 @@
|
|
|
170
170
|
"beacon",
|
|
171
171
|
"blockchain"
|
|
172
172
|
],
|
|
173
|
-
"gitHead": "
|
|
173
|
+
"gitHead": "c47fae9aa0af06b040abcfec2a75ca8b50374101"
|
|
174
174
|
}
|