Skip to content

Commit 2316b7f

Browse files
Merge pull request #72 from jonasnick/blame-docs-python
2 parents ac2e2d4 + 1de4bac commit 2316b7f

File tree

3 files changed

+81
-6
lines changed

3 files changed

+81
-6
lines changed

README.md

+43-3
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,30 @@ recovery data to this participant.
996996
def participant_investigate(error: UnknownFaultyParticipantOrCoordinatorError, cinv: CoordinatorInvestigationMsg) -> NoReturn
997997
```
998998

999-
Perform a participant's blame step of a ChillDKG session. TODO
999+
Investigate who is to blame for a failed ChillDKG session.
1000+
1001+
This function can optionally be called when `participant_step2` raises
1002+
`UnknownFaultyParticipantOrCoordinatorError`. It narrows down the suspected
1003+
faulty parties by analyzing the investigation message provided by the coordinator.
1004+
1005+
This function does not return normally. Instead, it raises one of two
1006+
exceptions.
1007+
1008+
*Arguments*:
1009+
1010+
- `error` - `UnknownFaultyParticipantOrCoordinatorError` raised by
1011+
`participant_step2`.
1012+
- `cinv` - Coordinator investigation message for this participant as output
1013+
by `coordinator_investigate`.
1014+
1015+
1016+
*Raises*:
1017+
1018+
- `FaultyParticipantOrCoordinatorError` - If another known participant or the
1019+
coordinator is faulty. See the documentation of the exception for
1020+
further details.
1021+
- `FaultyCoordinatorError` - If the coordinator is faulty. See the
1022+
documentation of the exception for further details.
10001023

10011024
#### coordinator\_step1
10021025

@@ -1080,7 +1103,24 @@ other participants via a communication channel beside the coordinator.
10801103
def coordinator_investigate(pmsgs: List[ParticipantMsg1]) -> List[CoordinatorInvestigationMsg]
10811104
```
10821105

1083-
Perform the coordinator's blame step of a ChillDKG session. TODO
1106+
Generate investigation messages for a ChillDKG session.
1107+
1108+
The investigation messages will allow the participants to investigate who is
1109+
to blame for a failed ChillDKG session (see `participant_investigate`).
1110+
1111+
Each message is intended for a single participant but can be safely
1112+
broadcast to all participants because the messages contain no confidential
1113+
information.
1114+
1115+
*Arguments*:
1116+
1117+
- `pmsgs` - List of first messages received from the participants.
1118+
1119+
1120+
*Returns*:
1121+
1122+
- `List[CoordinatorInvestigationMsg]` - A list of investigation messages, each
1123+
intended for a single participant.
10841124

10851125
#### recover
10861126

@@ -1215,7 +1255,7 @@ information to determine which participant should be suspected.
12151255

12161256
To determine a suspected participant, the raising participant may choose to
12171257
run the optional investigation procedure of the protocol, which requires
1218-
obtaining an investigation message by the coordinator. See the
1258+
obtaining an investigation message from the coordinator. See the
12191259
`participant_investigate` function for details.
12201260

12211261
This is only raised for specific faulty behavior by another participant

python/chilldkg_ref/chilldkg.py

+37-2
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,28 @@ def participant_investigate(
593593
error: UnknownFaultyParticipantOrCoordinatorError,
594594
cinv: CoordinatorInvestigationMsg,
595595
) -> NoReturn:
596-
"""Perform a participant's blame step of a ChillDKG session. TODO"""
596+
"""Investigate who is to blame for a failed ChillDKG session.
597597
598+
This function can optionally be called when `participant_step2` raises
599+
`UnknownFaultyParticipantOrCoordinatorError`. It narrows down the suspected
600+
faulty parties by analyzing the investigation message provided by the coordinator.
601+
602+
This function does not return normally. Instead, it raises one of two
603+
exceptions.
604+
605+
Arguments:
606+
error: `UnknownFaultyParticipantOrCoordinatorError` raised by
607+
`participant_step2`.
608+
cinv: Coordinator investigation message for this participant as output
609+
by `coordinator_investigate`.
610+
611+
Raises:
612+
FaultyParticipantOrCoordinatorError: If another known participant or the
613+
coordinator is faulty. See the documentation of the exception for
614+
further details.
615+
FaultyCoordinatorError: If the coordinator is faulty. See the
616+
documentation of the exception for further details.
617+
"""
598618
assert isinstance(error.inv_data, encpedpop.ParticipantInvestigationData)
599619
encpedpop.participant_investigate(
600620
error=error,
@@ -703,7 +723,22 @@ def coordinator_finalize(
703723
def coordinator_investigate(
704724
pmsgs: List[ParticipantMsg1],
705725
) -> List[CoordinatorInvestigationMsg]:
706-
"""Perform the coordinator's blame step of a ChillDKG session. TODO"""
726+
"""Generate investigation messages for a ChillDKG session.
727+
728+
The investigation messages will allow the participants to investigate who is
729+
to blame for a failed ChillDKG session (see `participant_investigate`).
730+
731+
Each message is intended for a single participant but can be safely
732+
broadcast to all participants because the messages contain no confidential
733+
information.
734+
735+
Arguments:
736+
pmsgs: List of first messages received from the participants.
737+
738+
Returns:
739+
List[CoordinatorInvestigationMsg]: A list of investigation messages, each
740+
intended for a single participant.
741+
"""
707742
enc_cinvs = encpedpop.coordinator_investigate([pmsg.enc_pmsg for pmsg in pmsgs])
708743
return [CoordinatorInvestigationMsg(enc_cinv) for enc_cinv in enc_cinvs]
709744

python/chilldkg_ref/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class UnknownFaultyParticipantOrCoordinatorError(ProtocolError):
8787
8888
To determine a suspected participant, the raising participant may choose to
8989
run the optional investigation procedure of the protocol, which requires
90-
obtaining an investigation message by the coordinator. See the
90+
obtaining an investigation message from the coordinator. See the
9191
`participant_investigate` function for details.
9292
9393
This is only raised for specific faulty behavior by another participant

0 commit comments

Comments
 (0)