keep-network / keep-core

The smart contracts and reference client behind the Keep network
https://keep.network
MIT License
119 stars 74 forks source link

Single-shot DKG #3776

Closed lukasz-zimnoch closed 8 months ago

lukasz-zimnoch commented 8 months ago

Refs: https://github.com/keep-network/keep-core/issues/3770 Depends on: https://github.com/keep-network/keep-core/pull/3775

The currently used DKG retry mechanism based on random exclusion turned out to be ineffective for a higher number of participating operators. Such retries have a very small chance of success and produce a lot of unnecessary network traffic that consumes bandwidth and CPU excessively.

Here we aim to improve the situation. First, we are making DKG a single-shot process that fails fast if the result cannot be produced during the first attempt. Second, we are doubling down the announcement period to maximize participation chances for all selected operators, even those at the edge of the network. Last but not least, we are reducing the submission delay that is preserved between operators attempting to submit the final result on-chain.

All those changes combined allow us to achieve shorter DKG iterations that can be timed out quicker. This way, we will be able to repeat DKG more often, with different operator sets.

Last but not least, we are also changing the re-transmission strategy for the resultSigningState which was still using StandardRetransmissionStrategy with retransmissions occurring on each tick. All DKG states use the BackoffRetransmissionStrategy strategy which leads to a sparse distribution of retransmissions and is considered more lightweight. There is no point in making an exception for the resultSigningState. This should reduce network load in case one of the participants fails at the end of the protocol.

github-actions[bot] commented 8 months ago

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/keep-core/actions/runs/7820364827 check.

github-actions[bot] commented 8 months ago

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/keep-core/actions/runs/7820549852 check.