-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
cmd/devp2p: add eth66 test suite #22363
Conversation
ec0cb2a
to
8c71f8f
Compare
How does the |
@holiman I added some docs to the README.md. It is not possible to run this test suite against a mainnet node because the node has to be initialized with the chain and genesis file provided in the |
One little nitpick: it might be nice if the command exits orderly on errors such as not finding files:
Otherwise LGTM |
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.
One small suggestion
Amount: 2, | ||
}, | ||
} | ||
req2 := ð.GetBlockHeadersPacket66{ |
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.
Perhaps it would be good to make the two requests non-identical? If e.g. we request one header in one of the requests, and 3 headers in the other, and expect one response to have one and one to have 3.
That way we check that the remote part does indeed not care about the request id, and thus does not mix up the two requests.
Why is this a separate command? We should just run these tests as part of |
} | ||
if tx.Hash() != txHashes[len(txHashes)-1] { | ||
t.Fatalf("wrong announcement received, wanted %v got %v", tx, txHashes) | ||
for { |
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.
How can this possibly ever succeed? It will loop forever, or, in this case, eventually error out on when the remote peer don't send any more data:
unexpected message in sendSuccessfulTx: (*ethtest.Error)(could not read from connection: read tcp 127.0.0.1:45992->127.0.0.1:30303: i/o timeout)
You never exit the loop otherwise.
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.
So, what it's actually failing on is:
wrong announcement received, wanted
0x7d58c33ec2867fd7f9631b31258468d8b1b9cf71f57672e12eacc4e5a63ed84a got
[0x7d58c33ec2867fd7f9631b31258468d8b1b9cf71f57672e12eacc4e5a63ed84a 0x469d063bf70cc83df14ce191337642698da263d47d8003a7df581cdeadc2e601]
It does announce 0x7d58c33ec2867fd7f9631b31258468d8b1b9cf71f57672e12eacc4e5a63ed84a
, just not in the particular location where the test is looking :)
This PR adds the eth66 test suite to the devp2p rlpx test suite, duplicating the tests found in the eth test suite and also adding a few eth66-specific tests.