Skip to content

Commit 70ee065

Browse files
committed
chilldkg: add API docs for blaming functions
1 parent b3c53e5 commit 70ee065

File tree

2 files changed

+69
-4
lines changed

2 files changed

+69
-4
lines changed

README.md

+37-2
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,32 @@ recovery data to this participant.
927927
def participant_blame(blame_state: ParticipantBlameState, cblame: CoordinatorBlameMsg) -> NoReturn
928928
```
929929

930-
Perform a participant's blame step of a ChillDKG session. TODO
930+
Perform a blame investigation (TODO) for a participant in a ChillDKG session.
931+
932+
This function is called when `participant_step2` raises
933+
`UnknownFaultyParticipantOrCoordinatorError` and allows to further narrow
934+
down the suspected faulty parties. It helps narrow down the suspected
935+
faulty parties by analyzing the blame message provided by the coordinator.
936+
937+
The function does not return a value. Instead, it raises one of two
938+
exceptions.
939+
940+
*Arguments*:
941+
942+
- `blame_state` - The participant's blame state as contained in
943+
UnknownFaultyParticipantOrCoordinatorError thrown by
944+
`participant_step2`.
945+
- `cblame` - The coordinator blame message for this participant as output by
946+
`coordinator_blame`.
947+
948+
949+
*Raises*:
950+
951+
- `FaultyParticipantOrCoordinatorError` - If another known participant or the
952+
coordinator is faulty. See the documentation of the exception for
953+
further details.
954+
- `FaultyCoordinatorError` - If the coordinator is faulty. See the
955+
documentation of the exception for further details.
931956

932957
#### coordinator\_step1
933958

@@ -1010,7 +1035,17 @@ other participants via a communication channel beside the coordinator.
10101035
def coordinator_blame(pmsgs: List[ParticipantMsg1]) -> List[CoordinatorBlameMsg]
10111036
```
10121037

1013-
Perform the coordinator's blame step of a ChillDKG session. TODO
1038+
Generate blame messages for participants to allow blame investigation.
1039+
1040+
*Arguments*:
1041+
1042+
- `pmsgs` - List of first messages received from the participants.
1043+
1044+
1045+
*Returns*:
1046+
1047+
- `List[CoordinatorBlameMsg]` - A list of blame messages, each intended for a
1048+
single participant.
10141049

10151050
#### recover
10161051

python/chilldkg_ref/chilldkg.py

+32-2
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,29 @@ def participant_blame(
604604
blame_state: ParticipantBlameState,
605605
cblame: CoordinatorBlameMsg,
606606
) -> NoReturn:
607-
"""Perform a participant's blame step of a ChillDKG session. TODO"""
607+
"""Perform a blame investigation (TODO) for a participant in a ChillDKG session.
608+
609+
This function can optionally be called when `participant_step2` raises
610+
`UnknownFaultyParticipantOrCoordinatorError`. It narrows down the suspected
611+
faulty parties by analyzing the blame message provided by the coordinator.
612+
613+
This function does not return normally. Instead, it raises one of two
614+
exceptions.
615+
616+
Arguments:
617+
blame_state: The participant's blame state as contained in
618+
`UnknownFaultyParticipantOrCoordinatorError` raised by
619+
`participant_step2`.
620+
cblame: The coordinator blame message for this participant as output by
621+
`coordinator_blame`.
622+
623+
Raises:
624+
FaultyParticipantOrCoordinatorError: If another known participant or the
625+
coordinator is faulty. See the documentation of the exception for
626+
further details.
627+
FaultyCoordinatorError: If the coordinator is faulty. See the
628+
documentation of the exception for further details.
629+
"""
608630
encpedpop.participant_blame(
609631
blame_state=blame_state.enc_blame_state,
610632
cblame=cblame.enc_cblame,
@@ -709,7 +731,15 @@ def coordinator_finalize(
709731

710732

711733
def coordinator_blame(pmsgs: List[ParticipantMsg1]) -> List[CoordinatorBlameMsg]:
712-
"""Perform the coordinator's blame step of a ChillDKG session. TODO"""
734+
"""Generate blame messages for participants to allow blame investigation.
735+
736+
Arguments:
737+
pmsgs: List of first messages received from the participants.
738+
739+
Returns:
740+
List[CoordinatorBlameMsg]: A list of blame messages, each intended for a
741+
single participant.
742+
"""
713743
enc_cblames = encpedpop.coordinator_blame([pmsg.enc_pmsg for pmsg in pmsgs])
714744
return [CoordinatorBlameMsg(enc_cblame) for enc_cblame in enc_cblames]
715745

0 commit comments

Comments
 (0)