github.com/koko1123/flow-go-1@v0.29.6/engine/consensus/dkg/doc.go (about)

     1  /*
     2  
     3  Package dkg implements engines for the DKG protocol.
     4  
     5  ReactorEngine
     6  
     7  ReactorEngine implements triggers to control the lifecycle of DKG runs. A new
     8  DKG protocol is started when an EpochSetup event is sealed and finalized. The
     9  subsequent phase transitions are triggered when specified views are encountered
    10  (specifically when the first block of a given view is finalized). In between
    11  phase transitions the engine regularly queries the DKG smart-contract to read
    12  broadcast messages.
    13  
    14  MessagingEngine
    15  
    16  MessagingEngine is a network engine that enables consensus nodes to securely
    17  exchange private DKG messages. Note that broadcast messages are not exchanged
    18  through this engine, but rather via the DKG smart-contract.
    19  
    20  Architecture
    21  
    22  For every new epoch, the ReactorEngine instantiates a new DKGController with a
    23  new Broker using the provided ControllerFactory. The ControllerFactory ties new
    24  DKGControllers to the MessagingEngine via a BrokerTunnel which exposes channels
    25  to relay incoming and outgoing messages (cf. module/dkg).
    26  
    27      EpochSetup/OnView
    28            |
    29            v
    30     +---------------+
    31     | ReactorEngine |
    32     +---------------+
    33            |
    34            v
    35  *~~~~~~~~~~~~~~~~~~~~~* (one/epoch)
    36  |  +---------------+  |
    37  |  | Controller    |  |
    38  |  +---------------+  |
    39  |         |           |
    40  |         v           |
    41  |  +---------------+  |
    42  |  | Broker        |  |
    43  |  +---------------+  |
    44  *~~~~~~~~|~~~~~~~~~\~~*
    45         tunnel      smart-contract client
    46           |           \
    47     +--------------+   +------------------+
    48     | Messaging    |   | DKGSmartContract |
    49     | Engine       |   |                  |
    50     +--------------+   +------------------+
    51  
    52  */
    53  
    54  package dkg