From 775724dc6ff114265979ce117e586c8af41ae40c Mon Sep 17 00:00:00 2001 From: Tim Geoghegan Date: Mon, 28 Aug 2023 08:07:28 -0700 Subject: [PATCH] translate all Rejected() to VdafPrepError --- aggregator/src/aggregator/error.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/aggregator/src/aggregator/error.rs b/aggregator/src/aggregator/error.rs index 9e05832b6..740b9b08e 100644 --- a/aggregator/src/aggregator/error.rs +++ b/aggregator/src/aggregator/error.rs @@ -244,42 +244,34 @@ pub(crate) fn handle_ping_pong_error( ping_pong_error: PingPongError, aggregate_step_failure_counter: &Counter, ) -> PrepareError { - let (error_desc, value, prepare_error) = match ping_pong_error { + let (error_desc, value) = match ping_pong_error { PingPongError::VdafPrepareInit(_) => ( "Couldn't helper_initialize report share".to_string(), "prepare_init_failure".to_string(), - PrepareError::VdafPrepError, ), PingPongError::VdafPreparePreprocess(_) => ( "Couldn't compute prepare message".to_string(), "prepare_message_failure".to_string(), - PrepareError::VdafPrepError, ), PingPongError::VdafPrepareStep(_) => ( "Prepare step failed".to_string(), "prepare_step_failure".to_string(), - PrepareError::VdafPrepError, ), PingPongError::CodecPrepShare(_) => ( format!("Couldn't decode {peer_role} prepare share"), format!("{peer_role}_prep_share_decode_failure"), - PrepareError::UnrecognizedMessage, ), PingPongError::CodecPrepMessage(_) => ( format!("Couldn't decode {peer_role} prepare message"), format!("{peer_role}_prep_message_decode_failure"), - PrepareError::UnrecognizedMessage, ), ref error @ PingPongError::StateMismatch(_, _) => ( format!("{error}"), format!("{peer_role}_ping_pong_message_state_mismatch"), - // TODO(timg): is this the right error if state mismatch? - PrepareError::VdafPrepError, ), PingPongError::InternalError(desc) => ( desc.to_string(), "vdaf_ping_pong_internal_error".to_string(), - PrepareError::VdafPrepError, ), }; @@ -292,5 +284,7 @@ pub(crate) fn handle_ping_pong_error( aggregate_step_failure_counter.add(1, &[KeyValue::new("type", value)]); - prepare_error + // Per DAP, any occurrence of state Rejected() from a ping-pong routime is translated to + // VdafPrepError + PrepareError::VdafPrepError }