Implement gloas proposer preference vc duty (#9208)

Allow for the vc to submit its proposer preferences to the network


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
Eitan Seri-Levi
2026-05-04 13:33:09 +02:00
committed by GitHub
parent ee61aee659
commit 9cf155a0dd
17 changed files with 694 additions and 41 deletions

View File

@@ -22,11 +22,12 @@ use types::{
AbstractExecPayload, Address, AggregateAndProof, Attestation, BeaconBlock, BlindedPayload,
ChainSpec, ContributionAndProof, Domain, Epoch, EthSpec, ExecutionPayloadEnvelope, Fork,
FullPayload, Graffiti, Hash256, PayloadAttestationData, PayloadAttestationMessage,
SelectionProof, SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof,
SignedExecutionPayloadEnvelope, SignedRoot, SignedValidatorRegistrationData,
SignedVoluntaryExit, Slot, SyncAggregatorSelectionData, SyncCommitteeContribution,
SyncCommitteeMessage, SyncSelectionProof, SyncSubnetId, ValidatorRegistrationData,
VoluntaryExit, graffiti::GraffitiString,
ProposerPreferences, SelectionProof, SignedAggregateAndProof, SignedBeaconBlock,
SignedContributionAndProof, SignedExecutionPayloadEnvelope, SignedProposerPreferences,
SignedRoot, SignedValidatorRegistrationData, SignedVoluntaryExit, Slot,
SyncAggregatorSelectionData, SyncCommitteeContribution, SyncCommitteeMessage,
SyncSelectionProof, SyncSubnetId, ValidatorRegistrationData, VoluntaryExit,
graffiti::GraffitiString,
};
use validator_store::{
AggregateToSign, AttestationToSign, ContributionToSign, DoppelgangerStatus,
@@ -1485,4 +1486,32 @@ impl<T: SlotClock + 'static, E: EthSpec> ValidatorStore for LighthouseValidatorS
signature,
})
}
async fn sign_proposer_preferences(
&self,
validator_pubkey: PublicKeyBytes,
preferences: ProposerPreferences,
) -> Result<SignedProposerPreferences, Error> {
let signing_context = self.signing_context(
Domain::ProposerPreferences,
preferences.proposal_slot.epoch(E::slots_per_epoch()),
);
let signing_method = self.doppelganger_bypassed_signing_method(validator_pubkey)?;
let signature = signing_method
.get_signature::<E, FullPayload<E>>(
SignableMessage::ProposerPreferences(&preferences),
signing_context,
&self.spec,
&self.task_executor,
)
.await
.map_err(Error::SpecificError)?;
Ok(SignedProposerPreferences {
message: preferences,
signature,
})
}
}