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

Tear down DKG components in case of EFM recovery #6756

Closed
Closed
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
101 changes: 48 additions & 53 deletions engine/consensus/dkg/doc.go
Original file line number Diff line number Diff line change
@@ -1,54 +1,49 @@
/*

Package dkg implements engines for the DKG protocol.

ReactorEngine

ReactorEngine implements triggers to control the lifecycle of DKG runs. A new
DKG protocol is started when an EpochSetup event is sealed and finalized. The
subsequent phase transitions are triggered when specified views are encountered
(specifically when the first block of a given view is finalized). In between
phase transitions the engine regularly queries the DKG smart-contract to read
broadcast messages.

MessagingEngine

MessagingEngine is a network engine that enables consensus nodes to securely
exchange private DKG messages. Note that broadcast messages are not exchanged
through this engine, but rather via the DKG smart-contract.

Architecture

For every new epoch, the ReactorEngine instantiates a new DKGController with a
new Broker using the provided ControllerFactory. The ControllerFactory ties new
DKGControllers to the MessagingEngine via a BrokerTunnel which exposes channels
to relay incoming and outgoing messages (cf. module/dkg).

EpochSetup/OnView
|
v
+---------------+
| ReactorEngine |
+---------------+
|
v
*~~~~~~~~~~~~~~~~~~~~~* (one/epoch)
| +---------------+ |
| | Controller | |
| +---------------+ |
| | |
| v |
| +---------------+ |
| | Broker | |
| +---------------+ |
*~~~~~~~~|~~~~~~~~~\~~*
tunnel smart-contract client
| \
+--------------+ +------------------+
| Messaging | | DKGSmartContract |
| Engine | | |
+--------------+ +------------------+

*/

// Package dkg implements engines for the DKG protocol.
//
// # Reactor Engine
//
// The [ReactorEngine] implements triggers to control the lifecycle of DKG runs. A new
// DKG protocol is started when an EpochSetup event is sealed and finalized. The
// subsequent phase transitions are triggered when specified views are encountered
// (specifically when the first block of a given view is finalized). In between
// phase transitions the engine regularly queries the DKG smart-contract to read
// broadcast messages.
//
// # Messaging Engine
//
// The [MessagingEngine] is a network engine that enables consensus nodes to securely exchange
// private (not broadcast) DKG messages. Broadcast messages are sent via the DKG smart contract.
//
// # Architecture
//
// For every new epoch, the [ReactorEngine] instantiates a new [module.DKGController] with a
// new [module.DKGBroker] using the provided ControllerFactory. The ControllerFactory ties new
// DKGControllers to the [MessagingEngine] via a BrokerTunnel which exposes channels
// to relay incoming and outgoing messages (see package module/dkg).
//
// EpochSetup/EpochCommit/OnView
// |
// v
// +---------------+
// | ReactorEngine |
// +---------------+
// |
// v
// *~~~~~~~~~~~~~~~~~~~~~* <- Epoch-scoped
// | +---------------+ |
// | | Controller | |
// | +---------------+ |
// | | |
// | v |
// | +---------------+ |
// | | Broker | |
// | +---------------+ |
// *~~~~~~~~|~~~~~~~~~\~~*
// | \
// BrokerTunnel DKGContractClient
// | \
// +--------------+ +------------------+
// | Messaging | | FlowDKG smart |
// | Engine | | contract |
// +--------------+ +------------------+
package dkg
Loading