@lodestar/beacon-node 1.41.0-dev.aeb5a213ee → 1.41.0-dev.bb33751bfd
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/state/index.js +8 -8
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +3 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +4 -4
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +1 -0
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/node/utils.d.ts +1 -1
- package/lib/api/impl/node/utils.d.ts.map +1 -1
- package/lib/api/impl/node/utils.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +3 -5
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +5 -6
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +9 -10
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +3 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +20 -2
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +47 -0
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -1
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +3 -0
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +4 -0
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +5 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +3 -3
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +5 -5
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/jobItem.d.ts +2 -2
- package/lib/chain/bls/multithread/jobItem.d.ts.map +1 -1
- package/lib/chain/bls/multithread/jobItem.js +2 -2
- package/lib/chain/bls/multithread/jobItem.js.map +1 -1
- package/lib/chain/bls/singleThread.d.ts +4 -4
- package/lib/chain/bls/singleThread.d.ts.map +1 -1
- package/lib/chain/bls/singleThread.js +4 -4
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.d.ts +2 -2
- package/lib/chain/bls/utils.d.ts.map +1 -1
- package/lib/chain/bls/utils.js +7 -4
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +4 -7
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +8 -10
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -4
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +15 -7
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +4 -1
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +1 -1
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +8 -1
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
- package/lib/db/repositories/blockArchive.d.ts.map +1 -1
- package/lib/db/repositories/blockArchive.js +1 -2
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/execution/engine/http.d.ts +1 -0
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +3 -0
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +3 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +5 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/monitoring/service.d.ts +2 -2
- package/lib/monitoring/service.d.ts.map +1 -1
- package/lib/monitoring/service.js +3 -2
- package/lib/monitoring/service.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +3 -3
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +3 -3
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/types.d.ts +2 -2
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/events.d.ts +2 -1
- package/lib/network/events.d.ts.map +1 -1
- package/lib/network/events.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts +3 -3
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +13 -4
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +47 -20
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +3 -3
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts +1 -1
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.js +1 -1
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/interface.d.ts +3 -3
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +7 -2
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +2 -2
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +3 -0
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/datastore.d.ts +7 -5
- package/lib/network/peers/datastore.d.ts.map +1 -1
- package/lib/network/peers/datastore.js +10 -10
- package/lib/network/peers/datastore.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +3 -0
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +103 -53
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +3 -3
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +3 -1
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +1 -1
- package/lib/network/processor/types.d.ts +1 -1
- package/lib/network/processor/types.d.ts.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +0 -1
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/util.js +2 -2
- package/lib/network/util.js.map +1 -1
- package/lib/node/nodejs.d.ts +3 -5
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +6 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/util/clock.d.ts +6 -0
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +9 -3
- package/lib/util/clock.js.map +1 -1
- package/package.json +38 -41
- package/src/api/impl/beacon/state/index.ts +8 -8
- package/src/api/impl/beacon/state/utils.ts +5 -6
- package/src/api/impl/debug/index.ts +1 -0
- package/src/api/impl/node/utils.ts +3 -3
- package/src/api/impl/validator/index.ts +3 -4
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -11
- package/src/chain/archiveStore/historicalState/worker.ts +3 -3
- package/src/chain/blocks/blockInput/blockInput.ts +68 -3
- package/src/chain/blocks/blockInput/types.ts +1 -0
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +3 -0
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -2
- package/src/chain/bls/multithread/index.ts +7 -7
- package/src/chain/bls/multithread/jobItem.ts +3 -3
- package/src/chain/bls/singleThread.ts +5 -5
- package/src/chain/bls/utils.ts +8 -5
- package/src/chain/chain.ts +10 -15
- package/src/chain/interface.ts +2 -9
- package/src/chain/seenCache/seenGossipBlockInput.ts +16 -7
- package/src/chain/validation/attestation.ts +4 -1
- package/src/chain/validation/attesterSlashing.ts +1 -1
- package/src/chain/validation/payloadAttestationMessage.ts +9 -1
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +1 -1
- package/src/db/repositories/blockArchive.ts +1 -2
- package/src/execution/engine/http.ts +3 -0
- package/src/metrics/metrics/lodestar.ts +5 -0
- package/src/monitoring/service.ts +3 -2
- package/src/network/core/networkCore.ts +3 -3
- package/src/network/core/networkCoreWorkerHandler.ts +3 -3
- package/src/network/core/types.ts +2 -2
- package/src/network/events.ts +2 -1
- package/src/network/gossip/encoding.ts +3 -3
- package/src/network/gossip/gossipsub.ts +86 -25
- package/src/network/gossip/interface.ts +3 -3
- package/src/network/gossip/scoringParameters.ts +4 -4
- package/src/network/interface.ts +3 -3
- package/src/network/libp2p/index.ts +8 -3
- package/src/network/network.ts +3 -3
- package/src/network/options.ts +3 -0
- package/src/network/peers/datastore.ts +13 -10
- package/src/network/peers/peerManager.ts +118 -54
- package/src/network/peers/utils/prioritizePeers.ts +3 -3
- package/src/network/processor/gossipHandlers.ts +7 -3
- package/src/network/processor/gossipValidatorFn.ts +1 -1
- package/src/network/processor/types.ts +1 -1
- package/src/network/reqresp/score.ts +0 -1
- package/src/network/util.ts +2 -2
- package/src/node/nodejs.ts +8 -9
- package/src/util/clock.ts +9 -4
- package/src/util/workerEvents.ts +1 -1
package/lib/util/clock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/util/clock.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAEjG,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAN,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB;;;OAGG;IACH,iCAAmB,CAAA;IACnB;;;OAGG;IACH,mCAAqB,CAAA;AACvB,CAAC,EAXW,UAAU,KAAV,UAAU,QAWrB;AA+CD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,YAAY;IAC5B,WAAW,CAAS;IACZ,MAAM,CAAkB;IACjC,SAAS,CAA0B;IAC1B,MAAM,CAAc;IAC7B,YAAY,CAAS;IAE7B,YAAY,EAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAsE;QAC5G,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,GA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AAG,mBAAmB,CAAC,CAAC;IAC1E,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.41.0-dev.
|
|
14
|
+
"version": "1.41.0-dev.bb33751bfd",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -110,10 +110,9 @@
|
|
|
110
110
|
"dependencies": {
|
|
111
111
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
112
112
|
"@chainsafe/blst": "^2.2.0",
|
|
113
|
-
"@chainsafe/discv5": "^
|
|
114
|
-
"@chainsafe/enr": "^
|
|
115
|
-
"@chainsafe/libp2p-
|
|
116
|
-
"@chainsafe/libp2p-noise": "^16.1.5",
|
|
113
|
+
"@chainsafe/discv5": "^12.0.0",
|
|
114
|
+
"@chainsafe/enr": "^6.0.0",
|
|
115
|
+
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
117
116
|
"@chainsafe/persistent-merkle-tree": "^1.2.1",
|
|
118
117
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
119
118
|
"@chainsafe/pubkey-index-map": "^3.0.0",
|
|
@@ -125,39 +124,38 @@
|
|
|
125
124
|
"@fastify/cors": "^10.0.1",
|
|
126
125
|
"@fastify/swagger": "^9.0.0",
|
|
127
126
|
"@fastify/swagger-ui": "^5.0.1",
|
|
128
|
-
"@libp2p/bootstrap": "^
|
|
129
|
-
"@libp2p/crypto": "^5.
|
|
130
|
-
"@libp2p/
|
|
131
|
-
"@libp2p/
|
|
132
|
-
"@libp2p/
|
|
133
|
-
"@libp2p/
|
|
134
|
-
"@libp2p/
|
|
135
|
-
"@libp2p/
|
|
136
|
-
"@libp2p/
|
|
137
|
-
"@
|
|
138
|
-
"@lodestar/
|
|
139
|
-
"@lodestar/
|
|
140
|
-
"@lodestar/
|
|
141
|
-
"@lodestar/
|
|
142
|
-
"@lodestar/
|
|
143
|
-
"@lodestar/
|
|
144
|
-
"@lodestar/
|
|
145
|
-
"@lodestar/
|
|
146
|
-
"@lodestar/
|
|
147
|
-
"@lodestar/
|
|
148
|
-
"@lodestar/
|
|
149
|
-
"@
|
|
150
|
-
"
|
|
151
|
-
"datastore-
|
|
152
|
-
"datastore-
|
|
127
|
+
"@libp2p/bootstrap": "^12.0.12",
|
|
128
|
+
"@libp2p/crypto": "^5.1.13",
|
|
129
|
+
"@libp2p/gossipsub": "^15.0.13",
|
|
130
|
+
"@libp2p/identify": "^4.0.11",
|
|
131
|
+
"@libp2p/interface": "^3.1.0",
|
|
132
|
+
"@libp2p/mdns": "^12.0.12",
|
|
133
|
+
"@libp2p/mplex": "^12.0.12",
|
|
134
|
+
"@libp2p/peer-id": "^6.0.4",
|
|
135
|
+
"@libp2p/prometheus-metrics": "^5.0.11",
|
|
136
|
+
"@libp2p/tcp": "^11.0.11",
|
|
137
|
+
"@lodestar/api": "^1.41.0-dev.bb33751bfd",
|
|
138
|
+
"@lodestar/config": "^1.41.0-dev.bb33751bfd",
|
|
139
|
+
"@lodestar/db": "^1.41.0-dev.bb33751bfd",
|
|
140
|
+
"@lodestar/fork-choice": "^1.41.0-dev.bb33751bfd",
|
|
141
|
+
"@lodestar/light-client": "^1.41.0-dev.bb33751bfd",
|
|
142
|
+
"@lodestar/logger": "^1.41.0-dev.bb33751bfd",
|
|
143
|
+
"@lodestar/params": "^1.41.0-dev.bb33751bfd",
|
|
144
|
+
"@lodestar/reqresp": "^1.41.0-dev.bb33751bfd",
|
|
145
|
+
"@lodestar/state-transition": "^1.41.0-dev.bb33751bfd",
|
|
146
|
+
"@lodestar/types": "^1.41.0-dev.bb33751bfd",
|
|
147
|
+
"@lodestar/utils": "^1.41.0-dev.bb33751bfd",
|
|
148
|
+
"@lodestar/validator": "^1.41.0-dev.bb33751bfd",
|
|
149
|
+
"@multiformats/multiaddr": "^13.0.1",
|
|
150
|
+
"datastore-core": "^11.0.2",
|
|
151
|
+
"datastore-fs": "^11.0.2",
|
|
152
|
+
"datastore-level": "^12.0.2",
|
|
153
153
|
"deepmerge": "^4.3.1",
|
|
154
154
|
"fastify": "^5.7.4",
|
|
155
|
-
"interface-datastore": "^
|
|
156
|
-
"it-all": "^3.0.4",
|
|
157
|
-
"it-pipe": "^3.0.1",
|
|
155
|
+
"interface-datastore": "^9.0.2",
|
|
158
156
|
"jwt-simple": "0.5.6",
|
|
159
|
-
"libp2p": "
|
|
160
|
-
"multiformats": "^
|
|
157
|
+
"libp2p": "3.1.4",
|
|
158
|
+
"multiformats": "^13.4.2",
|
|
161
159
|
"prom-client": "^15.1.0",
|
|
162
160
|
"qs": "^6.11.1",
|
|
163
161
|
"strict-event-emitter-types": "^2.0.0",
|
|
@@ -167,14 +165,13 @@
|
|
|
167
165
|
},
|
|
168
166
|
"devDependencies": {
|
|
169
167
|
"@chainsafe/swap-or-not-shuffle": "^1.2.1",
|
|
170
|
-
"@libp2p/interface-internal": "^
|
|
171
|
-
"@libp2p/logger": "^
|
|
172
|
-
"@
|
|
168
|
+
"@libp2p/interface-internal": "^3.0.11",
|
|
169
|
+
"@libp2p/logger": "^6.2.2",
|
|
170
|
+
"@libp2p/utils": "^7.0.11",
|
|
171
|
+
"@lodestar/spec-test-util": "^1.41.0-dev.bb33751bfd",
|
|
173
172
|
"@types/js-yaml": "^4.0.5",
|
|
174
173
|
"@types/qs": "^6.9.7",
|
|
175
174
|
"@types/tmp": "^0.2.3",
|
|
176
|
-
"it-drain": "^3.0.3",
|
|
177
|
-
"it-pair": "^2.0.6",
|
|
178
175
|
"js-yaml": "^4.1.0",
|
|
179
176
|
"rewiremock": "^3.14.5",
|
|
180
177
|
"rimraf": "^4.4.1",
|
|
@@ -188,5 +185,5 @@
|
|
|
188
185
|
"beacon",
|
|
189
186
|
"blockchain"
|
|
190
187
|
],
|
|
191
|
-
"gitHead": "
|
|
188
|
+
"gitHead": "2c9a0cd74a616638db49f1c60be741ef758e7647"
|
|
192
189
|
}
|
|
@@ -95,14 +95,14 @@ export function getBeaconStateApi({
|
|
|
95
95
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
96
96
|
const currentEpoch = getCurrentEpoch(state);
|
|
97
97
|
const {validators, balances} = state; // Get the validators sub tree once for all the loop
|
|
98
|
-
const {
|
|
98
|
+
const {pubkeyCache} = chain;
|
|
99
99
|
|
|
100
100
|
const validatorResponses: routes.beacon.ValidatorResponse[] = [];
|
|
101
101
|
if (validatorIds.length) {
|
|
102
102
|
assertUniqueItems(validatorIds, "Duplicate validator IDs provided");
|
|
103
103
|
|
|
104
104
|
for (const id of validatorIds) {
|
|
105
|
-
const resp = getStateValidatorIndex(id, state,
|
|
105
|
+
const resp = getStateValidatorIndex(id, state, pubkeyCache);
|
|
106
106
|
if (resp.valid) {
|
|
107
107
|
const validatorIndex = resp.validatorIndex;
|
|
108
108
|
const validator = validators.getReadonly(validatorIndex);
|
|
@@ -127,7 +127,7 @@ export function getBeaconStateApi({
|
|
|
127
127
|
if (statuses.length) {
|
|
128
128
|
assertUniqueItems(statuses, "Duplicate statuses provided");
|
|
129
129
|
|
|
130
|
-
const validatorsByStatus = filterStateValidatorsByStatus(statuses, state,
|
|
130
|
+
const validatorsByStatus = filterStateValidatorsByStatus(statuses, state, pubkeyCache, currentEpoch);
|
|
131
131
|
return {
|
|
132
132
|
data: validatorsByStatus,
|
|
133
133
|
meta: {executionOptimistic, finalized},
|
|
@@ -154,7 +154,7 @@ export function getBeaconStateApi({
|
|
|
154
154
|
|
|
155
155
|
async postStateValidatorIdentities({stateId, validatorIds = []}) {
|
|
156
156
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
157
|
-
const {
|
|
157
|
+
const {pubkeyCache} = chain;
|
|
158
158
|
|
|
159
159
|
let validatorIdentities: routes.beacon.ValidatorIdentities;
|
|
160
160
|
|
|
@@ -163,7 +163,7 @@ export function getBeaconStateApi({
|
|
|
163
163
|
|
|
164
164
|
validatorIdentities = [];
|
|
165
165
|
for (const id of validatorIds) {
|
|
166
|
-
const resp = getStateValidatorIndex(id, state,
|
|
166
|
+
const resp = getStateValidatorIndex(id, state, pubkeyCache);
|
|
167
167
|
if (resp.valid) {
|
|
168
168
|
const index = resp.validatorIndex;
|
|
169
169
|
const {pubkey, activationEpoch} = state.validators.getReadonly(index);
|
|
@@ -187,9 +187,9 @@ export function getBeaconStateApi({
|
|
|
187
187
|
|
|
188
188
|
async getStateValidator({stateId, validatorId}) {
|
|
189
189
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
190
|
-
const {
|
|
190
|
+
const {pubkeyCache} = chain;
|
|
191
191
|
|
|
192
|
-
const resp = getStateValidatorIndex(validatorId, state,
|
|
192
|
+
const resp = getStateValidatorIndex(validatorId, state, pubkeyCache);
|
|
193
193
|
if (!resp.valid) {
|
|
194
194
|
throw new ApiError(resp.code, resp.reason);
|
|
195
195
|
}
|
|
@@ -214,7 +214,7 @@ export function getBeaconStateApi({
|
|
|
214
214
|
|
|
215
215
|
const balances: routes.beacon.ValidatorBalance[] = [];
|
|
216
216
|
for (const id of validatorIds) {
|
|
217
|
-
const resp = getStateValidatorIndex(id, state, chain.
|
|
217
|
+
const resp = getStateValidatorIndex(id, state, chain.pubkeyCache);
|
|
218
218
|
|
|
219
219
|
if (resp.valid) {
|
|
220
220
|
balances.push({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
2
1
|
import {routes} from "@lodestar/api";
|
|
3
2
|
import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
|
|
4
3
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
5
|
-
import {BeaconStateAllForks, CachedBeaconStateAllForks} from "@lodestar/state-transition";
|
|
4
|
+
import {BeaconStateAllForks, CachedBeaconStateAllForks, PubkeyCache} from "@lodestar/state-transition";
|
|
6
5
|
import {
|
|
7
6
|
BLSPubkey,
|
|
8
7
|
Epoch,
|
|
@@ -91,7 +90,7 @@ export function toValidatorResponse(
|
|
|
91
90
|
export function filterStateValidatorsByStatus(
|
|
92
91
|
statuses: string[],
|
|
93
92
|
state: BeaconStateAllForks,
|
|
94
|
-
|
|
93
|
+
pubkeyCache: PubkeyCache,
|
|
95
94
|
currentEpoch: Epoch
|
|
96
95
|
): routes.beacon.ValidatorResponse[] {
|
|
97
96
|
const responses: routes.beacon.ValidatorResponse[] = [];
|
|
@@ -102,7 +101,7 @@ export function filterStateValidatorsByStatus(
|
|
|
102
101
|
const validatorStatus = getValidatorStatus(validator, currentEpoch);
|
|
103
102
|
const generalStatus = mapToGeneralStatus(validatorStatus);
|
|
104
103
|
|
|
105
|
-
const resp = getStateValidatorIndex(validator.pubkey, state,
|
|
104
|
+
const resp = getStateValidatorIndex(validator.pubkey, state, pubkeyCache);
|
|
106
105
|
if (resp.valid && (statusSet.has(validatorStatus) || statusSet.has(generalStatus))) {
|
|
107
106
|
responses.push(
|
|
108
107
|
toValidatorResponse(resp.validatorIndex, validator, state.balances.get(resp.validatorIndex), currentEpoch)
|
|
@@ -119,7 +118,7 @@ type StateValidatorIndexResponse =
|
|
|
119
118
|
export function getStateValidatorIndex(
|
|
120
119
|
id: routes.beacon.ValidatorId | BLSPubkey,
|
|
121
120
|
state: BeaconStateAllForks,
|
|
122
|
-
|
|
121
|
+
pubkeyCache: PubkeyCache
|
|
123
122
|
): StateValidatorIndexResponse {
|
|
124
123
|
if (typeof id === "string") {
|
|
125
124
|
// mutate `id` and fallthrough to below
|
|
@@ -147,7 +146,7 @@ export function getStateValidatorIndex(
|
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
// typeof id === Uint8Array
|
|
150
|
-
const validatorIndex =
|
|
149
|
+
const validatorIndex = pubkeyCache.getIndex(id);
|
|
151
150
|
if (validatorIndex === null) {
|
|
152
151
|
return {valid: false, code: 404, reason: "Validator pubkey not found in state"};
|
|
153
152
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Connection,
|
|
1
|
+
import type {Connection, ConnectionStatus} from "@libp2p/interface";
|
|
2
2
|
import {routes} from "@lodestar/api";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -24,7 +24,7 @@ export function formatNodePeer(peerIdStr: string, connections: Connection[]): ro
|
|
|
24
24
|
* - Otherwise, the first closed connection
|
|
25
25
|
*/
|
|
26
26
|
export function getRelevantConnection(connections: Connection[]): Connection | null {
|
|
27
|
-
const byStatus = new Map<
|
|
27
|
+
const byStatus = new Map<ConnectionStatus, Connection>();
|
|
28
28
|
for (const conn of connections) {
|
|
29
29
|
if (conn.status === "open") return conn;
|
|
30
30
|
if (!byStatus.has(conn.status)) byStatus.set(conn.status, conn);
|
|
@@ -37,7 +37,7 @@ export function getRelevantConnection(connections: Connection[]): Connection | n
|
|
|
37
37
|
* Map libp2p connection status to the API's peer state notation
|
|
38
38
|
* @param status
|
|
39
39
|
*/
|
|
40
|
-
function getPeerState(status:
|
|
40
|
+
function getPeerState(status: ConnectionStatus): routes.node.PeerState {
|
|
41
41
|
switch (status) {
|
|
42
42
|
case "open":
|
|
43
43
|
return "connected";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
2
1
|
import {routes} from "@lodestar/api";
|
|
3
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
4
3
|
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
@@ -27,6 +26,7 @@ import {
|
|
|
27
26
|
computeStartSlotAtEpoch,
|
|
28
27
|
computeTimeAtSlot,
|
|
29
28
|
createCachedBeaconState,
|
|
29
|
+
createPubkeyCache,
|
|
30
30
|
getBlockRootAtSlot,
|
|
31
31
|
getCurrentSlot,
|
|
32
32
|
loadState,
|
|
@@ -1123,8 +1123,7 @@ export function getValidatorApi(
|
|
|
1123
1123
|
{
|
|
1124
1124
|
config: chain.config,
|
|
1125
1125
|
// Not required to compute proposers
|
|
1126
|
-
|
|
1127
|
-
index2pubkey: [],
|
|
1126
|
+
pubkeyCache: createPubkeyCache(),
|
|
1128
1127
|
},
|
|
1129
1128
|
{skipSyncPubkeys: true, skipSyncCommitteeCache: true}
|
|
1130
1129
|
);
|
|
@@ -1585,7 +1584,7 @@ export function getValidatorApi(
|
|
|
1585
1584
|
|
|
1586
1585
|
const filteredRegistrations = registrations.filter((registration) => {
|
|
1587
1586
|
const {pubkey} = registration.message;
|
|
1588
|
-
const validatorIndex = chain.
|
|
1587
|
+
const validatorIndex = chain.pubkeyCache.getIndex(pubkey);
|
|
1589
1588
|
if (validatorIndex === null) return false;
|
|
1590
1589
|
|
|
1591
1590
|
const validator = headState.validators.getReadonly(validatorIndex);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
2
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
3
2
|
import {
|
|
4
3
|
BeaconStateAllForks,
|
|
5
4
|
CachedBeaconStateAllForks,
|
|
6
5
|
DataAvailabilityStatus,
|
|
7
6
|
ExecutionPayloadStatus,
|
|
7
|
+
PubkeyCache,
|
|
8
8
|
createCachedBeaconState,
|
|
9
9
|
stateTransition,
|
|
10
10
|
} from "@lodestar/state-transition";
|
|
@@ -15,16 +15,16 @@ import {HistoricalStateRegenMetrics} from "./metrics.js";
|
|
|
15
15
|
import {RegenErrorType} from "./types.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Populate a
|
|
18
|
+
* Populate a PubkeyCache with any new entries based on a BeaconState
|
|
19
19
|
*/
|
|
20
|
-
export function syncPubkeyCache(state: BeaconStateAllForks,
|
|
20
|
+
export function syncPubkeyCache(state: BeaconStateAllForks, pubkeyCache: PubkeyCache): void {
|
|
21
21
|
// Get the validators sub tree once for all the loop
|
|
22
22
|
const validators = state.validators;
|
|
23
23
|
|
|
24
24
|
const newCount = state.validators.length;
|
|
25
|
-
for (let i =
|
|
25
|
+
for (let i = pubkeyCache.size; i < newCount; i++) {
|
|
26
26
|
const pubkey = validators.getReadonly(i).pubkey;
|
|
27
|
-
|
|
27
|
+
pubkeyCache.set(i, pubkey);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -35,7 +35,7 @@ export async function getNearestState(
|
|
|
35
35
|
slot: number,
|
|
36
36
|
config: BeaconConfig,
|
|
37
37
|
db: IBeaconDb,
|
|
38
|
-
|
|
38
|
+
pubkeyCache: PubkeyCache
|
|
39
39
|
): Promise<CachedBeaconStateAllForks> {
|
|
40
40
|
const stateBytesArr = await db.stateArchive.binaries({limit: 1, lte: slot, reverse: true});
|
|
41
41
|
if (!stateBytesArr.length) {
|
|
@@ -44,14 +44,13 @@ export async function getNearestState(
|
|
|
44
44
|
|
|
45
45
|
const stateBytes = stateBytesArr[0];
|
|
46
46
|
const state = getStateTypeFromBytes(config, stateBytes).deserializeToViewDU(stateBytes);
|
|
47
|
-
syncPubkeyCache(state,
|
|
47
|
+
syncPubkeyCache(state, pubkeyCache);
|
|
48
48
|
|
|
49
49
|
return createCachedBeaconState(
|
|
50
50
|
state,
|
|
51
51
|
{
|
|
52
52
|
config,
|
|
53
|
-
|
|
54
|
-
index2pubkey: [],
|
|
53
|
+
pubkeyCache,
|
|
55
54
|
},
|
|
56
55
|
{
|
|
57
56
|
skipSyncPubkeys: true,
|
|
@@ -66,13 +65,13 @@ export async function getHistoricalState(
|
|
|
66
65
|
slot: number,
|
|
67
66
|
config: BeaconConfig,
|
|
68
67
|
db: IBeaconDb,
|
|
69
|
-
|
|
68
|
+
pubkeyCache: PubkeyCache,
|
|
70
69
|
metrics?: HistoricalStateRegenMetrics
|
|
71
70
|
): Promise<Uint8Array> {
|
|
72
71
|
const regenTimer = metrics?.regenTime.startTimer();
|
|
73
72
|
|
|
74
73
|
const loadStateTimer = metrics?.loadStateTime.startTimer();
|
|
75
|
-
let state = await getNearestState(slot, config, db,
|
|
74
|
+
let state = await getNearestState(slot, config, db, pubkeyCache).catch((e) => {
|
|
76
75
|
metrics?.regenErrorCount.inc({reason: RegenErrorType.loadState});
|
|
77
76
|
throw e;
|
|
78
77
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import worker from "node:worker_threads";
|
|
2
|
-
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
3
2
|
import {Transfer, expose} from "@chainsafe/threads/worker";
|
|
4
3
|
import {chainConfigFromJson, createBeaconConfig} from "@lodestar/config";
|
|
5
4
|
import {LevelDbController} from "@lodestar/db/controller/level";
|
|
6
5
|
import {getNodeLogger} from "@lodestar/logger/node";
|
|
6
|
+
import {createPubkeyCache} from "@lodestar/state-transition";
|
|
7
7
|
import {BeaconDb} from "../../../db/index.js";
|
|
8
8
|
import {RegistryMetricCreator, collectNodeJSMetrics} from "../../../metrics/index.js";
|
|
9
9
|
import {JobFnQueue} from "../../../util/queue/fnQueue.js";
|
|
@@ -52,7 +52,7 @@ const queue = new JobFnQueue(
|
|
|
52
52
|
queueMetrics
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
const
|
|
55
|
+
const pubkeyCache = createPubkeyCache();
|
|
56
56
|
|
|
57
57
|
const api: HistoricalStateWorkerApi = {
|
|
58
58
|
async close() {
|
|
@@ -65,7 +65,7 @@ const api: HistoricalStateWorkerApi = {
|
|
|
65
65
|
historicalStateRegenMetrics?.regenRequestCount.inc();
|
|
66
66
|
|
|
67
67
|
const stateBytes = await queue.push<Uint8Array>(() =>
|
|
68
|
-
getHistoricalState(slot, config, db,
|
|
68
|
+
getHistoricalState(slot, config, db, pubkeyCache, historicalStateRegenMetrics)
|
|
69
69
|
);
|
|
70
70
|
const result = Transfer(stateBytes, [stateBytes.buffer]) as unknown as Uint8Array;
|
|
71
71
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {ForkName, ForkPostFulu, ForkPreDeneb, ForkPreGloas, NUMBER_OF_COLUMNS} from "@lodestar/params";
|
|
2
|
-
import {BeaconBlockBody, BlobIndex, ColumnIndex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
1
|
+
import {ForkName, ForkPostFulu, ForkPostGloas, ForkPreDeneb, ForkPreGloas, NUMBER_OF_COLUMNS} from "@lodestar/params";
|
|
2
|
+
import {BeaconBlockBody, BlobIndex, ColumnIndex, SignedBeaconBlock, Slot, deneb, fulu, gloas} from "@lodestar/types";
|
|
3
3
|
import {byteArrayEquals, fromHex, prettyBytes, toRootHex, withTimeout} from "@lodestar/utils";
|
|
4
4
|
import {VersionedHashes} from "../../../execution/index.js";
|
|
5
5
|
import {kzgCommitmentToVersionedHash} from "../../../util/blobs.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
SourceMeta,
|
|
25
25
|
} from "./types.js";
|
|
26
26
|
|
|
27
|
-
export type BlockInput = BlockInputPreData | BlockInputBlobs | BlockInputColumns;
|
|
27
|
+
export type BlockInput = BlockInputPreData | BlockInputBlobs | BlockInputColumns | BlockInputNoData;
|
|
28
28
|
|
|
29
29
|
export function isBlockInputPreDeneb(blockInput: IBlockInput): blockInput is BlockInputPreData {
|
|
30
30
|
return blockInput.type === DAType.PreData;
|
|
@@ -37,6 +37,10 @@ export function isBlockInputColumns(blockInput: IBlockInput): blockInput is Bloc
|
|
|
37
37
|
return blockInput.type === DAType.Columns;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export function isBlockInputNoData(blockInput: IBlockInput): blockInput is BlockInputNoData {
|
|
41
|
+
return blockInput.type === DAType.NoData;
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
function createPromise<T>(): PromiseParts<T> {
|
|
41
45
|
let resolve!: (value: T) => void;
|
|
42
46
|
let reject!: (e: Error) => void;
|
|
@@ -903,3 +907,64 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
|
|
|
903
907
|
return Promise.resolve(this.getSampledColumns());
|
|
904
908
|
}
|
|
905
909
|
}
|
|
910
|
+
|
|
911
|
+
type BlockInputNoDataState = {
|
|
912
|
+
hasBlock: true;
|
|
913
|
+
hasAllData: true;
|
|
914
|
+
block: SignedBeaconBlock<ForkPostGloas>;
|
|
915
|
+
source: SourceMeta;
|
|
916
|
+
timeCompleteSec: number;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
export class BlockInputNoData extends AbstractBlockInput<ForkPostGloas, null> {
|
|
920
|
+
type = DAType.NoData as const;
|
|
921
|
+
|
|
922
|
+
state: BlockInputNoDataState;
|
|
923
|
+
|
|
924
|
+
private constructor(init: BlockInputInit, state: BlockInputNoDataState) {
|
|
925
|
+
super(init);
|
|
926
|
+
this.state = state;
|
|
927
|
+
this.dataPromise.resolve(null);
|
|
928
|
+
this.blockPromise.resolve(state.block);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
static createFromBlock(props: AddBlock<ForkPostGloas> & CreateBlockInputMeta): BlockInputNoData {
|
|
932
|
+
const init: BlockInputInit = {
|
|
933
|
+
daOutOfRange: props.daOutOfRange,
|
|
934
|
+
timeCreated: props.seenTimestampSec,
|
|
935
|
+
forkName: props.forkName,
|
|
936
|
+
slot: props.block.message.slot,
|
|
937
|
+
blockRootHex: props.blockRootHex,
|
|
938
|
+
parentRootHex: toRootHex(props.block.message.parentRoot),
|
|
939
|
+
};
|
|
940
|
+
const state: BlockInputNoDataState = {
|
|
941
|
+
hasBlock: true,
|
|
942
|
+
hasAllData: true,
|
|
943
|
+
block: props.block,
|
|
944
|
+
source: {
|
|
945
|
+
source: props.source,
|
|
946
|
+
seenTimestampSec: props.seenTimestampSec,
|
|
947
|
+
peerIdStr: props.peerIdStr,
|
|
948
|
+
},
|
|
949
|
+
timeCompleteSec: props.seenTimestampSec,
|
|
950
|
+
};
|
|
951
|
+
return new BlockInputNoData(init, state);
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
addBlock(_: AddBlock<ForkPostGloas>, opts = {throwOnDuplicateAdd: true}): void {
|
|
955
|
+
if (opts.throwOnDuplicateAdd) {
|
|
956
|
+
throw new BlockInputError(
|
|
957
|
+
{
|
|
958
|
+
code: BlockInputErrorCode.INVALID_CONSTRUCTION,
|
|
959
|
+
blockRoot: this.blockRootHex,
|
|
960
|
+
},
|
|
961
|
+
"Cannot addBlock to BlockInputNoData - block already exists"
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
getBlobKzgCommitments(): deneb.BlobKzgCommitments {
|
|
967
|
+
return (this.state.block.message.body as gloas.BeaconBlockBody).signedExecutionPayloadBid.message
|
|
968
|
+
.blobKzgCommitments;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
@@ -29,6 +29,9 @@ export async function verifyBlocksDataAvailability(
|
|
|
29
29
|
|
|
30
30
|
const availableTime = Math.max(0, Math.max(...blocks.map((blockInput) => blockInput.getTimeComplete())));
|
|
31
31
|
const dataAvailabilityStatuses: DataAvailabilityStatus[] = blocks.map((blockInput) => {
|
|
32
|
+
if (blockInput.type === DAType.NoData) {
|
|
33
|
+
return DataAvailabilityStatus.NotRequired;
|
|
34
|
+
}
|
|
32
35
|
if (blockInput.type === DAType.PreData) {
|
|
33
36
|
return DataAvailabilityStatus.PreData;
|
|
34
37
|
}
|
|
@@ -21,7 +21,7 @@ import {Metrics} from "../../metrics/metrics.js";
|
|
|
21
21
|
import {IClock} from "../../util/clock.js";
|
|
22
22
|
import {BlockError, BlockErrorCode} from "../errors/index.js";
|
|
23
23
|
import {BlockProcessOpts} from "../options.js";
|
|
24
|
-
import {isBlockInputBlobs, isBlockInputColumns} from "./blockInput/blockInput.js";
|
|
24
|
+
import {isBlockInputBlobs, isBlockInputColumns, isBlockInputNoData} from "./blockInput/blockInput.js";
|
|
25
25
|
import {IBlockInput} from "./blockInput/types.js";
|
|
26
26
|
import {ImportBlockOpts} from "./types.js";
|
|
27
27
|
|
|
@@ -51,7 +51,8 @@ type VerifyBlockExecutionResponse =
|
|
|
51
51
|
| VerifyExecutionErrorResponse
|
|
52
52
|
| {executionStatus: ExecutionStatus.Valid; lvhResponse: LVHValidResponse; execError: null}
|
|
53
53
|
| {executionStatus: ExecutionStatus.Syncing; lvhResponse?: LVHValidResponse; execError: null}
|
|
54
|
-
| {executionStatus: ExecutionStatus.PreMerge; lvhResponse: undefined; execError: null}
|
|
54
|
+
| {executionStatus: ExecutionStatus.PreMerge; lvhResponse: undefined; execError: null}
|
|
55
|
+
| {executionStatus: ExecutionStatus.PayloadSeparated; lvhResponse: undefined; execError: null};
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
58
|
* Verifies 1 or more execution payloads from a linear sequence of blocks.
|
|
@@ -148,6 +149,12 @@ export async function verifyBlockExecutionPayload(
|
|
|
148
149
|
preState0: CachedBeaconStateAllForks
|
|
149
150
|
): Promise<VerifyBlockExecutionResponse> {
|
|
150
151
|
const block = blockInput.getBlock();
|
|
152
|
+
|
|
153
|
+
// Gloas block doesn't have execution payload. Return right away
|
|
154
|
+
if (isBlockInputNoData(blockInput)) {
|
|
155
|
+
return {executionStatus: ExecutionStatus.PayloadSeparated, lvhResponse: undefined, execError: null};
|
|
156
|
+
}
|
|
157
|
+
|
|
151
158
|
/** Not null if execution is enabled */
|
|
152
159
|
const executionPayloadEnabled =
|
|
153
160
|
isExecutionStateType(preState0) &&
|
|
@@ -7,7 +7,7 @@ import {Worker, spawn} from "@chainsafe/threads";
|
|
|
7
7
|
self = undefined;
|
|
8
8
|
|
|
9
9
|
import {PublicKey} from "@chainsafe/blst";
|
|
10
|
-
import {ISignatureSet,
|
|
10
|
+
import {ISignatureSet, PubkeyCache} from "@lodestar/state-transition";
|
|
11
11
|
import {Logger} from "@lodestar/utils";
|
|
12
12
|
import {Metrics} from "../../../metrics/index.js";
|
|
13
13
|
import {LinkedList} from "../../../util/array.js";
|
|
@@ -34,7 +34,7 @@ const workerDir = process.env.NODE_ENV === "test" ? "../../../../lib/chain/bls/m
|
|
|
34
34
|
export type BlsMultiThreadWorkerPoolModules = {
|
|
35
35
|
logger: Logger;
|
|
36
36
|
metrics: Metrics | null;
|
|
37
|
-
|
|
37
|
+
pubkeyCache: PubkeyCache;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export type BlsMultiThreadWorkerPoolOptions = {
|
|
@@ -114,7 +114,7 @@ type WorkerDescriptor = {
|
|
|
114
114
|
export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
115
115
|
private readonly logger: Logger;
|
|
116
116
|
private readonly metrics: Metrics | null;
|
|
117
|
-
private readonly
|
|
117
|
+
private readonly pubkeyCache: PubkeyCache;
|
|
118
118
|
|
|
119
119
|
private readonly workers: WorkerDescriptor[];
|
|
120
120
|
private readonly jobs = new LinkedList<JobQueueItem>();
|
|
@@ -130,10 +130,10 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
|
130
130
|
private workersBusy = 0;
|
|
131
131
|
|
|
132
132
|
constructor(options: BlsMultiThreadWorkerPoolOptions, modules: BlsMultiThreadWorkerPoolModules) {
|
|
133
|
-
const {logger, metrics,
|
|
133
|
+
const {logger, metrics, pubkeyCache} = modules;
|
|
134
134
|
this.logger = logger;
|
|
135
135
|
this.metrics = metrics;
|
|
136
|
-
this.
|
|
136
|
+
this.pubkeyCache = pubkeyCache;
|
|
137
137
|
this.blsVerifyAllMultiThread = options.blsVerifyAllMultiThread ?? false;
|
|
138
138
|
|
|
139
139
|
// Use compressed for herumi for now.
|
|
@@ -173,7 +173,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
|
173
173
|
try {
|
|
174
174
|
return verifySignatureSetsMaybeBatch(
|
|
175
175
|
sets.map((set) => ({
|
|
176
|
-
publicKey: getAggregatedPubkey(set, this.
|
|
176
|
+
publicKey: getAggregatedPubkey(set, this.pubkeyCache),
|
|
177
177
|
message: set.signingRoot.valueOf(),
|
|
178
178
|
signature: set.signature,
|
|
179
179
|
}))
|
|
@@ -398,7 +398,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
|
398
398
|
try {
|
|
399
399
|
// Note: This can throw, must be handled per-job.
|
|
400
400
|
// Pubkey and signature aggregation is defered here
|
|
401
|
-
workReq = await jobItemWorkReq(job, this.
|
|
401
|
+
workReq = await jobItemWorkReq(job, this.pubkeyCache, this.metrics);
|
|
402
402
|
} catch (e) {
|
|
403
403
|
this.metrics?.blsThreadPool.errorAggregateSignatureSetsCount.inc({type: job.type});
|
|
404
404
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {PublicKey, asyncAggregateWithRandomness} from "@chainsafe/blst";
|
|
2
|
-
import {ISignatureSet,
|
|
2
|
+
import {ISignatureSet, PubkeyCache, SignatureSetType} from "@lodestar/state-transition";
|
|
3
3
|
import {Metrics} from "../../../metrics/metrics.js";
|
|
4
4
|
import {LinkedList} from "../../../util/array.js";
|
|
5
5
|
import {VerifySignatureOpts} from "../interface.js";
|
|
@@ -50,7 +50,7 @@ export function jobItemSigSets(job: JobQueueItem): number {
|
|
|
50
50
|
*/
|
|
51
51
|
export async function jobItemWorkReq(
|
|
52
52
|
job: JobQueueItem,
|
|
53
|
-
|
|
53
|
+
pubkeyCache: PubkeyCache,
|
|
54
54
|
metrics: Metrics | null
|
|
55
55
|
): Promise<BlsWorkReq> {
|
|
56
56
|
switch (job.type) {
|
|
@@ -59,7 +59,7 @@ export async function jobItemWorkReq(
|
|
|
59
59
|
opts: job.opts,
|
|
60
60
|
sets: job.sets.map((set) => ({
|
|
61
61
|
// this can throw, handled in the consumer code
|
|
62
|
-
publicKey: getAggregatedPubkey(set,
|
|
62
|
+
publicKey: getAggregatedPubkey(set, pubkeyCache, metrics).toBytes(),
|
|
63
63
|
signature: set.signature,
|
|
64
64
|
message: set.signingRoot,
|
|
65
65
|
})),
|