Problem
When a provider's TEE signer has not been acknowledged by the owner, incoming requests correctly fail with "service not acknowledge the tee signer". However, the service state (TeeSignerAcknowledged: false) gets cached for 15 minutes in serviceCache. Even after the owner acknowledges the TEE signer on-chain, all subsequent requests continue to fail until the cache expires.
Root Cause
ValidateRequestWithEstimatedFee in request.go:298-324 uses serviceCache (15-min TTL) to check TeeSignerAcknowledged. There is no mechanism to invalidate this cache when the owner performs an ack on-chain. The only cache clearing happens in SyncService() (service.go:65), which is called when the provider syncs its own config — not triggered by ack events.
Impact
- Request layer: All user requests fail for up to 15 minutes after the owner acks, even though the on-chain state is already correct.
- Settlement layer:
ensureTeeSignerReady() in settlement_processor.go provides a guard, but if settlement somehow proceeds with NO_TEE_SIGNER status, it's treated as a permanent failure (settlement_tee.go:579-592), deleting all pending requests for the affected user — resulting in lost fees.
Affected Code
api/inference/internal/ctrl/request.go:298-328 — cached service check
api/inference/internal/ctrl/service.go:24-42 — GetCachedService() with no ack-aware invalidation
api/inference/internal/ctrl/settlement_tee.go:579-592 — permanent failure handling deletes all pending requests
Possible Solutions
- Watch for
ProviderTEESignerAcknowledged on-chain events and invalidate serviceCache upon receipt
- Reduce cache TTL for unacknowledged services (e.g., use short TTL when
TeeSignerAcknowledged == false)
- Bypass cache when service is in unacknowledged state, always fetching fresh from contract
Problem
When a provider's TEE signer has not been acknowledged by the owner, incoming requests correctly fail with
"service not acknowledge the tee signer". However, the service state (TeeSignerAcknowledged: false) gets cached for 15 minutes inserviceCache. Even after the owner acknowledges the TEE signer on-chain, all subsequent requests continue to fail until the cache expires.Root Cause
ValidateRequestWithEstimatedFeeinrequest.go:298-324usesserviceCache(15-min TTL) to checkTeeSignerAcknowledged. There is no mechanism to invalidate this cache when the owner performs an ack on-chain. The only cache clearing happens inSyncService()(service.go:65), which is called when the provider syncs its own config — not triggered by ack events.Impact
ensureTeeSignerReady()insettlement_processor.goprovides a guard, but if settlement somehow proceeds withNO_TEE_SIGNERstatus, it's treated as a permanent failure (settlement_tee.go:579-592), deleting all pending requests for the affected user — resulting in lost fees.Affected Code
api/inference/internal/ctrl/request.go:298-328— cached service checkapi/inference/internal/ctrl/service.go:24-42—GetCachedService()with no ack-aware invalidationapi/inference/internal/ctrl/settlement_tee.go:579-592— permanent failure handling deletes all pending requestsPossible Solutions
ProviderTEESignerAcknowledgedon-chain events and invalidateserviceCacheupon receiptTeeSignerAcknowledged == false)