p2p: add CInv block message helper methods
Summary:
Partial backport of core#19610:
https://github.com/bitcoin/bitcoin/pull/19610/commits/471714e1f024fb3b4892a7a8b34a76b83a13fa19
Depends on D9500.
Test Plan:
ninja all check ninja bitcoin-fuzzers
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9501