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

Devp2p: Per-Message debugging for ETH and other protocols / Improved docs #1449

Merged
merged 7 commits into from
Sep 6, 2021

Conversation

holgerd77
Copy link
Member

@holgerd77 holgerd77 commented Sep 3, 2021

This PR adds per-message debugging on the devp2p library for the ETH protocol as well as other protocols. This should hopefully significantly help us on a more targeted debugging along client development.

Per-Message debugging can be used as follows, see also the additions to the docs for more information:

DEBUG=devp2p:eth:BLOCK_HEADERS,devp2p:eth:GET_BLOCK_HEADERS npm run client:start

Example output:

grafik

@codecov
Copy link

codecov bot commented Sep 3, 2021

Codecov Report

Merging #1449 (457a4f8) into master (4c9d34b) will increase coverage by 1.22%.
The diff coverage is 80.14%.

Impacted file tree graph

Flag Coverage Δ
block 86.76% <ø> (+0.13%) ⬆️
blockchain 83.56% <ø> (+0.06%) ⬆️
client 82.61% <ø> (-0.28%) ⬇️
common 94.39% <ø> (+0.19%) ⬆️
devp2p 82.46% <80.14%> (+0.02%) ⬆️
ethash 86.56% <ø> (ø)
tx 88.36% <ø> (+0.11%) ⬆️
vm 82.78% <ø> (+3.45%) ⬆️

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

@holgerd77
Copy link
Member Author

Added LES as well.

This now also works for RLPx messages with e.g. DEBUG=devp2p:rlpx:peer:DISCONNECT npm run client:start:

grafik

@holgerd77
Copy link
Member Author

For DPT server messages DEBUG=devp2p:dpt:server:findneighbours npm run client:start:

grafik

@holgerd77
Copy link
Member Author

And a special logger to log along the RLPx peer DISCONNECT reason, e.g. DEBUG=devp2p:rlpx:peer:DISCONNECT:TOO_MANY_PEERS npm run client:start. Think this might likely be pretty useful on certain occasions:

grafik

@holgerd77
Copy link
Member Author

Aaaand two final debuggers which are very close to my heart and which I think will be super useful:

An IP based per-peer debugger, e.g. DEBUG=devp2p:3.209.45.79 npm run client:start:

grafik

And a special debugger only debugging the message exchange with the first successfully connected peer, used with DEBUG=devp2p:FIRST_PEER npm run client:start:

grafik

Ok. Ready for review. 😄

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

This is beautiful, I like it, and I approve this message. I dig all the additional debug visibility. I kinda wish I had all of this when I started on the snappy/NEW_BLOCK stuff 😉

@holgerd77
Copy link
Member Author

@acolytec3 Yes, totally looking forward to use this stuff myself 😄, thanks for approving!

@holgerd77
Copy link
Member Author

(pain has grown too strong here over the months... 😜)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants