Change timeout and add debug log

This commit is contained in:
Tan Chee Keong
2025-03-13 17:52:23 +08:00
parent 7ef2a48f9f
commit 81ee8e3f36
2 changed files with 20 additions and 4 deletions

View File

@@ -132,6 +132,7 @@ async fn make_selection_proof<T: SlotClock + 'static, E: EthSpec>(
spec: &ChainSpec,
distributed: bool,
beacon_nodes: &Arc<BeaconNodeFallback<T, E>>,
duties_service: &DutiesService<T, E>,
) -> Result<Option<SelectionProof>, Error> {
let selection_proof = if distributed {
// Submit a partial selection proof in the data field of the POST HTTP endpoint
@@ -146,17 +147,31 @@ async fn make_selection_proof<T: SlotClock + 'static, E: EthSpec>(
};
// Call the endpoint /eth/v1/validator/beacon_committee_selections
// The middleware should return a full selection proof here
let log = duties_service.context.log();
let response = beacon_nodes
.first_success(|beacon_node| {
let selections = selection.clone();
println!("Selection proof: {:?}", selections);
debug!(
log,
"Partial selection proof from VC";
"Validator index" => selections.validator_index,
"Slot" => selections.slot,
"Selection proof" => ?selections.selection_proof,
);
// println!("Selection proof: {:?}", selections);
async move {
let response = beacon_node
.post_validator_beacon_committee_selections(&[selections])
.await;
println!("Response from middleware {:?}", response);
debug!(
log,
"Response from middleware";
"response" => ?response,
);
// println!("Response from middleware {:?}", response);
response
}
@@ -1148,6 +1163,7 @@ async fn fill_in_selection_proofs<T: SlotClock + 'static, E: EthSpec>(
&duties_service.spec,
duties_service.distributed,
&duties_service.beacon_nodes,
&duties_service,
)
.await?;
Ok((duty, opt_selection_proof))