-
Notifications
You must be signed in to change notification settings - Fork 179
/
doc.go
54 lines (44 loc) · 1.63 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
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