Skip to content

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

Merged
OptimismBot merged 2 commits into
developfrom
jg/rate_limit_p2p_unsafe_sync_requests
May 18, 2023
Merged

OptimismBot merged 2 commits into
developfrom
jg/rate_limit_p2p_unsafe_sync_requests

Conversation

@trianglesphere

@trianglesphere trianglesphere commented May 10, 2023

Copy link
Copy Markdown
Contributor

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 review from a team and tynes May 10, 2023 21:13
@changeset-bot

changeset-bot Bot commented May 10, 2023

Copy link
Copy Markdown

⚠️ 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

netlify Bot commented May 10, 2023

Copy link
Copy Markdown

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
Comment thread op-node/p2p/sync.go
Comment thread op-node/p2p/sync.go
@protolambda

Copy link
Copy Markdown
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

codecov Bot commented May 18, 2023

Copy link
Copy Markdown

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

@trianglesphere
trianglesphere requested a review from ajsutton May 18, 2023 20:12

@ajsutton ajsutton left a comment

Copy link
Copy Markdown
Contributor

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

mergify Bot commented May 18, 2023

Copy link
Copy Markdown
Contributor

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

@mergify

mergify Bot commented May 18, 2023

Copy link
Copy Markdown
Contributor

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

1 similar comment
@mergify

mergify Bot commented May 18, 2023

Copy link
Copy Markdown
Contributor

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
@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.

4 participants