diff --git a/validator_client/validator_services/src/duties_service.rs b/validator_client/validator_services/src/duties_service.rs index 2e1174db67..54af3dc772 100644 --- a/validator_client/validator_services/src/duties_service.rs +++ b/validator_client/validator_services/src/duties_service.rs @@ -147,13 +147,19 @@ async fn make_selection_proof( // Call the endpoint /eth/v1/validator/beacon_committee_selections // The middleware should return a full selection proof here beacon_nodes - .first_success(|beacon_node| async move { - beacon_node - .post_validator_beacon_committee_selections(&[selections]) - .await + .first_success(|beacon_node| { + let value = selections.clone(); + async move { + beacon_node + .post_validator_beacon_committee_selections(&[value]) + .await + } }) .await - .map_err(Error::FailedToProduceSelectionProof)? + .map_err(|e| { + Error::FailedToProduceSelectionProof(ValidatorStoreError::Middleware(e.to_string())) + })? + .data } else { validator_store .produce_selection_proof(duty.pubkey, duty.slot) diff --git a/validator_client/validator_store/src/lib.rs b/validator_client/validator_store/src/lib.rs index 837af5b51d..712127abb5 100644 --- a/validator_client/validator_store/src/lib.rs +++ b/validator_client/validator_store/src/lib.rs @@ -34,6 +34,7 @@ pub enum Error { GreaterThanCurrentEpoch { epoch: Epoch, current_epoch: Epoch }, UnableToSignAttestation(AttestationError), UnableToSign(SigningError), + Middleware(String), } impl From for Error {