@@ -18,12 +18,12 @@ use task_executor::TaskExecutor;
1818use tracing:: { error, info, warn} ;
1919use types:: {
2020 AbstractExecPayload , Address , AggregateAndProof , Attestation , BeaconBlock , BlindedPayload ,
21- ChainSpec , ContributionAndProof , Domain , Epoch , EthSpec , Fork , Graffiti , Hash256 ,
22- PublicKeyBytes , SelectionProof , Signature , SignedAggregateAndProof , SignedBeaconBlock ,
23- SignedContributionAndProof , SignedRoot , SignedValidatorRegistrationData , SignedVoluntaryExit ,
24- Slot , SyncAggregatorSelectionData , SyncCommitteeContribution , SyncCommitteeMessage ,
25- SyncSelectionProof , SyncSubnetId , ValidatorRegistrationData , VoluntaryExit ,
26- graffiti:: GraffitiString ,
21+ ChainSpec , ContributionAndProof , Domain , Epoch , EthSpec , ExecutionPayloadEnvelope , Fork ,
22+ Graffiti , Hash256 , PublicKeyBytes , SelectionProof , Signature , SignedAggregateAndProof ,
23+ SignedBeaconBlock , SignedContributionAndProof , SignedExecutionPayloadEnvelope , SignedRoot ,
24+ SignedValidatorRegistrationData , SignedVoluntaryExit , Slot , SyncAggregatorSelectionData ,
25+ SyncCommitteeContribution , SyncCommitteeMessage , SyncSelectionProof , SyncSubnetId ,
26+ ValidatorRegistrationData , VoluntaryExit , graffiti:: GraffitiString ,
2727} ;
2828use validator_store:: {
2929 DoppelgangerStatus , Error as ValidatorStoreError , ProposalData , SignedBlock , UnsignedBlock ,
@@ -745,6 +745,45 @@ impl<T: SlotClock + 'static, E: EthSpec> ValidatorStore for LighthouseValidatorS
745745 }
746746 }
747747
748+ async fn sign_block_gloas (
749+ & self ,
750+ validator_pubkey : PublicKeyBytes ,
751+ block : & BeaconBlock < E > ,
752+ current_slot : Slot ,
753+ ) -> Result < Arc < SignedBeaconBlock < E > > , Error > {
754+ let beacon_block = block. clone ( ) ;
755+ self . sign_abstract_block ( validator_pubkey, beacon_block, current_slot)
756+ . await
757+ . map ( |signed_block| Arc :: new ( signed_block) )
758+ }
759+
760+ async fn sign_execution_payload_envelope (
761+ & self ,
762+ validator_pubkey : PublicKeyBytes ,
763+ envelope : & ExecutionPayloadEnvelope < E > ,
764+ current_slot : Slot ,
765+ ) -> Result < SignedExecutionPayloadEnvelope < E > , Error > {
766+ let signing_epoch = current_slot. epoch ( E :: slots_per_epoch ( ) ) ;
767+ let signing_context = self . signing_context ( Domain :: BeaconBuilder , signing_epoch) ;
768+
769+ let signing_method = self . doppelganger_checked_signing_method ( validator_pubkey) ?;
770+
771+ let signature = signing_method
772+ . get_signature :: < E , BlindedPayload < E > > (
773+ SignableMessage :: ExecutionPayloadEnvelope ( envelope) ,
774+ signing_context,
775+ & self . spec ,
776+ & self . task_executor ,
777+ )
778+ . await
779+ . map_err ( Error :: SpecificError ) ?;
780+
781+ let signed_envelope =
782+ SignedExecutionPayloadEnvelope :: from_envelope ( envelope. clone ( ) , signature) ;
783+
784+ Ok ( signed_envelope)
785+ }
786+
748787 async fn sign_attestation (
749788 & self ,
750789 validator_pubkey : PublicKeyBytes ,
0 commit comments