@lodestar/validator 1.43.0-rc.5 → 1.44.0-dev.1a8c38ee36
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/services/block.d.ts +2 -1
- package/lib/services/block.d.ts.map +1 -1
- package/lib/services/block.js +4 -3
- package/lib/services/block.js.map +1 -1
- package/lib/services/blockDuties.d.ts +85 -7
- package/lib/services/blockDuties.d.ts.map +1 -1
- package/lib/services/blockDuties.js +186 -74
- package/lib/services/blockDuties.js.map +1 -1
- package/lib/services/proposerPreferences.d.ts +25 -0
- package/lib/services/proposerPreferences.d.ts.map +1 -0
- package/lib/services/proposerPreferences.js +101 -0
- package/lib/services/proposerPreferences.js.map +1 -0
- package/lib/services/validatorStore.d.ts +1 -0
- package/lib/services/validatorStore.d.ts.map +1 -1
- package/lib/services/validatorStore.js +25 -1
- package/lib/services/validatorStore.js.map +1 -1
- package/lib/util/externalSignerClient.d.ts +5 -1
- package/lib/util/externalSignerClient.d.ts.map +1 -1
- package/lib/util/externalSignerClient.js +4 -0
- package/lib/util/externalSignerClient.js.map +1 -1
- package/lib/util/params.js +1 -0
- package/lib/util/params.js.map +1 -1
- package/lib/validator.d.ts.map +1 -1
- package/lib/validator.js +5 -1
- package/lib/validator.js.map +1 -1
- package/package.json +12 -12
- package/src/services/block.ts +3 -9
- package/src/services/blockDuties.ts +212 -79
- package/src/services/proposerPreferences.ts +124 -0
- package/src/services/validatorStore.ts +37 -0
- package/src/util/externalSignerClient.ts +7 -1
- package/src/util/params.ts +1 -0
- package/src/validator.ts +27 -4
|
@@ -35,6 +35,7 @@ export enum SignableMessageType {
|
|
|
35
35
|
VALIDATOR_REGISTRATION = "VALIDATOR_REGISTRATION",
|
|
36
36
|
EXECUTION_PAYLOAD_ENVELOPE = "EXECUTION_PAYLOAD_ENVELOPE",
|
|
37
37
|
PAYLOAD_ATTESTATION = "PAYLOAD_ATTESTATION",
|
|
38
|
+
PROPOSER_PREFERENCES = "PROPOSER_PREFERENCES",
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
const AggregationSlotType = new ContainerType({
|
|
@@ -85,7 +86,8 @@ export type SignableMessage =
|
|
|
85
86
|
| {type: SignableMessageType.SYNC_COMMITTEE_CONTRIBUTION_AND_PROOF; data: altair.ContributionAndProof}
|
|
86
87
|
| {type: SignableMessageType.VALIDATOR_REGISTRATION; data: ValidatorRegistrationV1}
|
|
87
88
|
| {type: SignableMessageType.EXECUTION_PAYLOAD_ENVELOPE; data: gloas.ExecutionPayloadEnvelope}
|
|
88
|
-
| {type: SignableMessageType.PAYLOAD_ATTESTATION; data: gloas.PayloadAttestationData}
|
|
89
|
+
| {type: SignableMessageType.PAYLOAD_ATTESTATION; data: gloas.PayloadAttestationData}
|
|
90
|
+
| {type: SignableMessageType.PROPOSER_PREFERENCES; data: gloas.ProposerPreferences};
|
|
89
91
|
|
|
90
92
|
const requiresForkInfo: Record<SignableMessageType, boolean> = {
|
|
91
93
|
[SignableMessageType.AGGREGATION_SLOT]: true,
|
|
@@ -102,6 +104,7 @@ const requiresForkInfo: Record<SignableMessageType, boolean> = {
|
|
|
102
104
|
[SignableMessageType.VALIDATOR_REGISTRATION]: false,
|
|
103
105
|
[SignableMessageType.EXECUTION_PAYLOAD_ENVELOPE]: true,
|
|
104
106
|
[SignableMessageType.PAYLOAD_ATTESTATION]: true,
|
|
107
|
+
[SignableMessageType.PROPOSER_PREFERENCES]: true,
|
|
105
108
|
};
|
|
106
109
|
|
|
107
110
|
type Web3SignerSerializedRequest = {
|
|
@@ -279,6 +282,9 @@ function serializerSignableMessagePayload(config: BeaconConfig, payload: Signabl
|
|
|
279
282
|
|
|
280
283
|
case SignableMessageType.PAYLOAD_ATTESTATION:
|
|
281
284
|
return {payload_attestation: ssz.gloas.PayloadAttestationData.toJson(payload.data)};
|
|
285
|
+
|
|
286
|
+
case SignableMessageType.PROPOSER_PREFERENCES:
|
|
287
|
+
return {proposer_preferences: ssz.gloas.ProposerPreferences.toJson(payload.data)};
|
|
282
288
|
}
|
|
283
289
|
}
|
|
284
290
|
|
package/src/util/params.ts
CHANGED
|
@@ -321,6 +321,7 @@ function getSpecCriticalParams(localConfig: ChainConfig): Record<keyof ConfigWit
|
|
|
321
321
|
SYNC_MESSAGE_DUE_BPS_GLOAS: gloasForkRelevant,
|
|
322
322
|
CONTRIBUTION_DUE_BPS_GLOAS: gloasForkRelevant,
|
|
323
323
|
PAYLOAD_ATTESTATION_DUE_BPS: gloasForkRelevant,
|
|
324
|
+
PAYLOAD_DUE_BPS: gloasForkRelevant,
|
|
324
325
|
PTC_SIZE: gloasForkRelevant,
|
|
325
326
|
MAX_PAYLOAD_ATTESTATIONS: gloasForkRelevant,
|
|
326
327
|
BUILDER_REGISTRY_LIMIT: gloasForkRelevant,
|
package/src/validator.ts
CHANGED
|
@@ -9,12 +9,14 @@ import {Metrics} from "./metrics.js";
|
|
|
9
9
|
import {MetaDataRepository} from "./repositories/metaDataRepository.js";
|
|
10
10
|
import {AttestationService} from "./services/attestation.js";
|
|
11
11
|
import {BlockProposingService} from "./services/block.js";
|
|
12
|
+
import {BlockDutiesService} from "./services/blockDuties.js";
|
|
12
13
|
import {ChainHeaderTracker} from "./services/chainHeaderTracker.js";
|
|
13
14
|
import {DoppelgangerService} from "./services/doppelgangerService.js";
|
|
14
15
|
import {ValidatorEventEmitter} from "./services/emitter.js";
|
|
15
16
|
import {ExternalSignerOptions, pollExternalSignerPubkeys} from "./services/externalSignerSync.js";
|
|
16
17
|
import {IndicesService} from "./services/indices.js";
|
|
17
18
|
import {pollBuilderValidatorRegistration, pollPrepareBeaconProposer} from "./services/prepareBeaconProposer.js";
|
|
19
|
+
import {ProposerPreferencesService} from "./services/proposerPreferences.js";
|
|
18
20
|
import {PtcService} from "./services/ptc.js";
|
|
19
21
|
import {SyncCommitteeService} from "./services/syncCommittee.js";
|
|
20
22
|
import {SyncingStatusTracker} from "./services/syncingStatusTracker.js";
|
|
@@ -233,10 +235,29 @@ export class Validator {
|
|
|
233
235
|
const chainHeaderTracker = new ChainHeaderTracker(config, logger, api, emitter);
|
|
234
236
|
const syncingStatusTracker = new SyncingStatusTracker(logger, api, clock, metrics);
|
|
235
237
|
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
const blockDutiesService = new BlockDutiesService(
|
|
239
|
+
config,
|
|
240
|
+
loggerVc,
|
|
241
|
+
api,
|
|
242
|
+
clock,
|
|
243
|
+
validatorStore,
|
|
244
|
+
chainHeaderTracker,
|
|
245
|
+
metrics
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
const blockProposingService = new BlockProposingService(
|
|
249
|
+
config,
|
|
250
|
+
loggerVc,
|
|
251
|
+
api,
|
|
252
|
+
clock,
|
|
253
|
+
validatorStore,
|
|
254
|
+
blockDutiesService,
|
|
255
|
+
metrics,
|
|
256
|
+
{
|
|
257
|
+
broadcastValidation: opts.broadcastValidation ?? defaultOptions.broadcastValidation,
|
|
258
|
+
blindedLocal: opts.blindedLocal ?? defaultOptions.blindedLocal,
|
|
259
|
+
}
|
|
260
|
+
);
|
|
240
261
|
|
|
241
262
|
const attestationService = new AttestationService(
|
|
242
263
|
loggerVc,
|
|
@@ -282,6 +303,8 @@ export class Validator {
|
|
|
282
303
|
}
|
|
283
304
|
);
|
|
284
305
|
|
|
306
|
+
new ProposerPreferencesService(config, loggerVc, api, clock, validatorStore, blockDutiesService, metrics);
|
|
307
|
+
|
|
285
308
|
return new Validator({
|
|
286
309
|
opts,
|
|
287
310
|
genesis,
|