Skip to content

Conversation

@dskloetc
Copy link
Contributor

@dskloetc dskloetc commented Dec 9, 2025

OPDATA-4597

Description

por-indexer iterates over all addresses and address them to a list like this [...existingAddresses, address].
This is O(n^2).

Changes

Changed the code to use push instead of [..., ].

Steps to Test

  1. Added some timing code and noticed that for 25,000 addresses the time went from >500ms to <10ms for just this loop, on my Mac.
  2. Tested with the params of all 33 feeds in RDD that use por-indexer.
  3. Existing test pass.

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.

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 94bdfbc

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

This PR includes changesets to release 1 package
Name Type
@chainlink/por-indexer-adapter Patch

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

@dskloetc dskloetc marked this pull request as ready for review December 10, 2025 10:30
@dskloetc dskloetc requested a review from a team December 10, 2025 12:36
mxiao-cll
mxiao-cll previously approved these changes Dec 10, 2025
@dskloetc dskloetc enabled auto-merge (squash) December 10, 2025 15:38
@dskloetc dskloetc merged commit 753e6c9 into main Dec 10, 2025
15 of 16 checks passed
@dskloetc dskloetc deleted the kloet/lombard branch December 10, 2025 15:46
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.

2 participants