mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
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:
@@ -46,7 +46,7 @@ use ssz::{Decode, Encode};
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::time::Duration;
|
||||
use types::{PayloadAttestationData, PayloadAttestationMessage};
|
||||
use types::{PayloadAttestationData, PayloadAttestationMessage, SignedProposerPreferences};
|
||||
|
||||
pub const V1: EndpointVersion = EndpointVersion(1);
|
||||
pub const V2: EndpointVersion = EndpointVersion(2);
|
||||
@@ -1849,6 +1849,46 @@ impl BeaconNodeHttpClient {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `POST validator/proposer_preferences`
|
||||
pub async fn post_validator_proposer_preferences(
|
||||
&self,
|
||||
signed_preferences: &[SignedProposerPreferences],
|
||||
fork_name: ForkName,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("validator")
|
||||
.push("proposer_preferences");
|
||||
|
||||
self.post_generic_with_consensus_version(path, &signed_preferences, None, fork_name)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `POST validator/proposer_preferences` (SSZ)
|
||||
pub async fn post_validator_proposer_preferences_ssz(
|
||||
&self,
|
||||
signed_preferences: &Vec<SignedProposerPreferences>,
|
||||
fork_name: ForkName,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("validator")
|
||||
.push("proposer_preferences");
|
||||
|
||||
let ssz_body = signed_preferences.as_ssz_bytes();
|
||||
|
||||
self.post_generic_with_consensus_version_and_ssz_body(path, ssz_body, None, fork_name)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `POST beacon/rewards/sync_committee`
|
||||
pub async fn post_beacon_rewards_sync_committee(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user