aligned_layer
aligned_layer copied to clipboard
Refactor aggregator internal structures concurrency control
The aggregator has the following structures that are read and written concurrently:
batchesIdxByIdentifierHashbatchCreatedBlockByIdxbatchesIdentifierHashByIdxbatchDataByIdentifierHashnextBatchIndex
Access to them is being achieved with the taskMutex, but current implementation is error-prone, since it's easy to forget the usage of the mutex to access the structures, as seen in #1416.
We should refactor this logic, by encapsulating the access to these internal structures in a new structure which allows accessing in a concurrent safe manner, by using the mutex internally.