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

perf(node): [NET-1113] Optimize operators query in checkOperatorValueBreach #2721

Merged

Conversation

teogeb
Copy link
Contributor

@teogeb teogeb commented Aug 16, 2024

The checkOperatorValueBreach functionality uses cached list of staked operators instead of querying random operator address on each invocation.

Changes

  • OperatorPlugin creates a cache of staked operators, gives that as an to the checkOperatorValueBreach call
  • added Cache utility to @streamr/utils package
  • renamed Operator#getOperatorAddresses -> getStakedOperators, it no longer uses updateRequiredBlockNumber() functionality

Copy link

linear bot commented Aug 16, 2024

@teogeb teogeb requested a review from harbu August 16, 2024 12:45
packages/node/src/plugins/operator/OperatorPlugin.ts Outdated Show resolved Hide resolved
packages/utils/src/Cache.ts Outdated Show resolved Hide resolved
teogeb and others added 2 commits August 21, 2024 15:03
Co-authored-by: Eric Andrews <eric.andrews@streamr.com>
Co-authored-by: Eric Andrews <eric.andrews@streamr.com>
@teogeb teogeb requested a review from harbu August 21, 2024 12:13
@teogeb teogeb merged commit 4cabeeb into main Aug 21, 2024
24 checks passed
@teogeb teogeb deleted the NET-1113-optimize-operators-query-in-checkOperatorValueBreach branch August 21, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants