While digging around the net code and tests, I realized these cases are not covered.
There are related tests that cover similar code paths in p2p_fingerprint and others, but they
do not test this behavior explicitly.
Details
- Reviewers
deadalnix Fabien - Group Reviewers
Restricted Project - Commits
- rSTAGING67c715cd4553: Add test coverage for messages requesting invalid blocks
rABC67c715cd4553: Add test coverage for messages requesting invalid blocks
test_runner.py abc-get-invalid-block
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
test/functional/abc-get-invalid-block.py | ||
---|---|---|
30 ↗ | (On Diff #14299) | I think you mean GETBLOCKS as MSG_BLOCK is to send a block not request one. Also, there's no compact block equivalent message in net_processing that I see. I also don't see any appropriate wrapper for GETDATA that abstracts away these magic numbers. Plenty of other tests use this atm, so I don't think this is a huge issue. |
The description give no real information as to what this is actually doing or testing.
test/functional/abc-get-invalid-block.py | ||
---|---|---|
93 ↗ | (On Diff #14341) | Time based tests are going to be both slow and flaky. This is not the approach you want to take. |
test/functional/abc-get-invalid-block.py | ||
---|---|---|
30 ↗ | (On Diff #14299) | It's not about the message but about the inventory type in getdata: https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors. |
test/functional/abc-get-invalid-block.py | ||
---|---|---|
30 ↗ | (On Diff #14299) | Oh gotcha. |
- Use assert_debug_log instead of time.sleep
- Refactor to prevent needing to jump around the code just to read and understand everything.
- Add MSG_CMPCTBLOCK to messages.py
- Improve perf from ~25 seconds to ~6 seconds