Skip to content

Commit 5d4dc0f

Browse files
committed
chilldkg: add API docs for blaming functions
1 parent 51984ce commit 5d4dc0f

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
@@ -990,7 +990,30 @@ recovery data to this participant.
990990
def participant_investigate(error: UnknownFaultyParticipantOrCoordinatorError, cinv: CoordinatorInvestigationMsg) -> NoReturn
991991
```
992992

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

9951018
#### coordinator\_step1
9961019

@@ -1074,7 +1097,24 @@ other participants via a communication channel beside the coordinator.
10741097
def coordinator_investigate(pmsgs: List[ParticipantMsg1]) -> List[CoordinatorInvestigationMsg]
10751098
```
10761099

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

10791119
#### recover
10801120

@@ -1209,7 +1249,7 @@ information to determine which participant should be suspected.
12091249

12101250
To determine a suspected participant, the raising participant may choose to
12111251
run the optional investigation procedure of the protocol, which requires
1212-
obtaining an investigation message by the coordinator. See the
1252+
obtaining an investigation message from the coordinator. See the
12131253
`participant_investigate` function for details.
12141254

12151255
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 blame 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_blame`.
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 blame 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)