Skip to content

OPDATA-7792: InfraLabs EA#5116

Draft
yasssuzcll wants to merge 2 commits into
mainfrom
yasssuz/feature/infralabs
Draft

OPDATA-7792: InfraLabs EA#5116
yasssuzcll wants to merge 2 commits into
mainfrom
yasssuz/feature/infralabs

Conversation

@yasssuzcll

@yasssuzcll yasssuzcll commented Jun 19, 2026

Copy link
Copy Markdown

OPDATA-7792

Description

Adds a new external adapter for [Infralabs], exposing a single ushp endpoint.

The adapter fetches the latest value from the Infralabs REST API, verifies the response's cryptographic signature using an AWS KMS-hosted public key, validates data freshness against a configurable staleness threshold, and rescales the integer result to 8 decimal places before returning it.

Key implementation details:

  • KMS signature verification: the response signature is verified against the AWS KMS public key. On failure, the adapter attempts a one-time key refresh to handle provider-side key rotations before rejecting the response.
  • Staleness guard: responses older than USHP_MAX_STALENESS_SECS are rejected with a 502.
  • Integer rescaling: the provider's value/scale pair is converted to a fixed 8-decimal output using BigInt arithmetic to avoid floating-point loss.

Changes

  • New adapter at packages/sources/infralabs
  • ushp endpoint with no input parameters
  • InfralabsTransport base class with KMS key caching and rotation support
  • Unit and integration tests
  • README

Steps to Test

# Set required env vars
export API_KEY=<infralabs-api-key>
export AWS_ACCESS_KEY_ID=<aws-key-id>
export AWS_SECRET_ACCESS_KEY=<aws-secret>

curl -X POST http://localhost:8080 \
  -H 'Content-Type: application/json' \
  -d '{"data": {"endpoint": "ushp"}}'

Expected response shape:
{
  "result": "10039683",
  "data": {
    "price": 1.00396832,
    "rawValue": "1003968325",
    "scale": 9,
    "lastUpdatedAt": 1718000000,
    "signature": "<base64>"
  },
  "statusCode": 200
}

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

@yasssuzcll yasssuzcll self-assigned this Jun 19, 2026
@changeset-bot

changeset-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 587548e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chainlink/infralabs-adapter Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yasssuzcll yasssuzcll changed the title Yasssuz/feature/infralabs OPDATA-7792: InfraLabs EA Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant