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

op-node: Modify p2p unsafe sync rate limits #5684

Merged
merged 2 commits into from
May 18, 2023

Conversation

trianglesphere
Copy link
Contributor

@trianglesphere trianglesphere commented May 10, 2023

Description

This PR adds a global rate limit to outgoing P2P unsafe sync requests in addition to the existing local rate limit. The global rate limit outgoing & ingoing rate limits have the same parameters.

This PR also modifies the rate limit parameters. I have increased the burst values (the size of a full token bucket) and in the case of the per peer rate limit decreased the rate. This was done because the burst values were smaller than the per second limits.

Lastly, clientErrRateCost must be the same as the per peer rate limit burst because if you request more tokens than the burst, the request will be rejected & the code will not achieve it's goal of delaying future requests to a peer where the request failed.

Tests

No tests.

Metadata

@trianglesphere trianglesphere requested a review from a team as a code owner May 10, 2023 21:13
@trianglesphere trianglesphere requested a review from tynes May 10, 2023 21:13
@changeset-bot
Copy link

changeset-bot bot commented May 10, 2023

⚠️ No Changeset found

Latest commit: 45fdc8d

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 10, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 45fdc8d
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/6466ae34c2687b0007deec9e

@trianglesphere trianglesphere force-pushed the jg/rate_limit_p2p_unsafe_sync_requests branch from 1be8b79 to 3b359ff Compare May 10, 2023 21:14
@trianglesphere trianglesphere requested review from ajsutton and removed request for tynes May 10, 2023 21:15
op-node/p2p/sync.go Show resolved Hide resolved
op-node/p2p/sync.go Show resolved Hide resolved
@protolambda
Copy link
Contributor

The changes look fine to me, but are the comments of @ajsutton resolved or not?

@trianglesphere trianglesphere force-pushed the jg/rate_limit_p2p_unsafe_sync_requests branch from 3b359ff to e3e4ddb Compare May 18, 2023 18:55
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #5684 (45fdc8d) into develop (846be4e) will increase coverage by 5.50%.
The diff coverage is 42.85%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5684      +/-   ##
===========================================
+ Coverage    33.77%   39.27%   +5.50%     
===========================================
  Files          351      290      -61     
  Lines        21832    24486    +2654     
  Branches       877        0     -877     
===========================================
+ Hits          7373     9618    +2245     
- Misses       13903    13970      +67     
- Partials       556      898     +342     
Flag Coverage Δ
bedrock-go-tests 39.27% <42.85%> (+11.62%) ⬆️
common-ts-tests ?
contracts-bedrock-tests ?
contracts-tests ?
core-utils-tests ?
dtl-tests ?
fault-detector-tests ?
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
op-node/p2p/sync.go 67.74% <42.85%> (+4.37%) ⬆️

... and 310 files with indirect coverage changes

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep looks fine to me given a separate story to increase the retry delay after getting errors. It used to break in that case so this is an improvement. :)

@mergify
Copy link
Contributor

mergify bot commented May 18, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented May 18, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented May 18, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@OptimismBot OptimismBot merged commit b0af2ee into develop May 18, 2023
81 of 82 checks passed
@OptimismBot OptimismBot deleted the jg/rate_limit_p2p_unsafe_sync_requests branch May 18, 2023 23:16
@mergify mergify bot removed the on-merge-train label May 18, 2023
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.

None yet

4 participants