@lodestar/validator 1.43.0 → 1.44.0-dev.1d0e0b9081

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.
@@ -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
 
@@ -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 blockProposingService = new BlockProposingService(config, loggerVc, api, clock, validatorStore, metrics, {
237
- broadcastValidation: opts.broadcastValidation ?? defaultOptions.broadcastValidation,
238
- blindedLocal: opts.blindedLocal ?? defaultOptions.blindedLocal,
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,