Skip to content

Conversation

@tsachiherman
Copy link
Contributor

@tsachiherman tsachiherman commented Mar 4, 2022

Summary

The DeleteOldKeys method was taking the lock for the duration of the keys deletion. This is not required, as the mutex really just need to be held to synchronize the list of participation keys. The underlying OneTimeSignatureSecrets already have a synchronization lock, which is taken as need.

Test Plan

Unit test added.

The output of the test help to detect the timing issues addressed in this PR. Before this PR, calling Key() 10 times took 4.1 seconds. With this PR, it takes 255us.

@cce cce requested a review from winder March 4, 2022 18:48
@tsachiherman tsachiherman merged commit d3dc437 into algorand:master Mar 7, 2022
@tsachiherman tsachiherman deleted the tsachi/avoidAccountManagerKeysDelays branch March 7, 2022 16:15
jannotti pushed a commit to jannotti/go-algorand that referenced this pull request Mar 13, 2022
…#3717)

## Summary

The `DeleteOldKeys` method was taking the lock for the duration of the keys deletion. This is not required, as the mutex really just need to be held to synchronize the list of participation keys. The underlying `OneTimeSignatureSecrets` already have a synchronization lock, which is taken as need.

## Test Plan

Unit test added.

The output of the test help to detect the timing issues addressed in this PR. Before this PR, calling Key() 10 times took 4.1 seconds. With this PR, it takes 255us.
@algojack algojack mentioned this pull request Mar 15, 2022
tmc pushed a commit to tmc/go-algorand that referenced this pull request Mar 7, 2025
…#3717)

## Summary

The `DeleteOldKeys` method was taking the lock for the duration of the keys deletion. This is not required, as the mutex really just need to be held to synchronize the list of participation keys. The underlying `OneTimeSignatureSecrets` already have a synchronization lock, which is taken as need.

## Test Plan

Unit test added.

The output of the test help to detect the timing issues addressed in this PR. Before this PR, calling Key() 10 times took 4.1 seconds. With this PR, it takes 255us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants