Commit c863874
authored
tECDSA DKG: Integration with the asynchronous state machine (#3392)
Here we integrate the tECDSA DKG protocol with the async state machine
introduced by #3362. The presented
changes are analogous to the recent changes introduced to the tECDSA signing
protocol by #3379. Long story short, we no longer use a fixed block duration for
protocol's states but move to a global timeout for the entire protocol attempt
and switch states as soon as possible. As result, the time of a single DKG
attempt can be reduced as the protocol is no longer fixed and can adjust to the
slowest participant.
The aforementioned change in the DKG protocol also involves a similar change in
the DKG result publication step. The publication step is now based on the
asynchronous state machine as well. This has two major consequences:
- Firstly, so far, the participants were waiting for at least a group quorum of
DKG result signatures for a fixed block duration and then moved to the result
submission state. Now, all members wait for the actual group size of DKG result
signatures and move to the result submission. This way, we are introducing an
additional health check of group participants at the result publication step
thus we maximize the final number of operating group members. This is based on
the assumption that if DKG went to the publication step, all participants had to
complete the computation step successfully, so they should be still operating
for publication.
- Secondly, the result submission queue is now time-based. Since the publication
step relies on the async state machine, we can no longer use the block counter
to set the submission eligibility queue. Each member preserves a time delay,
according to its member index, before attempting to submit the DKG result
Last but not least, we were forced to improve the message retransmission
mechanism. As the DKG's TSS round two is computationally expensive, it takes
~100 blocks to complete their computations. The current retransmission strategy
retransmits every message on every new block. On TSS round two, each member
already retransmits messages from the ephemeral key generation state and from
TSS round one. If the TSS round two state takes ~100 blocks, the amount of
messages flying around the network is really huge and often caused network
congestion. Also, the TSS round two state always takes almost all available CPU
so, the situation became even worse. This resulted in a poor DKG success rate.
To improve the situation and lower the number of messages passed through the
network, we introduced a retransmission backoff strategy (#3396). All messages
are now retransmitted at a decreasing rate so older messages are retransmitted
less and less frequently. This allowed us to achieve a good success rate of the
DKG protocol.
Changes presented in this PR were tested on a local environment with three
clients. Performed five DKGs and all were completed with success after
~18 minutes. That means we achieved an improvement as the DKG based on the sync
machine always took ~26 minutes (fixed duration of 125 computation blocks and 5
publication blocks with an average block time of 12 seconds)18 files changed
Lines changed: 683 additions & 1199 deletions
File tree
- pkg
- chain/ethereum
- internal/interception
- net
- libp2p
- local
- tbtc
- tecdsa/dkg
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | 119 | | |
121 | 120 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | 229 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
235 | 233 | | |
236 | 234 | | |
237 | 235 | | |
| |||
0 commit comments