Skip to content

cmd/devp2p: verify client doesn't disconnect when non-existent block is requested #31506

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

Merged
merged 2 commits into from
May 2, 2025

Conversation

1033309821
Copy link
Contributor

We added tests for GetBlockHeaders data similar to what we did in the D2PFuzz project to the devp2p suite.

@1033309821
Copy link
Contributor Author

#31471

Copy link
Contributor

@jwasinger jwasinger left a comment

Choose a reason for hiding this comment

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

The tests should be predictable. These currently use randomly-generated values, meaning that if a failure pops up, it cannot be reproduced in a subsequent run.

Also, IMO test cases should have a focused scope and aim to capture some specific behavior (like reproducing a specific bug/client-mismatch that was found), instead of be a "catch-all".

@1033309821 1033309821 changed the title update eth/68 Bad Fuzzy GetBlockHeaders testing update eth/68 Non Existent Headers Requests testing Mar 27, 2025
@1033309821 1033309821 requested a review from jwasinger March 27, 2025 14:19
@1033309821
Copy link
Contributor Author

Dear jwasinger,
Thank you for your advice and guidance. This test checks if geth will disconnect from a peer that sends an incorrect GetBlockHeaders packet. In our tests, we found that geth and erigon clients will not disconnect, while reth, besu, and nethermind will disconnect from the peer after receiving an incorrect GetBlockHeaders packet.

@lightclient
Copy link
Member

I inverted the test to fail if the client disconnects. The devp2p protocol does not specify a client should disconnect when it receives a valid request for a non-existent header.

@lightclient lightclient changed the title update eth/68 Non Existent Headers Requests testing cmd/devp2p: verify client doesn't disconnect when non-existent block is requested May 1, 2025
@lightclient lightclient self-assigned this May 1, 2025
@lightclient lightclient merged commit ed93a5a into ethereum:master May 2, 2025
3 of 4 checks passed
@lightclient lightclient added this to the 1.15.11 milestone May 2, 2025
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.

3 participants