Skip to content

Commit

Permalink
translate all Rejected() to VdafPrepError
Browse files Browse the repository at this point in the history
  • Loading branch information
tgeoghegan committed Aug 28, 2023
1 parent c5b91f8 commit 775724d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions aggregator/src/aggregator/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,42 +244,34 @@ pub(crate) fn handle_ping_pong_error(
ping_pong_error: PingPongError,
aggregate_step_failure_counter: &Counter<u64>,
) -> 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,
),
};

Expand All @@ -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
}

0 comments on commit 775724d

Please sign in to comment.