keep-core icon indicating copy to clipboard operation
keep-core copied to clipboard

Group size of 100 performance fixes

Open pdyraga opened this issue 3 years ago • 0 comments

During the local testing, we discovered that generating tECDSA key with a group size of 100 is challenging and usually does not complete.

In #3161 we focused on improving TSS pre-param generation. Now, TSS pre-params are generated only when no protocol is executing at the client but it turned out it is not enough to support a group of 100 members. During the profiling, we discovered DLN proof verification in phase 2 of TSS key-generation protocol is the bottleneck.

https://github.com/bnb-chain/tss-lib/pull/203 presents a performance fix to DLN proof verification throttling the number of concurrent goroutines trying to perform the verification at the same time. This change, and increasing the time for the phase should allow the DKG to complete.

This PR updates bnb-chain/tss-lib dependency to the feature branch in https://github.com/bnb-chain/tss-lib/pull/203. It is also adding a new configuration option allowing to control key generation concurrency level. By default, DLN proof verification uses all cores available on the machine (runtime.GOMAXPROCS(0)). On a 10-core machine, when running 2 clients, it is recommended to limit the concurrency level to 4 for each client. On a 10-core machine, when running 4 clients, it is recommended to limit the concurrency level to 2 for each client.

I would appreciate local testing from every client developer to confirm the values are correct.

pdyraga avatar Aug 26 '22 08:08 pdyraga