mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Add graffiti cli flag to the validator client. (#1425)
## Issue Addressed #1419 ## Proposed Changes Creates a `--graffiti` cli flag in the validator client. If the flag is set, it overrides graffiti in the beacon node. ## Additional Info
This commit is contained in:
@@ -11,8 +11,8 @@ use std::marker::PhantomData;
|
||||
use std::time::Duration;
|
||||
use types::{
|
||||
Attestation, AttestationData, AttesterSlashing, BeaconBlock, BeaconState, CommitteeIndex,
|
||||
Epoch, EthSpec, Fork, Hash256, ProposerSlashing, PublicKey, PublicKeyBytes, Signature,
|
||||
SignedAggregateAndProof, SignedBeaconBlock, Slot, SubnetId,
|
||||
Epoch, EthSpec, Fork, Graffiti, Hash256, ProposerSlashing, PublicKey, PublicKeyBytes,
|
||||
Signature, SignedAggregateAndProof, SignedBeaconBlock, Slot, SubnetId,
|
||||
};
|
||||
use url::Url;
|
||||
|
||||
@@ -313,18 +313,21 @@ impl<E: EthSpec> Validator<E> {
|
||||
&self,
|
||||
slot: Slot,
|
||||
randao_reveal: Signature,
|
||||
graffiti: Option<Graffiti>,
|
||||
) -> Result<BeaconBlock<E>, Error> {
|
||||
let client = self.0.clone();
|
||||
let url = self.url("block")?;
|
||||
client
|
||||
.json_get::<BeaconBlock<E>>(
|
||||
url,
|
||||
vec![
|
||||
("slot".into(), format!("{}", slot.as_u64())),
|
||||
("randao_reveal".into(), as_ssz_hex_string(&randao_reveal)),
|
||||
],
|
||||
)
|
||||
.await
|
||||
|
||||
let mut query_pairs = vec![
|
||||
("slot".into(), format!("{}", slot.as_u64())),
|
||||
("randao_reveal".into(), as_ssz_hex_string(&randao_reveal)),
|
||||
];
|
||||
|
||||
if let Some(graffiti_bytes) = graffiti {
|
||||
query_pairs.push(("graffiti".into(), as_ssz_hex_string(&graffiti_bytes)));
|
||||
}
|
||||
|
||||
client.json_get::<BeaconBlock<E>>(url, query_pairs).await
|
||||
}
|
||||
|
||||
/// Subscribes a list of validators to particular slots for attestation production/publication.
|
||||
|
||||
Reference in New Issue
Block a user