2021-07-19 19:06:49 +00:00
|
|
|
package synccommittee
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
2023-03-17 18:52:56 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v4/container/queue"
|
2021-07-19 19:06:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Store defines the caches for various sync committee objects
|
|
|
|
// such as message(un-aggregated) and contribution(aggregated).
|
|
|
|
type Store struct {
|
|
|
|
messageLock sync.RWMutex
|
|
|
|
messageCache *queue.PriorityQueue
|
|
|
|
contributionLock sync.RWMutex
|
|
|
|
contributionCache *queue.PriorityQueue
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewStore initializes a new sync committee store.
|
|
|
|
func NewStore() *Store {
|
|
|
|
return &Store{
|
|
|
|
messageCache: queue.New(),
|
|
|
|
contributionCache: queue.New(),
|
|
|
|
}
|
|
|
|
}
|