Documentation
¶
Index ¶
- type Service
- func (s *Service) Forward(ctx context.Context) error
- func (s *Service) ListenToPolicies(ctx context.Context) error
- func (s *Service) Run(ctx context.Context)
- func (s *Service) ServeInstruction(_ context.Context, i *instruction.Instruction) (*pkgvoting.Receipt, error)
- func (s *Service) Statuses(instructionID common.Hash, rewardEpochID uint32) (*pkgvoting.Statuses, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service processes incoming instructions and manages threshold-based voting consensus.
func NewService ¶
func NewService(ctx context.Context, votingCfg *config.Voting, teeID common.Address, policiesChan <-chan policy.SigningPolicy, aq *queue.ActionQueues, meta meta.Meta, chainID uint64, m *metrics.Metrics) *Service
NewService creates a new instruction Service with the given voting config, TEE identity, and dependencies. chainID is bound into the instruction signing hash and must match the TEE node's chain ID. m may be nil or disabled.
func (*Service) ListenToPolicies ¶
ListenToPolicies listens to policy channel and creates a new round when a new policy arrives.
func (*Service) ServeInstruction ¶
func (s *Service) ServeInstruction(_ context.Context, i *instruction.Instruction) (*pkgvoting.Receipt, error)
ServeInstruction accepts instruction, processes it, and returns the receipt.
It checks that:
- correct teeID is set
- has a valid opType, opCommand pair
Additional checks are done by the voting storage.
Click to show internal directories.
Click to hide internal directories.