HomePhabricator

[backport#19272] net, test: invalid p2p messages and test framework improvements

Description

[backport#19272] net, test: invalid p2p messages and test framework improvements

Summary:
56010f92564a94b0ca6c008c0e6f74a19fad4a2a test: hoist p2p values to test framework constants (Jon Atack)
75447f0893f9ad9bf83d182b301d139430d8de1c test: improve msg sends and p2p disconnections in p2p_invalid_messages (Jon Atack)
57960192a5362ff1a7b996995332535f4c2a25c3 test: refactor test_large_inv() into 3 tests with common method (Jon Atack)
e2b21d8a597c536a8617408d43958bfe9f98a442 test: add p2p_invalid_messages logging (Jon Atack)
9fa494dc0969c61d5ef33708a08923cca19ce091 net: update misbehavior logging for oversized messages (Jon Atack)

Pull request description:

...seen while reviewing #19264, #19252, #19304 and #19107:

in net_processing.cpp

  • make the debug logging for oversized message size misbehavior the same for addr, getdata, headers and inv messages

in p2p_invalid_messages

  • add missing logging
  • improve assertions/message sends, move cleanup disconnections outside the assertion scopes
  • split a slowish 3-part test into 3 order-independent tests
  • add a few p2p constants to the test framework

Backport of core#19272

Test Plan:

ninja all check check-functional

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9530

Details

Provenance
majcostaAuthored on May 14 2021, 23:36
majcostaPushed on May 17 2021, 15:49
Reviewer
Restricted Project
Differential Revision
D9530: [backport#19272] net, test: invalid p2p messages and test framework improvements
Parents
rABC39b5c01a216d: [avalanche] Consistently use Proof::FromHex() for deserializing a proof
Branches
Unknown
Tags
Unknown