Skip to content

Commit b30d710

Browse files
committed
addressing comments
1 parent face04f commit b30d710

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

validator_client/validator_services/src/attestation_service.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,17 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> AttestationService<S,
205205
}
206206

207207
match self.spawn_attestation_tasks(slot_duration, beacon_node_index) {
208-
Ok(_) => *last_slot = current_slot,
208+
Ok(_) => {
209+
*last_slot = current_slot;
210+
let duration = if let Some(duration) = self.slot_clock.duration_to_next_slot() {
211+
duration
212+
} else {
213+
error!("Failed to read slot clock");
214+
slot_duration
215+
};
216+
217+
sleep(duration).await;
218+
},
209219
Err(e) => {
210220
crit!(error = e, "Failed to spawn attestation tasks")
211221
}
@@ -254,6 +264,12 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> AttestationService<S,
254264
return Ok(());
255265
}
256266

267+
debug!(
268+
%slot,
269+
from_head_monitor = beacon_node_index.is_some(),
270+
"Starting attestation production"
271+
);
272+
257273
let attestation_service = self.clone();
258274

259275
let attestation_data_handle = self

0 commit comments

Comments
 (0)