Documentation ¶
Overview ¶
Package keymanager implements the key manager worker.
Index ¶
- type AccessList
- type PeerMap
- type RuntimeList
- type TaskInfo
- type TaskQueue
- func (s *TaskQueue) Add(info *TaskInfo)
- func (s *TaskQueue) Cancel(epoch beacon.EpochTime, cause error)
- func (s *TaskQueue) Clear(epoch beacon.EpochTime)
- func (s *TaskQueue) Get(churpID uint8) (*TaskInfo, bool)
- func (s *TaskQueue) Remove(info *TaskInfo, cause error)
- func (s *TaskQueue) Run(epoch beacon.EpochTime, height int64) []*TaskInfo
- func (s *TaskQueue) Stop(cause error)
- type Worker
- func (w *Worker) CallEnclave(ctx context.Context, data []byte, kind enclaverpc.Kind) ([]byte, error)
- func (w *Worker) Cleanup()
- func (w *Worker) Enabled() bool
- func (w *Worker) GetRuntime() runtimeRegistry.Runtime
- func (w *Worker) GetStatus() (*api.Status, error)
- func (w *Worker) Initialized() <-chan struct{}
- func (w *Worker) Name() string
- func (w *Worker) NewRuntimeHostHandler() host.RuntimeHandler
- func (w *Worker) NewRuntimeHostNotifier(ctx context.Context, host host.Runtime) protocol.Notifier
- func (w *Worker) Quit() <-chan struct{}
- func (w *Worker) Start() error
- func (w *Worker) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessList ¶ added in v0.2400.0
type AccessList struct {
// contains filtered or unexported fields
}
AccessList is a thread-safe data structure for managing access permissions.
func NewAccessList ¶ added in v0.2400.0
func NewAccessList() *AccessList
NewAccessList constructs an empty access list.
func (*AccessList) RuntimeAccessLists ¶ added in v0.2400.0
func (l *AccessList) RuntimeAccessLists() []api.RuntimeAccessList
RuntimeAccessLists returns a per-runtime list of allowed peers.
func (*AccessList) Runtimes ¶ added in v0.2400.0
func (l *AccessList) Runtimes(peer core.PeerID) *RuntimeList
Runtimes returns the IDs of runtimes in which the given peer participates.
func (*AccessList) Update ¶ added in v0.2400.0
func (l *AccessList) Update(runtimeID common.Namespace, peers []core.PeerID)
Update clears the access list for the specified runtime and adds the provided peers.
func (*AccessList) UpdateNodes ¶ added in v0.2400.0
func (l *AccessList) UpdateNodes(runtimeID common.Namespace, nodes []*node.Node)
UpdateNodes converts node public keys to peer IDs and updates the access list for the specified runtime.
type PeerMap ¶ added in v0.2400.0
type PeerMap struct {
// contains filtered or unexported fields
}
PeerMap is a thread-safe data structure for translating peer IDs to node IDs.
func NewPeerMap ¶ added in v0.2400.0
func NewPeerMap() *PeerMap
NewPeerMap creates an empty peer map.
type RuntimeList ¶ added in v0.2400.0
type RuntimeList struct {
// contains filtered or unexported fields
}
RuntimeList is a thread-safe collection of unique runtime IDs.
func NewRuntimeList ¶ added in v0.2400.0
func NewRuntimeList() *RuntimeList
NewRuntimeList constructs an empty runtime list.
func (*RuntimeList) Add ¶ added in v0.2400.0
func (l *RuntimeList) Add(runtimeID common.Namespace)
Add adds the given runtime to the list.
func (*RuntimeList) Contains ¶ added in v0.2400.0
func (l *RuntimeList) Contains(runtimeID common.Namespace) bool
Contains returns true if and only if the list contains the given runtime.
A nil runtime list is considered empty and will always return false.
func (*RuntimeList) Delete ¶ added in v0.2400.0
func (l *RuntimeList) Delete(runtimeID common.Namespace)
Delete removes the given runtime from the list.
If the runtime list is nil or there is no such element, this function is a no-op.
func (*RuntimeList) Empty ¶ added in v0.2400.0
func (l *RuntimeList) Empty() bool
Empty returns true if and only if the list contains no elements.
type TaskInfo ¶ added in v0.2400.0
type TaskInfo struct {
// contains filtered or unexported fields
}
TaskInfo contains details about a scheduled task.
type TaskQueue ¶ added in v0.2400.0
type TaskQueue struct {
// contains filtered or unexported fields
}
TaskQueue represents a queue of tasks.
func (*TaskQueue) Cancel ¶ added in v0.2400.0
Cancel cancels and removes all running tasks with the next handoff epoch smaller than the given value.
func (*TaskQueue) Clear ¶ added in v0.2400.0
Clear removes all scheduled tasks with the next handoff epoch smaller than the given value.
func (*TaskQueue) Get ¶ added in v0.2400.0
Get returns the information about a task with the given identifier.
func (*TaskQueue) Remove ¶ added in v0.2400.0
Remove removes the given task from the task queue and stops it if it is running.
type Worker ¶
type Worker struct { sync.RWMutex *runtimeRegistry.RuntimeHostNode // contains filtered or unexported fields }
Worker is the key manager worker.
It behaves differently from other workers as the key manager has its own runtime. It needs to keep track of executor committees for other runtimes in order to update the access control lists.
func New ¶
func New( commonWorker *workerCommon.Worker, r *registration.Worker, backend api.Backend, ) (*Worker, error)
New constructs a new key manager worker.
func (*Worker) CallEnclave ¶
func (*Worker) GetRuntime ¶
func (w *Worker) GetRuntime() runtimeRegistry.Runtime
GetRuntime implements workerCommon.RuntimeHostHandlerFactory.
func (*Worker) Initialized ¶
func (w *Worker) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the worker is initialized, ready to service requests and registered with the consensus layer.
func (*Worker) NewRuntimeHostHandler ¶
func (w *Worker) NewRuntimeHostHandler() host.RuntimeHandler
NewRuntimeHostHandler implements workerCommon.RuntimeHostHandlerFactory.
func (*Worker) NewRuntimeHostNotifier ¶ added in v0.2103.0
NewRuntimeHostNotifier implements workerCommon.RuntimeHostHandlerFactory.