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

feat(op-node): Peer Score Hardening #4743

Merged
merged 30 commits into from
Mar 11, 2023
Merged

feat(op-node): Peer Score Hardening #4743

merged 30 commits into from
Mar 11, 2023

Conversation

refcell
Copy link
Contributor

@refcell refcell commented Jan 19, 2023

Description

Closes CLI-3524
Closes CLI-3245
Closes CLI-3249
Closes CLI-3247

Changelog

  • Adds peer scoring to the op-node.
  • Peer scoring metrics.
  • Peer scoring CLI Flags

@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2023

⚠️ No Changeset found

Latest commit: 831f9f6

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

@refcell refcell self-assigned this Jan 19, 2023
op-node/p2p/gossip.go Outdated Show resolved Hide resolved
@tynes
Copy link
Contributor

tynes commented Jan 19, 2023

Not opposed to the comments being broken out into their own PR

@refcell
Copy link
Contributor Author

refcell commented Jan 20, 2023

Not opposed to the comments being broken out into their own PR

Will do going forward - keeping for now as i'm still learning.

@refcell refcell changed the title feat: a foray into opnode p2p - peer score metrics feat: op-node Peer Score Metrics Jan 21, 2023
op-node/p2p/node.go Outdated Show resolved Hide resolved
@refcell refcell marked this pull request as ready for review January 23, 2023 15:22
@refcell refcell requested a review from a team as a code owner January 23, 2023 15:22
@refcell refcell requested a review from tynes January 23, 2023 15:22
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

Really nice doc additions in the heartbeat & sources packages, but could you pull them out of this PR into a separate PR. We try to keep PRs as a single unit rather than pulling in a bunch of disparate changes.

op-node/p2p/gossip.go Outdated Show resolved Hide resolved
op-node/metrics/metrics.go Outdated Show resolved Hide resolved
op-node/p2p/gossip.go Outdated Show resolved Hide resolved
op-node/p2p/peer_params.go Outdated Show resolved Hide resolved
op-node/p2p/peer_params.go Show resolved Hide resolved
op-node/p2p/peer_scorer.go Outdated Show resolved Hide resolved
op-node/p2p/peer_scorer.go Outdated Show resolved Hide resolved
@refcell refcell mentioned this pull request Jan 23, 2023
Co-authored-by: protolambda <proto@protolambda.com>
op-node/p2p/peer_scorer.go Outdated Show resolved Hide resolved
@tynes
Copy link
Contributor

tynes commented Jan 23, 2023

Going to defer most review here to @protolambda and @trianglesphere as I'm not super familiar with the internals of libp2p and have other things that I need to prioritize

Good job with the documented code @refcell

@mergify
Copy link
Contributor

mergify bot commented Jan 23, 2023

Hey @refcell! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jan 23, 2023
@mergify mergify bot removed the conflict label Jan 24, 2023
@refcell refcell changed the title feat: op-node Peer Score Metrics feat: op-node peer scoring Jan 24, 2023
@mslipper mslipper marked this pull request as draft January 26, 2023 18:17
op-node/p2p/peer_gater.go Outdated Show resolved Hide resolved
@refcell refcell marked this pull request as ready for review March 9, 2023 23:41
@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Merging #4743 (831f9f6) into develop (962ac1d) will decrease coverage by 4.30%.
The diff coverage is 26.40%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4743      +/-   ##
===========================================
- Coverage    40.51%   36.22%   -4.30%     
===========================================
  Files          288      207      -81     
  Lines        20119    17224    -2895     
  Branches       602        0     -602     
===========================================
- Hits          8152     6240    -1912     
+ Misses       11346    10355     -991     
- Partials       621      629       +8     
Flag Coverage Δ
bedrock-go-tests 36.22% <26.40%> (-0.28%) ⬇️
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/flags/p2p_flags.go 100.00% <ø> (ø)
op-node/metrics/metrics.go 1.33% <0.00%> (-0.05%) ⬇️
op-node/p2p/cli/load_config.go 0.00% <0.00%> (ø)
op-node/p2p/mocks/Peerstore.go 0.00% <0.00%> (ø)
op-node/p2p/prepared.go 0.00% <0.00%> (ø)
op-node/p2p/topic_params.go 0.00% <0.00%> (ø)
op-node/service.go 0.00% <0.00%> (ø)
op-node/sources/batching.go 85.56% <ø> (+2.91%) ⬆️
op-node/p2p/mocks/ConnectionGater.go 5.16% <5.16%> (ø)
op-node/p2p/rpc_server.go 71.42% <8.33%> (ø)
... and 9 more

... and 91 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.

I don't know the implementation details of go libp2p enough to review a lot of this, but left a few comments for the parts I do understand. :)

op-node/metrics/metrics.go Outdated Show resolved Hide resolved
op-node/p2p/peer_params.go Show resolved Hide resolved
op-e2e/system_test.go Show resolved Hide resolved
Copy link
Contributor

@protolambda protolambda left a comment

Choose a reason for hiding this comment

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

+1 on the invalid-messages testing note by Adrian. We can do so in a separate follow-up PR though. This one is consistent and complete to merge, and already quite large. If you do mark as resolved, do open an issue for the ban testing so we can track it

op-e2e/system_test.go Show resolved Hide resolved
@mergify mergify bot merged commit c785e35 into develop Mar 11, 2023
@mergify mergify bot deleted the refcell/p2p_cli branch March 11, 2023 01:58
@mergify
Copy link
Contributor

mergify bot commented Mar 11, 2023

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

@mergify
Copy link
Contributor

mergify bot commented Mar 11, 2023

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

@mergify mergify bot removed the on-merge-train label Mar 11, 2023
@@ -115,7 +115,6 @@ func (ibc *IterativeBatchCall[K, V]) Fetch(ctx context.Context) error {
}
return ctx.Err()
default:
break
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this removed? I think it's a no-op, but it seems really unrelated

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.

6 participants