mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
Build validator client AttestationProducer
This commit is contained in:
@@ -38,7 +38,7 @@ impl EpochDuty {
|
||||
// if the validator is required to attest to a shard, create the data
|
||||
let mut attestation_duty = None;
|
||||
if self.attestation_duty.slot == slot {
|
||||
attestation_duty = self.attestation_duty
|
||||
attestation_duty = Some(self.attestation_duty)
|
||||
}
|
||||
|
||||
if produce_block | attestation_duty.is_some() {
|
||||
@@ -60,7 +60,7 @@ impl fmt::Display for EpochDuty {
|
||||
write!(
|
||||
f,
|
||||
"produce block slot: {}, attestation slot: {}, attestation shard: {}",
|
||||
display_block, self.attestation_slot, self.attestation_shard
|
||||
display_block, self.attestation_duty.slot, self.attestation_duty.shard
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use protos::services_grpc::ValidatorServiceClient;
|
||||
use ssz::ssz_encode;
|
||||
use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
use types::{Epoch, PublicKey, Slot};
|
||||
use types::{AttestationDuty, Epoch, PublicKey, Slot};
|
||||
|
||||
impl BeaconNodeDuties for ValidatorServiceClient {
|
||||
/// Requests all duties (block signing and committee attesting) from the Beacon Node (BN).
|
||||
@@ -49,11 +49,11 @@ impl BeaconNodeDuties for ValidatorServiceClient {
|
||||
};
|
||||
|
||||
let attestation_duty = AttestationDuty {
|
||||
slot: Slot::from(active_duty.get_attestation_slot()),
|
||||
shard: active_duty.get_attestation_shard(),
|
||||
committee_index: active_duty.get_committee_index(),
|
||||
comittee_size: 10,
|
||||
}
|
||||
slot: Slot::from(active_duty.get_attestation_slot()),
|
||||
shard: active_duty.get_attestation_shard(),
|
||||
committee_index: active_duty.get_committee_index() as usize,
|
||||
committee_len: 10,
|
||||
};
|
||||
|
||||
let epoch_duty = EpochDuty {
|
||||
block_production_slot,
|
||||
|
||||
Reference in New Issue
Block a user