-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(discv4): neighbors packet logging #12042
feat(discv4): neighbors packet logging #12042
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted the PR to a draft, you can do that when opening it, or on the right if you already have the PR open under "Reviewers" (it will say something like "Convert to draft")
I also changed the PR title, we try to just use feat:
/fix:
/test:
/perf:
/chore:
and so on :)
Generally, the PR looks good! Just some minor formatting nits. Thanks for taking this on.
For testing, you can try just running the neighbors test and adding --nocapture
to the test command and setting RUST_LOG=discv4=trace
, e.g. RUST_LOG=discv4=trace cargo test -p reth-discv4 neighbors_max_nodes -- --nocapture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is good, but please remove all additional ;
:)
and use nightly formatting cargo +nightly fmt
ping @khayss, could you remove the extra semicolons? otherwise this looks good to me:) |
f46723f
to
2841fc6
Compare
Merge activity
|
This is a draft PR.
I have gone through the code base and discovered where the
Neighbours
packet is received.I believe it is in here:
https://github.com/paradigmxyz/reth/blob/bea6e278dfdb052ce7bbcec5d42349221aa04b84/crates/net/discv4/src/lib.rs#L1770C28-L1773C30
Based on the current structure of the match block the packet is received, I added the implementation of the trace logs in the
on_neighbours
method definition of theDiscv4Service
impl block.I also added a dependency in the misc section of
discv4
, this is theitertools
package which allows for nice formatting ofVec
items.The code compiled and I ran tests which all passed.
I'd like to get reviews and also help on how I can test to see if the logs are emitted.
Tests
All tests passed.