Documentation
¶
Index ¶
- func ParseTeeID(tir *types.TeeInfoResponse) (common.Address, error)
- type Service
- func (s *Service) FetchInfo(ctx context.Context, timeout time.Duration) (*types.TeeInfoResponse, common.Hash, error)
- func (s *Service) LastAppliedPolicyID() uint32
- func (s *Service) LastAttestationErr() error
- func (s *Service) LastGovernanceHash() common.Hash
- func (s *Service) Run(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTeeID ¶ added in v0.0.18
func ParseTeeID(tir *types.TeeInfoResponse) (common.Address, error)
ParseTeeID returns the TEE identity: the address derived from the TEE public key in the response.
Types ¶
type Service ¶
type Service struct {
Latest *types.TeeInfoResponse
LastUpdated time.Time
sync.RWMutex
// contains filtered or unexported fields
}
Service holds the latest TEE info and manages updating it.
When you are accessing Latest or LastUpdate mutex should be used.
func NewService ¶
func NewService(db *gorm.DB, aq *queue.ActionQueues, rs *result.ResultStorage, tc *config.InfoTiming, ac *attestation.Config, m *metrics.Metrics) *Service
NewService creates an info Service that periodically refreshes TEE info from the tee-node and, when ac.Enabled, verifies the response's attestation. m may be nil or disabled. LastUpdated starts at construction time so info_service_delay_seconds reports real elapsed time from boot instead of a multi-decade spike before the first refresh.
func (*Service) FetchInfo ¶
func (s *Service) FetchInfo(ctx context.Context, timeout time.Duration) (*types.TeeInfoResponse, common.Hash, error)
FetchInfo updates info and returns the update along with the challenge that was sent. Callers verify TeeInfo.Challenge against the returned challenge to confirm the response answers their request.
func (*Service) LastAppliedPolicyID ¶ added in v0.0.19
LastAppliedPolicyID returns the reward epoch ID of the signing policy the tee-node most recently reported as active.
func (*Service) LastAttestationErr ¶ added in v0.0.18
LastAttestationErr returns the sticky attestation verification error, or nil if no failure has occurred.
func (*Service) LastGovernanceHash ¶ added in v0.0.21
LastGovernanceHash returns the governance hash the tee-node most recently reported in its machine data.