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

proxyd/fix: error rate tolerance #5606

Merged
merged 1 commit into from
May 4, 2023
Merged

Conversation

felipe-op
Copy link
Contributor

Description

This code fixes how we calculate the error rate.
tl;dr it adds a tolerance in which the error rate will be set to 0 until we have at least 10 data points.

When the sliding window has few data points, the error rate can be skewed quickly, causing the node to the banned. I.e. for an max error rate of 50%, it takes 1 error out of 2 requests to ban the node.

Also when the window is empty, it was previously causing an division by zero.

Tests

Manual

Invariants

n/a

Additional context

Original PR: #5542
This change is part of the Consensus Aware RPC Proxy: https://www.notion.so/oplabs/Consensus-Aware-RPC-Proxy-0138e029af814e4cbca2740c7888e02d

Metadata

TODOs

@changeset-bot
Copy link

changeset-bot bot commented May 4, 2023

⚠️ No Changeset found

Latest commit: 283b80c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@netlify
Copy link

netlify bot commented May 4, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 283b80c
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/6453dd500ff7cd000728560a

@felipe-op felipe-op requested a review from mslipper May 4, 2023 16:29
@felipe-op felipe-op marked this pull request as ready for review May 4, 2023 16:53
@felipe-op felipe-op requested a review from a team as a code owner May 4, 2023 16:53
@felipe-op felipe-op merged commit 81e93a3 into develop May 4, 2023
@felipe-op felipe-op deleted the felipe/fix-error-rate branch May 4, 2023 16:53
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