This enables the following linters
- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec
WIth a few exceptions.
- We use a deprecated protobuf in trezor. I didn't want to mess with that, since I cannot meaningfully test any changes there.
- The deprecated TypeMux is used in a few places still, so the warning for it is silenced for now.
- Using string type in context.WithValue is apparently wrong, one should use a custom type, to prevent collisions between different places in the hierarchy of callers. That should be fixed at some point, but may require some attention.
- The warnings for using weak random generator are squashed, since we use a lot of random without need for cryptographic guarantees.
This PR groups all built-in network flags together and list them in the command as a whole.
And all database path flags(datadir, ancient) are also grouped, since usually these two are
used together.
Debugging recent geth failures in hive, it took a while to realize that it's because
geth doesn't support eth/65 any longer. This PR makes such failures a bit more
easy to figure out.
* cmd/devp2p/internal/ethtest: only use eth66 if eth66 is negotiated
* cmd/devp2p/internal/ethtest: switch on concrete type not pointer
* cmd/devp2p/internal/ethtest: switch on concrete type not pointer
This PR fixes a false positive PONG 'to' endpoint mismatch seen in hive tests:
got {IP:172.17.0.7 UDP:44025 TCP:44025}, want {IP:172.17.0.7 UDP:44025 TCP:0}
Co-authored-by: Felix Lange <fjl@twurst.com>
This PR refactors the eth test suite to make it more readable and
easier to use. Some notable differences:
- A new file helpers.go stores all of the methods used between
both eth66 and eth65 and below tests, as well as methods shared
among many test functions.
- suite.go now contains all of the test functions for both eth65
tests and eth66 tests.
- The utesting.T object doesn't get passed through to other helper methods,
but is instead only used within the scope of the test function,
whereas helper methods return errors, so only the test function
itself can fatal out in the case of an error.
- The full test suite now only takes 13.5 seconds to run.
This changes the SimultaneousRequests test to send the requests from the same
connection, as it doesn't really make sense to test whether a node can respond
to two requests with different request IDs from separate connections.
This PR fixes an issue with the eth66 test suite where, during a readAndServe when
the test is manually responding to GetBlockHeader requests, it now responds
with a BlockHeaders eth66 packet that includes the inbound request ID.
This PR replaces the old test genesis.json and chain.rlp files in the testdata
directory for the eth protocol test suite, and also adds documentation for
running the eth test suite locally.
It also improves the test output text and adds more timeouts.
Co-authored-by: Felix Lange <fjl@twurst.com>
The old one was wrong in two ways: the first block in chain.rlp was the
genesis block, and the genesis difficulty was below minimum difficulty.
This also contains some other fixes to the test.