Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elwood: check subscriptions before sending subscribe requests #3452

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

martin-cll
Copy link
Collaborator

@martin-cll martin-cll commented Sep 28, 2024

Slack context: https://chainlink-core.slack.com/archives/C0290SGU1KR/p1727513673689309

All Elwood connections sharing the same API key will have the same set of subscriptions, e.g. if there are multiple EAs using the same key. To avoid overloading Elwood's servers, we should only add new subscriptions if the current set of subscriptions does not have it. Similarly, we should stop unsubscribing as there is no way to know if another EA needs the asset or not.

This PR adds an API call to first fetch the set of subscribed items and filters the subscribe messages for new ones. It also ignores unsubscribe messages.

Example logs from local server:

Screenshot 2024-09-28 at 23 33 33

Copy link

changeset-bot bot commented Sep 28, 2024

🦋 Changeset detected

Latest commit: df6389c

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

This PR includes changesets to release 1 package
Name Type
@chainlink/elwood-adapter Minor

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

alecgard
alecgard previously approved these changes Sep 30, 2024
packages/sources/elwood/src/transport/util.ts Outdated Show resolved Hide resolved
@martin-cll martin-cll merged commit 93c6edf into main Sep 30, 2024
8 checks passed
@martin-cll martin-cll deleted the ml/elwood branch September 30, 2024 21:35
@github-actions github-actions bot mentioned this pull request Sep 30, 2024
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