-
Notifications
You must be signed in to change notification settings - Fork 75
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
Confirm DKG start before triggering off-chain protocol #3468
Conversation
So far, the tECDSA DKG was triggered using a simple event listener acting on `DKGStarted` events. However, small chain reorgs may cause different `startBlock` to be received by DKG participants. That can lead to invalid signatures over the produced DKG result as the `startBlock` is one of the signature's components. Here we improve that by adding a confirmation mechanism that delays the start of the off-chain protocol until the event and DKG on-chain state is confirmed.
The off-chain protocol should be started as close as possible to the current block or even further. Starting the off-chain protocol with a past block will likely cause a failure of the first attempt as the start block is used to synchronize the announcements and the state machine. Here we ensure a proper start point by delaying the execution by the confirmation period length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't test this code given #3460 is not yet finished and I am struggling to set up the environment. If you performed tests locally @lukasz-zimnoch I will trust your verification and merge the PR once the code comments are addressed. We will deploy it to testnet for another verification as well.
I have tested the basic scenario: request a new wallet to trigger DKG, wait until the confirmation period elapses, and check if nodes executed the protocol as expected. The corner cases involving reorgs and event duplicates must be checked on testnet |
Closes: #3456
So far, the tECDSA DKG was triggered using a simple event listener acting on
DKGStarted
events. However, small chain reorgs may cause differentstartBlock
to be received by DKG participants. That can lead to invalid signatures over the produced DKG result as thestartBlock
is one of the signature's components. Here we improve that by adding a confirmation mechanism that delays the start of the off-chain protocol until the event and DKG on-chain state is confirmed. This way clients are sure to use a finalized event that will no longer be the subject of chain reorgs.