Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chilldkg: add API docs for blaming functions #72

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,30 @@ recovery data to this participant.
def participant_investigate(error: UnknownFaultyParticipantOrCoordinatorError, cinv: CoordinatorInvestigationMsg) -> NoReturn
```

Perform a participant's blame step of a ChillDKG session. TODO
Investigate who is to blame for a failed ChillDKG session.

This function can optionally be called when `participant_step2` raises
`UnknownFaultyParticipantOrCoordinatorError`. It narrows down the suspected
faulty parties by analyzing the investigation message provided by the coordinator.

This function does not return normally. Instead, it raises one of two
exceptions.

*Arguments*:

- `error` - `UnknownFaultyParticipantOrCoordinatorError` raised by
`participant_step2`.
- `cinv` - Coordinator investigation message for this participant as output
by `coordinator_investigate`.


*Raises*:

- `FaultyParticipantOrCoordinatorError` - If another known participant or the
coordinator is faulty. See the documentation of the exception for
further details.
- `FaultyCoordinatorError` - If the coordinator is faulty. See the
documentation of the exception for further details.

#### coordinator\_step1

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

Perform the coordinator's blame step of a ChillDKG session. TODO
Generate investigation messages for a ChillDKG session.

The investigation messages will allow the participants to investigate who is
to blame for a failed ChillDKG session (see `participant_investigate`).

Each message is intended for a single participant but can be safely
broadcast to all participants because the messages contain no confidential
information.

*Arguments*:

- `pmsgs` - List of first messages received from the participants.


*Returns*:

- `List[CoordinatorInvestigationMsg]` - A list of investigation messages, each
intended for a single participant.

#### recover

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

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

This is only raised for specific faulty behavior by another participant
Expand Down
39 changes: 37 additions & 2 deletions python/chilldkg_ref/chilldkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,28 @@ def participant_investigate(
error: UnknownFaultyParticipantOrCoordinatorError,
cinv: CoordinatorInvestigationMsg,
) -> NoReturn:
"""Perform a participant's blame step of a ChillDKG session. TODO"""
"""Investigate who is to blame for a failed ChillDKG session.

This function can optionally be called when `participant_step2` raises
`UnknownFaultyParticipantOrCoordinatorError`. It narrows down the suspected
faulty parties by analyzing the investigation message provided by the coordinator.

This function does not return normally. Instead, it raises one of two
exceptions.

Arguments:
error: `UnknownFaultyParticipantOrCoordinatorError` raised by
`participant_step2`.
cinv: Coordinator investigation message for this participant as output
by `coordinator_investigate`.

Raises:
FaultyParticipantOrCoordinatorError: If another known participant or the
coordinator is faulty. See the documentation of the exception for
further details.
FaultyCoordinatorError: If the coordinator is faulty. See the
documentation of the exception for further details.
"""
assert isinstance(error.inv_data, encpedpop.ParticipantInvestigationData)
encpedpop.participant_investigate(
error=error,
Expand Down Expand Up @@ -703,7 +723,22 @@ def coordinator_finalize(
def coordinator_investigate(
pmsgs: List[ParticipantMsg1],
) -> List[CoordinatorInvestigationMsg]:
"""Perform the coordinator's blame step of a ChillDKG session. TODO"""
"""Generate investigation messages for a ChillDKG session.

The investigation messages will allow the participants to investigate who is
to blame for a failed ChillDKG session (see `participant_investigate`).

Each message is intended for a single participant but can be safely
broadcast to all participants because the messages contain no confidential
information.

Arguments:
pmsgs: List of first messages received from the participants.

Returns:
List[CoordinatorInvestigationMsg]: A list of investigation messages, each
intended for a single participant.
"""
enc_cinvs = encpedpop.coordinator_investigate([pmsg.enc_pmsg for pmsg in pmsgs])
return [CoordinatorInvestigationMsg(enc_cinv) for enc_cinv in enc_cinvs]

Expand Down
2 changes: 1 addition & 1 deletion python/chilldkg_ref/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class UnknownFaultyParticipantOrCoordinatorError(ProtocolError):

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

This is only raised for specific faulty behavior by another participant
Expand Down
Loading